This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

superconfig / tools / hermes-voice / android / src / us / lassul / assist / AssistActivity.java
714 B 19 lines
1package us.lassul.assist; 2 3import android.app.Activity; 4import android.content.Intent; 5 6/** 7 * The headset's voice button (VOICE_COMMAND) and the assist gesture: starts a call and vanishes. 8 * Starting it here, in onResume, is what lets CallService run in the foreground with the 9 * microphone: Android allows that only while the app is in front, which this activity is for a 10 * moment, over the lock screen too (showWhenLocked, turnScreenOn in the manifest). 11 */ 12public class AssistActivity extends Activity { 13 @Override 14 protected void onResume() { 15 super.onResume(); 16 startForegroundService(new Intent(this, CallService.class).setAction(CallService.ACTION_START)); 17 finish(); 18 } 19}