am fac55682: am 208bd91b: Merge "[ActivityManager] Avoid system server crash due to package removed"
* commit 'fac55682148e6d9c6b4e24769369e2b76ab018ac': [ActivityManager] Avoid system server crash due to package removed
This commit is contained in:
@@ -168,10 +168,20 @@ public class ApplicationErrorReport implements Parcelable {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
|
||||
// look for receiver in the installer package
|
||||
String candidate = pm.getInstallerPackageName(packageName);
|
||||
ComponentName result = getErrorReportReceiver(pm, packageName, candidate);
|
||||
if (result != null) {
|
||||
return result;
|
||||
String candidate = null;
|
||||
ComponentName result = null;
|
||||
|
||||
try {
|
||||
candidate = pm.getInstallerPackageName(packageName);
|
||||
} catch (IllegalArgumentException e) {
|
||||
// the package could already removed
|
||||
}
|
||||
|
||||
if (candidate != null) {
|
||||
result = getErrorReportReceiver(pm, packageName, candidate);
|
||||
if (result != null) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
// if the error app is on the system image, look for system apps
|
||||
|
||||
Reference in New Issue
Block a user