diff options
author | Dirk Rettschlag <dirk.rettschlag@gmail.com> | 2014-05-16 19:06:19 +0200 |
---|---|---|
committer | Dirk Rettschlag <dirk.rettschlag@gmail.com> | 2014-05-16 19:06:19 +0200 |
commit | d43dc8d6f5b80c1001d98bfe301309c0da9031f3 (patch) | |
tree | 326327ba7581e8117d6989e752cb970a01ecc4dd | |
parent | dda7d285c2b77770d09ad2abaf4fa09f909d4636 (diff) | |
download | android_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.java | 3 |
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 |