From 0b800190d71bbe3459149f760f49dfa6208c0e21 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Thu, 21 Jun 2012 15:29:36 -0700 Subject: [PATCH] Don't crash in window manager if we fail getting .apk resources. This normally shouldn't noramlly happen, but it can in the case of bug 6647334 (crash in LoadedApk.makeApplication) where the package manager information becomes inconsistent, and it could also happen if an app was uninstalled or started updating at just the right time during a launch. Bug: 6647334 Change-Id: Iba22efe1d646cdac46099b2135466309577dfa54 --- services/java/com/android/server/wm/WindowManagerService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 5cd4bebea988..babd7e983103 100755 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -4145,6 +4145,11 @@ public class WindowManagerService extends IWindowManager.Stub if (theme != 0) { AttributeCache.Entry ent = AttributeCache.instance().get(pkg, theme, com.android.internal.R.styleable.Window); + if (ent == null) { + // Whoops! App doesn't exist. Um. Okay. We'll just + // pretend like we didn't see that. + return; + } if (ent.array.getBoolean( com.android.internal.R.styleable.Window_windowIsTranslucent, false)) { return; -- 2.11.0