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

Commit 34718866 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Avoid NPE when installing app update.

PMS sends REMOVED followed quickly by ADDED.  Ignore when missing
package, since it may be coming back shortly.  Eventually we should
change this to watch EXTRA_REPLACING.

Bug: 7269896
Change-Id: I3b518f4faee34019c5c808824d5e46261f6d206a
parent b0e25f71
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -568,6 +568,7 @@ public class InstalledAppDetails extends Fragment
            }
        }
        mAppEntry = mState.getEntry(packageName);
        if (mAppEntry != null) {
            // Get application info again to refresh changed properties of application
            try {
                mPackageInfo = mPm.getPackageInfo(mAppEntry.info.packageName,
@@ -577,6 +578,10 @@ public class InstalledAppDetails extends Fragment
            } catch (NameNotFoundException e) {
                Log.e(TAG, "Exception when retrieving package:" + mAppEntry.info.packageName, e);
            }
        } else {
            Log.w(TAG, "Missing AppEntry; maybe reinstalling?");
            mPackageInfo = null;
        }

        return packageName;
    }