summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2016-02-04 12:31:13 +0100
committerTom Powell <zifnab@zifnab06.net>2017-03-26 16:15:30 -0700
commitaa9698dfa1360ade3f7bf347615936da7f267d73 (patch)
tree80c1de83b294490f18e1927d2349e2ac0dbd9c2d
parent4a52804aba96c5fe118902c3c84fd0f9f8f9608b (diff)
downloadandroid_packages_apps_Trebuchet-aa9698dfa1360ade3f7bf347615936da7f267d73.zip
android_packages_apps_Trebuchet-aa9698dfa1360ade3f7bf347615936da7f267d73.tar.gz
android_packages_apps_Trebuchet-aa9698dfa1360ade3f7bf347615936da7f267d73.tar.bz2
Don't crash if a theme change intent arrives while we're not running.
Change-Id: I35aede5599d307674ef7a593adc5ffcf529ed99a
-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();