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

Commit 2578becc authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Only show optimizing storage dialog if dex opt dialog was shown

This doesn't take long, so there is little reason to show it if
we didn't show the dex opt dialog.

Bug: 29643498
Change-Id: I955f9dfa233166a8a150deb2d115a591e6d82394
parent 031f7956
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -538,6 +538,9 @@ public class PackageManagerService extends IPackageManager.Stub {
    final boolean mIsPreNUpgrade;
    final boolean mIsPreNMR1Upgrade;
    @GuardedBy("mPackages")
    private boolean mDexOptDialogShown;
    /** The location for ASEC container files on internal storage. */
    final String mAsecInternalPath;
@@ -7150,7 +7153,11 @@ public class PackageManagerService extends IPackageManager.Stub {
                    }
                }
                if (doTrim) {
                    if (!isFirstBoot()) {
                    final boolean dexOptDialogShown;
                    synchronized (mPackages) {
                        dexOptDialogShown = mDexOptDialogShown;
                    }
                    if (!isFirstBoot() && dexOptDialogShown) {
                        try {
                            ActivityManagerNative.getDefault().showBootMessage(
                                    mContext.getResources().getString(
@@ -7244,6 +7251,9 @@ public class PackageManagerService extends IPackageManager.Stub {
                                    numberOfPackagesVisited, numberOfPackagesToDexopt), true);
                } catch (RemoteException e) {
                }
                synchronized (mPackages) {
                    mDexOptDialogShown = true;
                }
            }
            // If the OTA updates a system app which was previously preopted to a non-preopted state