summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk Rettschlag <dirk.rettschlag@gmail.com>2014-05-16 19:06:19 +0200
committerDirk Rettschlag <dirk.rettschlag@gmail.com>2014-05-16 19:06:19 +0200
commitd43dc8d6f5b80c1001d98bfe301309c0da9031f3 (patch)
tree326327ba7581e8117d6989e752cb970a01ecc4dd
parentdda7d285c2b77770d09ad2abaf4fa09f909d4636 (diff)
downloadandroid_packages_providers_ThemesProvider-d43dc8d6f5b80c1001d98bfe301309c0da9031f3.tar.gz
android_packages_providers_ThemesProvider-d43dc8d6f5b80c1001d98bfe301309c0da9031f3.tar.bz2
android_packages_providers_ThemesProvider-d43dc8d6f5b80c1001d98bfe301309c0da9031f3.zip
Fix NPE if themeContext is null - round 2
If a theme is uninstalled and timing is perfect, it can happen that the CopyImageService is trying to get the PackageContext of a not existing package. Return from the function if a NameNotFoundException is catched. Change-Id: I8f4e33d527f78228f9681ac518292364e9269a0c Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
-rw-r--r--src/org/cyanogenmod/themes/provider/CopyImageService.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/cyanogenmod/themes/provider/CopyImageService.java b/src/org/cyanogenmod/themes/provider/CopyImageService.java
index 33c6954..687116f 100644
--- a/src/org/cyanogenmod/themes/provider/CopyImageService.java
+++ b/src/org/cyanogenmod/themes/provider/CopyImageService.java
@@ -99,7 +99,8 @@ public class CopyImageService extends IntentService {
themeContext = context.createPackageContext(pkgName,
Context.CONTEXT_IGNORE_SECURITY);
} catch (NameNotFoundException e) {
- e.printStackTrace();
+ Log.e(TAG, "Error getting themeContext", e);
+ return;
}
// This is for testing only. We copy some assets from APK and put into