Bug 917350 - Move loader init() implementation to SearchLoader (r=margaret)
authorLucas Rocha <lucasr@mozilla.com>
Wed, 16 Oct 2013 10:30:39 +0100
changeset 165743 b301518fc84380ade88db5706f3d0217be93fc10
parent 165742 0fb839beb7e49c1a08ba6655548c2455cf71c74e
child 165744 759187c7a9a9bda0b0b0b15e1b3139bf1d0e5c5b
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs917350
milestone27.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 917350 - Move loader init() implementation to SearchLoader (r=margaret)
mobile/android/base/home/BrowserSearch.java
mobile/android/base/home/SearchLoader.java
--- a/mobile/android/base/home/BrowserSearch.java
+++ b/mobile/android/base/home/BrowserSearch.java
@@ -310,17 +310,17 @@ public class BrowserSearch extends HomeF
                     setSearchEngines(message);
                 }
             });
         }
     }
 
     @Override
     protected void load() {
-        getLoaderManager().initLoader(LOADER_ID_SEARCH, null, mCursorLoaderCallbacks);
+        SearchLoader.init(getLoaderManager(), LOADER_ID_SEARCH, mCursorLoaderCallbacks, mSearchTerm, false);
     }
 
     private void handleAutocomplete(String searchTerm, Cursor c) {
         if (TextUtils.isEmpty(mSearchTerm) || c == null || mAutocompleteHandler == null) {
             return;
         }
 
         // Avoid searching the path if we don't have to. Currently just
--- a/mobile/android/base/home/SearchLoader.java
+++ b/mobile/android/base/home/SearchLoader.java
@@ -41,16 +41,22 @@ class SearchLoader {
     private static Bundle createArgs(String searchTerm, boolean performEmptySearch) {
         Bundle args = new Bundle();
         args.putString(SearchLoader.KEY_SEARCH_TERM, searchTerm);
         args.putBoolean(SearchLoader.KEY_PERFORM_EMPTY_SEARCH, performEmptySearch);
 
         return args;
     }
 
+    public static void init(LoaderManager manager, int loaderId,
+                               LoaderCallbacks<Cursor> callbacks, String searchTerm, boolean performEmptySearch) {
+        Bundle args = createArgs(searchTerm, performEmptySearch);
+        manager.initLoader(loaderId, args, callbacks);
+    }
+
     public static void restart(LoaderManager manager, int loaderId,
                                LoaderCallbacks<Cursor> callbacks, String searchTerm) {
         restart(manager, loaderId, callbacks, searchTerm, true);
     }
 
     public static void restart(LoaderManager manager, int loaderId,
                                LoaderCallbacks<Cursor> callbacks, String searchTerm, boolean performEmptySearch) {
         Bundle args = createArgs(searchTerm, performEmptySearch);