summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWinson <winsonc@google.com>2016-08-03 17:08:10 -0700
committerWinson <winsonc@google.com>2016-08-03 18:01:10 -0700
commit45a11dd9ee5c9cdaa65527ae0ef1c8b004417f28 (patch)
tree33f416889d62aace21619a34180e01da5d2b5ae9 /src
parent5a5eb846c410c6ed6c1c0fb01edf82e118c35830 (diff)
downloadandroid_packages_apps_Trebuchet-45a11dd9ee5c9cdaa65527ae0ef1c8b004417f28.tar.gz
android_packages_apps_Trebuchet-45a11dd9ee5c9cdaa65527ae0ef1c8b004417f28.tar.bz2
android_packages_apps_Trebuchet-45a11dd9ee5c9cdaa65527ae0ef1c8b004417f28.zip
Prevent refreshing app search results with empty query.
- Any change to the TextView text will cause mQuery to be set, which will cause a new search next time refreshSearchResult is called. We should also be checking there if it is a valid search query before starting a new search. Bug: 30606307 Change-Id: I08640c56199211f2aeea2386fcf699810853ab58
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/allapps/AllAppsSearchBarController.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsSearchBarController.java b/src/com/android/launcher3/allapps/AllAppsSearchBarController.java
index b965d744f..9a48367cd 100644
--- a/src/com/android/launcher3/allapps/AllAppsSearchBarController.java
+++ b/src/com/android/launcher3/allapps/AllAppsSearchBarController.java
@@ -20,6 +20,7 @@ import android.content.Intent;
import android.graphics.Rect;
import android.net.Uri;
import android.text.Editable;
+import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.View;
@@ -102,7 +103,7 @@ public abstract class AllAppsSearchBarController
}
protected void refreshSearchResult() {
- if (mQuery == null) {
+ if (TextUtils.isEmpty(mQuery)) {
return;
}
// If play store continues auto updating an app, we want to show partial result.
@@ -143,7 +144,6 @@ public abstract class AllAppsSearchBarController
unfocusSearchField();
mCb.clearSearchResult();
mInput.setText("");
- // We need to reset this after we clear the input text
mQuery = null;
hideKeyboard();
}