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

Commit d6fd63d4 authored by David Brazdil's avatar David Brazdil Committed by Nicolas Geoffray
Browse files

Revive the "Optimizing apps" dialog

Since we do spend some non-trivial time extracting APKs at OTA, we
should show a descriptive dialog. Currently the screen would read
"Optimizing storage" which is misleading.

bug:26813999

Change-Id: I4954e3b486840b5d806db8b45242fdc8ca9d0379
parent 9f1ab4fc
Loading
Loading
Loading
Loading
+28 −8
Original line number Diff line number Diff line
@@ -6829,19 +6829,39 @@ public class PackageManagerService extends IPackageManager.Stub {
        // Extract pacakges only if profile-guided compilation is enabled because
        // otherwise BackgroundDexOptService will not dexopt them later.
        if (mUseJitProfiles) {
        if (!mUseJitProfiles || !isUpgrade()) {
            return;
        }
        List<PackageParser.Package> pkgs;
        synchronized (mPackages) {
            pkgs = PackageManagerServiceUtils.getPackagesForDexopt(mPackages.values(), this);
        }
        int curr = 0;
        int total = pkgs.size();
        for (PackageParser.Package pkg : pkgs) {
            curr++;
            if (DEBUG_DEXOPT) {
                Log.i(TAG, "Extracting app " + curr + " of " + total + ": " + pkg.packageName);
            }
            if (!isFirstBoot()) {
                try {
                    ActivityManagerNative.getDefault().showBootMessage(
                            mContext.getResources().getString(R.string.android_upgrading_apk,
                                    curr, total), true);
                } catch (RemoteException e) {
                }
            }
            if (PackageDexOptimizer.canOptimizePackage(pkg)) {
                performDexOpt(pkg.packageName, null /* instructionSet */,
                         false /* useProfiles */, true /* extractOnly */, false /* force */);
            }
        }
    }
    }
    @Override
    public void notifyPackageUse(String packageName) {