Prevent crash from null ApplicationInfo after package is removed.

Bug: 29234926
Change-Id: I8c2fed7c7e862e1f6798d5ed535d1937f9a74c1a
This commit is contained in:
Chong Zhang
2016-06-13 14:41:41 -07:00
parent c0b602c441
commit 1de22da763

View File

@@ -17658,6 +17658,11 @@ public final class ActivityManagerService extends ActivityManagerNative
getPackageManagerInternalLocked().getApplicationInfo(
ssp,
userId);
if (aInfo == null) {
Slog.w(TAG, "Dropping ACTION_PACKAGE_REPLACED for non-existent pkg:"
+ " ssp=" + ssp + " data=" + data);
return ActivityManager.BROADCAST_SUCCESS;
}
mStackSupervisor.updateActivityApplicationInfoLocked(aInfo);
sendPackageBroadcastLocked(IApplicationThread.PACKAGE_REPLACED,
new String[] {ssp}, userId);