Update the search widget icon if the global search provider changes.
Note that this change is necessary because the launcher might
receive the PM broadcast before the SearchManagerService does.
Change-Id: I5a03e2fb16dee232a83d24b834ef6bd0eaabe774
diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java
index 331f124..b4e632a 100644
--- a/src/com/android/launcher2/LauncherModel.java
+++ b/src/com/android/launcher2/LauncherModel.java
@@ -16,6 +16,7 @@
package com.android.launcher2;
+import android.app.SearchManager;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProviderInfo;
import android.content.BroadcastReceiver;
@@ -129,6 +130,7 @@
public void bindAppsRemoved(ArrayList<ApplicationInfo> apps, boolean permanent);
public void bindPackagesUpdated();
public boolean isAllAppsVisible();
+ public void bindSearchablesChanged();
}
LauncherModel(LauncherApplication app, IconCache iconCache) {
@@ -513,6 +515,7 @@
* Call from the handler for ACTION_PACKAGE_ADDED, ACTION_PACKAGE_REMOVED and
* ACTION_PACKAGE_CHANGED.
*/
+ @Override
public void onReceive(Context context, Intent intent) {
if (DEBUG_LOADERS) Log.d(TAG, "onReceive intent=" + intent);
@@ -570,6 +573,9 @@
mAllAppsLoaded = false;
mWorkspaceLoaded = false;
startLoaderFromBackground();
+ } else if (SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED.equals(action)) {
+ Callbacks callbacks = mCallbacks.get();
+ callbacks.bindSearchablesChanged();
}
}