summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClark Scheff <clark@cyngn.com>2014-08-25 18:27:42 (GMT)
committerAbhisek Devkota <ciwrl@cyanogenmod.com>2014-08-27 00:29:58 (GMT)
commitf926c30cd3c9284163c64c08f31a52e190eb53fb (patch)
tree40960f0d56146db8c7fc439bfbf8caff76e586ab
parent46b0ef9a1a9aaba3c7ff764b2314ba0986dc9fc3 (diff)
downloadandroid_packages_apps_Trebuchet-f926c30cd3c9284163c64c08f31a52e190eb53fb.zip
android_packages_apps_Trebuchet-f926c30cd3c9284163c64c08f31a52e190eb53fb.tar.gz
android_packages_apps_Trebuchet-f926c30cd3c9284163c64c08f31a52e190eb53fb.tar.bz2
Revert "Use ArrayListExtra for broadcasting theme changes [2/2]"
This reverts commit ebf8f37515c23a167cef2bb8cff04854c52fd35b. Change-Id: If80e3bc0443fa9e79c085e9251f4be0a10730397
-rw-r--r--AndroidManifest.xml3
-rw-r--r--src/com/android/launcher3/ThemeChangedReceiver.java45
2 files changed, 10 insertions, 38 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 0dd98d6..fcf3baf 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -197,6 +197,9 @@
<receiver android:name="com.android.launcher3.ThemeChangedReceiver" >
<intent-filter>
<action android:name="org.cyanogenmod.intent.action.THEME_CHANGED"/>
+ <category android:name="org.cyanogenmod.intent.category.MODS_ICONS"/>
+ <category android:name="org.cyanogenmod.intent.category.MODS_OVERLAYS"/>
+ <category android:name="org.cyanogenmod.intent.category.MODS_FONTS"/>
</intent-filter>
</receiver>
diff --git a/src/com/android/launcher3/ThemeChangedReceiver.java b/src/com/android/launcher3/ThemeChangedReceiver.java
index c7a98c5..19c2e22 100644
--- a/src/com/android/launcher3/ThemeChangedReceiver.java
+++ b/src/com/android/launcher3/ThemeChangedReceiver.java
@@ -19,53 +19,22 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
-import static com.android.launcher3.WidgetPreviewLoader.CacheDb.DB_NAME;
-
import java.io.File;
-import java.util.ArrayList;
-
-public class ThemeChangedReceiver extends BroadcastReceiver {
- private static final String EXTRA_COMPONENTS = "components";
- public static final String MODIFIES_ICONS = "mods_icons";
- public static final String MODIFIES_FONTS = "mods_fonts";
- public static final String MODIFIES_OVERLAYS = "mods_overlays";
+import static com.android.launcher3.WidgetPreviewLoader.CacheDb.DB_NAME;
+public class ThemeChangedReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
- // components is a string array of the components that changed
- ArrayList<String> components = intent.getStringArrayListExtra(EXTRA_COMPONENTS);
- if (isInterestingThemeChange(components)) {
- LauncherAppState app = LauncherAppState.getInstance();
- clearWidgetPreviewCache(context);
- app.recreateWidgetPreviewDb();
- app.getIconCache().flush();
- app.getModel().forceReload();
- }
+ LauncherAppState app = LauncherAppState.getInstance();
+ clearWidgetPreviewCache(context);
+ app.recreateWidgetPreviewDb();
+ app.getIconCache().flush();
+ app.getModel().forceReload();
}
/**
- * We consider this an "interesting" theme change if it modifies icons, overlays, or fonts.
- * @param components
- * @return
- */
- private boolean isInterestingThemeChange(ArrayList<String> components) {
- if (components != null) {
- for (String component : components) {
- if (component.equals(MODIFIES_ICONS) ||
- component.equals(MODIFIES_FONTS) ||
- component.equals(MODIFIES_OVERLAYS)) {
- return true;
- }
- }
- }
- return false;
- }
-
-
- /**
* Normally we could use context.deleteDatabase() but this db is in cache/ so we'll
* manually delete it and the journal ourselves.
- *
* @param context
*/
private void clearWidgetPreviewCache(Context context) {