From d43dc8d6f5b80c1001d98bfe301309c0da9031f3 Mon Sep 17 00:00:00 2001 From: Dirk Rettschlag Date: Fri, 16 May 2014 19:06:19 +0200 Subject: 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 --- src/org/cyanogenmod/themes/provider/CopyImageService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3