OSDN Git Service

Identify in logs launch of voice search from key events
authorJean-Michel Trivi <jmtrivi@google.com>
Fri, 19 Apr 2013 23:25:35 +0000 (16:25 -0700)
committerJean-Michel Trivi <jmtrivi@google.com>
Fri, 19 Apr 2013 23:25:35 +0000 (16:25 -0700)
Clearly identify in the logs when AudioService starts one of
 the following two intents in response to long-press on
 the KEYCODE_HEADSETHOOK key: ACTION_WEB_SEARCH and
 ACTION_VOICE_SEARCH_HANDS_FREE.

Bug 8095981

Change-Id: I14ca99533dfb011cdc530c0bafd8104ff2436c7d

media/java/android/media/AudioService.java

index 0df4f82..76d811e 100644 (file)
@@ -4699,10 +4699,12 @@ public class AudioService extends IAudioService.Stub implements OnFinished {
         boolean isLocked = mKeyguardManager != null && mKeyguardManager.isKeyguardLocked();
         if (!isLocked && pm.isScreenOn()) {
             voiceIntent = new Intent(android.speech.RecognizerIntent.ACTION_WEB_SEARCH);
+            Log.i(TAG, "voice-based interactions: about to use ACTION_WEB_SEARCH");
         } else {
             voiceIntent = new Intent(RecognizerIntent.ACTION_VOICE_SEARCH_HANDS_FREE);
             voiceIntent.putExtra(RecognizerIntent.EXTRA_SECURE,
                     isLocked && mKeyguardManager.isKeyguardSecure());
+            Log.i(TAG, "voice-based interactions: about to use ACTION_VOICE_SEARCH_HANDS_FREE");
         }
         // start the search activity
         if (needWakeLock) {