Browse files

Merge "Send out a broadcast intent when BT voice dialing is shut down…

…." into gingerbread
  • Loading branch information...
2 parents 51d52d4 + 7923e29 commit f210af5499aec33a3da161ffee2917a54b3f5b3d @cyanogen cyanogen committed with Gerrit Code Review Jun 7, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/com/android/phone/BluetoothHandsfree.java
View
7 src/com/android/phone/BluetoothHandsfree.java
@@ -116,7 +116,10 @@
private DebugThread mDebugThread;
private int mScoGain = Integer.MIN_VALUE;
+ private static final String ACTION_VOICE_COMMAND_STOP = "com.android.internal.intent.action.VOICE_COMMAND_STOP";
+
private static Intent sVoiceCommandIntent;
+ private static Intent sVoiceCommandStopIntent;
// Audio parameters
private static final String HEADSET_NREC = "bt_headset_nrec";
@@ -191,6 +194,9 @@ public BluetoothHandsfree(Context context, CallManager cm) {
sVoiceCommandIntent = new Intent(Intent.ACTION_VOICE_COMMAND);
sVoiceCommandIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
+ if (sVoiceCommandStopIntent == null) {
+ sVoiceCommandStopIntent = new Intent(ACTION_VOICE_COMMAND_STOP);
+ }
if (mContext.getPackageManager().resolveActivity(sVoiceCommandIntent, 0) != null &&
BluetoothHeadset.isBluetoothVoiceDialingEnabled(mContext)) {
mLocalBrsf |= BRSF_AG_VOICE_RECOG;
@@ -2107,6 +2113,7 @@ public AtCommandResult handleSetCommand(Object[] args) {
}
return new AtCommandResult(AtCommandResult.UNSOLICITED); // send nothing yet
} else if (args.length >= 1 && args[0].equals(0)) {
+ mContext.sendBroadcast(sVoiceCommandStopIntent);
audioOff();
return new AtCommandResult(AtCommandResult.OK);
}

0 comments on commit f210af5

Please sign in to comment.