summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2016-02-04 12:31:13 +0100
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-02-07 23:21:00 -0800
commit3bb6c79ef674e51faf30cd680e21dace539dfcdd (patch)
treed5d5d2f0fba74bee56cacd400cfc18752b7ebea8 /src
parent7a6af0078166d470d98fd28c11b7d32c7e98d936 (diff)
downloadandroid_packages_apps_Trebuchet-3bb6c79ef674e51faf30cd680e21dace539dfcdd.zip
android_packages_apps_Trebuchet-3bb6c79ef674e51faf30cd680e21dace539dfcdd.tar.gz
android_packages_apps_Trebuchet-3bb6c79ef674e51faf30cd680e21dace539dfcdd.tar.bz2
Don't crash if a theme change intent arrives while we're not running.
Change-Id: I35aede5599d307674ef7a593adc5ffcf529ed99a
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/ThemeChangedReceiver.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/launcher3/ThemeChangedReceiver.java b/src/com/android/launcher3/ThemeChangedReceiver.java
index 9af5da4..6dac0be 100644
--- a/src/com/android/launcher3/ThemeChangedReceiver.java
+++ b/src/com/android/launcher3/ThemeChangedReceiver.java
@@ -33,7 +33,11 @@ public class ThemeChangedReceiver extends BroadcastReceiver {
// components is a string array of the components that changed
ArrayList<String> components = intent.getStringArrayListExtra(EXTRA_COMPONENTS);
if (isInterestingThemeChange(components)) {
- LauncherAppState app = LauncherAppState.getInstance();
+ LauncherAppState app = LauncherAppState.getInstanceNoCreate();
+ if (app == null) {
+ LauncherAppState.setApplicationContext(context);
+ app = LauncherAppState.getInstance();
+ }
clearAppIconCache(context);
clearWidgetPreviewCache(context);
app.recreateWidgetPreviewDb();