Bug 917350 - Factor out method to create SearchLoader arguments (r=margaret)
authorLucas Rocha <lucasr@mozilla.com>
Wed, 16 Oct 2013 10:30:39 +0100
changeset 150975 0fb839beb7e4
parent 150974 ef5c1b2b2d42
child 150976 b301518fc843
push id25473
push userryanvm@gmail.com
push dateWed, 16 Oct 2013 21:00:56 +0000
treeherdermozilla-central@b0d5cef2c427 [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 - Factor out method to create SearchLoader arguments (r=margaret)
mobile/android/base/home/SearchLoader.java
--- a/mobile/android/base/home/SearchLoader.java
+++ b/mobile/android/base/home/SearchLoader.java
@@ -33,27 +33,33 @@ class SearchLoader {
             final String searchTerm = args.getString(KEY_SEARCH_TERM);
             final boolean performEmptySearch = args.getBoolean(KEY_PERFORM_EMPTY_SEARCH, false);
             return new SearchCursorLoader(context, searchTerm, performEmptySearch);
         } else {
             return new SearchCursorLoader(context, "", false);
         }
     }
 
+    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 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 bundle = new Bundle();
-        bundle.putString(SearchLoader.KEY_SEARCH_TERM, searchTerm);
-        bundle.putBoolean(SearchLoader.KEY_PERFORM_EMPTY_SEARCH, performEmptySearch);
-        manager.restartLoader(loaderId, bundle, callbacks);
+        Bundle args = createArgs(searchTerm, performEmptySearch);
+        manager.restartLoader(loaderId, args, callbacks);
     }
 
     public static class SearchCursorLoader extends SimpleCursorLoader {
         // Max number of search results
         private static final int SEARCH_LIMIT = 100;
 
         // The target search term associated with the loader
         private final String mSearchTerm;