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

Commit 183501e1 authored by Nicolas Geoffray's avatar Nicolas Geoffray Committed by Android (Google) Code Review
Browse files

Merge "Remove performBootDexOpt and am's ensurePackageDexOpt."

parents 7830daaa 27c07379
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -275,7 +275,7 @@ public final class LoadedApk {
                if (!Objects.equals(mPackageName, ActivityThread.currentPackageName())) {
                    final String isa = VMRuntime.getRuntime().vmInstructionSet();
                    try {
                        ActivityThread.getPackageManager().performDexOptIfNeeded(mPackageName, isa);
                        ActivityThread.getPackageManager().notifyPackageUse(mPackageName);
                    } catch (RemoteException re) {
                        // Ignored.
                    }
+7 −3
Original line number Diff line number Diff line
@@ -420,10 +420,14 @@ interface IPackageManager {
    boolean hasSystemUidErrors();

    /**
     * Ask the package manager to perform boot-time dex-opt of all
     * existing packages.
     * Ask the package manager to fstrim the disk if needed.
     */
    void performBootDexOpt();
    void performFstrimIfNeeded();

    /**
     * Notify the package manager that a package is going to be used.
     */
    void notifyPackageUse(String packageName);

    /**
     * Ask the package manager to perform dex-opt (if needed) on the given
+1 −1
Original line number Diff line number Diff line
@@ -1527,7 +1527,7 @@ public final class ActiveServices {
            synchronized (r.stats.getBatteryStats()) {
                r.stats.startLaunchedLocked();
            }
            mAm.ensurePackageDexOpt(r.serviceInfo.packageName);
            mAm.notifyPackageUse(r.serviceInfo.packageName);
            app.forceProcessStateUpTo(ActivityManager.PROCESS_STATE_SERVICE);
            app.thread.scheduleCreateService(r, r.serviceInfo,
                    mAm.compatibilityInfoForPackageLocked(r.serviceInfo.applicationInfo),
+6 −8
Original line number Diff line number Diff line
@@ -3059,12 +3059,10 @@ public final class ActivityManagerService extends ActivityManagerNative
        return proc;
    }
    void ensurePackageDexOpt(String packageName) {
    void notifyPackageUse(String packageName) {
        IPackageManager pm = AppGlobals.getPackageManager();
        try {
            if (pm.performDexOptIfNeeded(packageName, null /* instruction set */)) {
                mDidDexOpt = true;
            }
            pm.notifyPackageUse(packageName);
        } catch (RemoteException e) {
        }
    }
@@ -6137,11 +6135,11 @@ public final class ActivityManagerService extends ActivityManagerNative
                        || (mBackupTarget.backupMode == BackupRecord.BACKUP_FULL);
            }
            ensurePackageDexOpt(app.instrumentationInfo != null
            notifyPackageUse(app.instrumentationInfo != null
                    ? app.instrumentationInfo.packageName
                    : app.info.packageName);
            if (app.instrumentationClass != null) {
                ensurePackageDexOpt(app.instrumentationClass.getPackageName());
                notifyPackageUse(app.instrumentationClass.getPackageName());
            }
            if (DEBUG_CONFIGURATION) Slog.v(TAG_CONFIGURATION, "Binding proc "
                    + processName + " with config " + mConfiguration);
@@ -6221,7 +6219,7 @@ public final class ActivityManagerService extends ActivityManagerNative
        if (!badApp && mBackupTarget != null && mBackupTarget.appInfo.uid == app.uid) {
            if (DEBUG_BACKUP) Slog.v(TAG_BACKUP,
                    "New app is backup target, launching agent for " + app);
            ensurePackageDexOpt(mBackupTarget.appInfo.packageName);
            notifyPackageUse(mBackupTarget.appInfo.packageName);
            try {
                thread.scheduleCreateBackupAgent(mBackupTarget.appInfo,
                        compatibilityInfoForPackageLocked(mBackupTarget.appInfo),
@@ -9462,7 +9460,7 @@ public final class ActivityManagerService extends ActivityManagerNative
                    app.addPackage(cpi.applicationInfo.packageName, cpi.applicationInfo.versionCode,
                            mProcessStats);
                }
                ensurePackageDexOpt(cpi.applicationInfo.packageName);
                notifyPackageUse(cpi.applicationInfo.packageName);
            }
        }
        return providers;
+1 −1
Original line number Diff line number Diff line
@@ -1294,7 +1294,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
                // Home process is the root process of the task.
                mService.mHomeProcess = task.mActivities.get(0).app;
            }
            mService.ensurePackageDexOpt(r.intent.getComponent().getPackageName());
            mService.notifyPackageUse(r.intent.getComponent().getPackageName());
            r.sleeping = false;
            r.forceNewConfig = false;
            mService.showAskCompatModeDialogLocked(r);
Loading