Fix crash of PictureInPictureDetailPreferenceController
PackageManager.getPackageInfoAsUser() will throw DeadObjectException when the package is too large which is a known issue to PackageManager but very low priority given resourcing constraints. As per the PackageManager team suggestion, catch the exception on the app side to alleviate the impact to the App info page. Bug: 198861478 Test: manual Change-Id: I3115cf1b99a305efef192a0dcf3e809eb7903d0a
This commit is contained in:
@@ -67,7 +67,9 @@ public class PictureInPictureDetailPreferenceController extends AppInfoPreferenc
|
|||||||
try {
|
try {
|
||||||
packageInfoWithActivities = mPackageManager.getPackageInfoAsUser(mPackageName,
|
packageInfoWithActivities = mPackageManager.getPackageInfoAsUser(mPackageName,
|
||||||
PackageManager.GET_ACTIVITIES, UserHandle.myUserId());
|
PackageManager.GET_ACTIVITIES, UserHandle.myUserId());
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
} catch (Exception e) {
|
||||||
|
// Catch Exception to avoid DeadObjectException thrown with binder transaction
|
||||||
|
// failures, since the explicit request of DeadObjectException has compiler errors.
|
||||||
Log.e(TAG, "Exception while retrieving the package info of " + mPackageName, e);
|
Log.e(TAG, "Exception while retrieving the package info of " + mPackageName, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user