summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2014-11-21 22:32:46 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-11-21 22:32:46 +0000
commit92923dc057d021af48fb4fb75ee5eedfa7c973e7 (patch)
treec2b7562d81cde97248c50580b80e5a80ce543b93
parent85edae455bdef7e5e393d7d451478fe7530868b9 (diff)
parent9d87d918e4dcaa667db1ec74fde7cab549a8fa87 (diff)
downloadandroid_packages_apps_Dialer-92923dc057d021af48fb4fb75ee5eedfa7c973e7.tar.gz
android_packages_apps_Dialer-92923dc057d021af48fb4fb75ee5eedfa7c973e7.tar.bz2
android_packages_apps_Dialer-92923dc057d021af48fb4fb75ee5eedfa7c973e7.zip
am 9d87d918: am 9a2e803c: am db5fe64c: Merge "Correcting population of search box with voice search results." into lmp-mr1-dev
* commit '9d87d918e4dcaa667db1ec74fde7cab549a8fa87': Correcting population of search box with voice search results.
-rw-r--r--src/com/android/dialer/DialtactsActivity.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index 3c9b870dd..5e6f03597 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -229,6 +229,12 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
private int mActionBarHeight;
+ /**
+ * The text returned from a voice search query. Set in {@link #onActivityResult} and used in
+ * {@link #onResume()} to populate the search box.
+ */
+ private String mVoiceSearchQuery;
+
private class OptionsPopupMenu extends PopupMenu {
public OptionsPopupMenu(Context context, View anchor) {
super(context, anchor, Gravity.END);
@@ -477,6 +483,16 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
showDialpadFragment(false);
mShowDialpadOnResume = false;
}
+
+ // If there was a voice query result returned in the {@link #onActivityResult} callback, it
+ // will have been stashed in mVoiceSearchQuery since the search results fragment cannot be
+ // shown until onResume has completed. Active the search UI and set the search term now.
+ if (!TextUtils.isEmpty(mVoiceSearchQuery)) {
+ mActionBarController.onSearchBoxTapped();
+ mSearchView.setText(mVoiceSearchQuery);
+ mVoiceSearchQuery = null;
+ }
+
mFirstLaunch = false;
if (mIsRestarting) {
@@ -618,7 +634,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
RecognizerIntent.EXTRA_RESULTS);
if (matches.size() > 0) {
final String match = matches.get(0);
- mSearchView.setText(match);
+ mVoiceSearchQuery = match;
} else {
Log.e(TAG, "Voice search - nothing heard");
}