Better exceptions when LoadedApk fails.

Change-Id: Iba578c3872c6aeba3bf468735f06bd486d661454
This commit is contained in:
Dianne Hackborn
2013-02-25 13:17:54 -08:00
parent f4b36ad161
commit 208d937b61

View File

@@ -362,7 +362,12 @@ public final class LoadedApk {
try {
pi = pm.getPackageInfo(mPackageName, 0, UserHandle.myUserId());
} catch (RemoteException e) {
throw new AssertionError(e);
throw new IllegalStateException("Unable to get package info for "
+ mPackageName + "; is system dying?", e);
}
if (pi == null) {
throw new IllegalStateException("Unable to get package info for "
+ mPackageName + "; is package not installed?");
}
/*
* Two possible indications that this package could be