Bug 789947 - Setting up search engines creates an extra top sites filter query. r=bnicholson
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Thu, 13 Sep 2012 13:00:03 +0200
changeset 106986 a71b19fafcbe160ae40d722e2c0e8f6c014a132f
parent 106985 c1cfb5997d3043e67c0639c93ae8a785f998d98a
child 106987 e7b4f8be9a4d4625bb858e8dce35c03e6aaeca80
push id23458
push useremorley@mozilla.com
push dateThu, 13 Sep 2012 19:52:36 +0000
treeherdermozilla-central@a41731220fec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbnicholson
bugs789947
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 789947 - Setting up search engines creates an extra top sites filter query. r=bnicholson
mobile/android/base/awesomebar/AllPagesTab.java
--- a/mobile/android/base/awesomebar/AllPagesTab.java
+++ b/mobile/android/base/awesomebar/AllPagesTab.java
@@ -120,16 +120,20 @@ public class AllPagesTab extends Awesome
         if (cursor != null)
             cursor.close();
     }
 
     public void filter(String searchTerm) {
         AwesomeBarCursorAdapter adapter = getCursorAdapter();
         adapter.filter(searchTerm);
 
+        filterSuggestions(searchTerm);
+    }
+
+    private void filterSuggestions(String searchTerm) {
         // cancel previous query
         if (mSuggestTask != null) {
             mSuggestTask.cancel(true);
         }
 
         if (mSuggestClient != null) {
             mSuggestTask = new AsyncTask<String, Void, ArrayList<String>>() {
                  protected ArrayList<String> doInBackground(String... query) {
@@ -472,17 +476,17 @@ public class AllPagesTab extends Awesome
                 } else {
                     mSearchEngines.add(new SearchEngine(name, icon));
                 }
             }
         } catch (JSONException e) {
             Log.e(LOGTAG, "Error getting search engine JSON", e);
         }
 
-        filter(mSearchTerm);
+        filterSuggestions(mSearchTerm);
     }
 
     private Drawable getDrawableFromDataURI(String dataURI) {
         String base64 = dataURI.substring(dataURI.indexOf(',') + 1);
         Drawable drawable = null;
         try {
             byte[] bytes = GeckoAppShell.decodeBase64(base64, GeckoAppShell.BASE64_DEFAULT);
             ByteArrayInputStream stream = new ByteArrayInputStream(bytes);