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

Commit b1bf9cf3 authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Fix a crash in InstalledAppDetails

Initialize mPackageInfo in onCreate

Bug: 7194755
Change-Id: Ic82351591bd38c4c161bbb23c4033038d1d7fa85
parent 27f155a4
Loading
Loading
Loading
Loading
+13 −10
Original line number Diff line number Diff line
@@ -564,6 +564,16 @@ public class InstalledAppDetails extends Fragment
            }
        }
        mAppEntry = mState.getEntry(packageName);
        // Get application info again to refresh changed properties of application
        try {
            mPackageInfo = mPm.getPackageInfo(mAppEntry.info.packageName,
                    PackageManager.GET_DISABLED_COMPONENTS |
                    PackageManager.GET_UNINSTALLED_PACKAGES |
                    PackageManager.GET_SIGNATURES);
        } catch (NameNotFoundException e) {
            Log.e(TAG, "Exception when retrieving package:" + mAppEntry.info.packageName, e);
        }

        return packageName;
    }

@@ -577,14 +587,7 @@ public class InstalledAppDetails extends Fragment
            return false; // onCreate must have failed, make sure to exit
        }

        // Get application info again to refresh changed properties of application
        try {
            mPackageInfo = mPm.getPackageInfo(mAppEntry.info.packageName,
                    PackageManager.GET_DISABLED_COMPONENTS |
                    PackageManager.GET_UNINSTALLED_PACKAGES |
                    PackageManager.GET_SIGNATURES);
        } catch (NameNotFoundException e) {
            Log.e(TAG, "Exception when retrieving package:" + mAppEntry.info.packageName, e);
        if (mPackageInfo == null) {
            return false; // onCreate must have failed, make sure to exit
        }