send broadcast intents to voice search for logging purposes
Fix for http://b/issue?id=2390720
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index ebb5246..864d688 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -111,6 +111,7 @@
import android.accounts.AccountManagerCallback;
import com.android.common.Patterns;
+import com.android.common.speech.LoggingEvents;
import com.google.android.gsf.GoogleLoginServiceConstants;
@@ -487,6 +488,20 @@
// search, so do nothing.
return;
}
+ if (Intent.ACTION_SEARCH.equals(action)
+ && current.voiceSearchSourceIsGoogle()) {
+ Intent logIntent = new Intent(
+ LoggingEvents.ACTION_LOG_EVENT);
+ logIntent.putExtra(LoggingEvents.EXTRA_EVENT,
+ LoggingEvents.VoiceSearch.QUERY_UPDATED);
+ logIntent.putExtra(
+ LoggingEvents.VoiceSearch.EXTRA_QUERY_UPDATED_VALUE,
+ intent.getDataString());
+ sendBroadcast(logIntent);
+ // Note, onPageStarted will revert the voice title bar
+ // When http://b/issue?id=2379215 is fixed, we should update
+ // the title bar here.
+ }
}
// If this was a search request (e.g. search query directly typed into the address bar),
// pass it on to the default web search provider.