Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31d9ec33 authored by Yanting Yang's avatar Yanting Yang
Browse files

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
parent 6bd44413
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -67,7 +67,9 @@ public class PictureInPictureDetailPreferenceController extends AppInfoPreferenc
        try {
            packageInfoWithActivities = mPackageManager.getPackageInfoAsUser(mPackageName,
                    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);
        }