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

Commit e36f449c authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

Merge "Remove ~1/3 of the installd calls at boot." am: 5bc305b9

am: d948865e

Change-Id: Iaf9d7f9a3f7d2fd34a11ec2ee80d849fc7dd0078
parents 5b1a460b d948865e
Loading
Loading
Loading
Loading
+3 −13
Original line number Diff line number Diff line
@@ -105,11 +105,11 @@ public class Installer extends SystemService {
        }
    }

    public void createAppData(String uuid, String packageName, int userId, int flags, int appId,
    public long createAppData(String uuid, String packageName, int userId, int flags, int appId,
            String seInfo, int targetSdkVersion) throws InstallerException {
        if (!checkBeforeRemote()) return;
        if (!checkBeforeRemote()) return -1;
        try {
            mInstalld.createAppData(uuid, packageName, userId, flags, appId, seInfo,
            return mInstalld.createAppData(uuid, packageName, userId, flags, appId, seInfo,
                    targetSdkVersion);
        } catch (Exception e) {
            throw InstallerException.from(e);
@@ -182,16 +182,6 @@ public class Installer extends SystemService {
        }
    }

    public long getAppDataInode(String uuid, String packageName, int userId, int flags)
            throws InstallerException {
        if (!checkBeforeRemote()) return -1;
        try {
            return mInstalld.getAppDataInode(uuid, packageName, userId, flags);
        } catch (Exception e) {
            throw InstallerException.from(e);
        }
    }

    public void dexopt(String apkPath, int uid, @Nullable String pkgName, String instructionSet,
            int dexoptNeeded, @Nullable String outputPath, int dexFlags,
            String compilerFilter, @Nullable String volumeUuid, @Nullable String sharedLibraries)
+9 −16
Original line number Diff line number Diff line
@@ -19999,8 +19999,9 @@ Slog.v(TAG, ":: stepped forward, applying functor at tag " + parser.getName());
        Preconditions.checkNotNull(app.seinfo);
        long ceDataInode = -1;
        try {
            mInstaller.createAppData(volumeUuid, packageName, userId, flags,
            ceDataInode = mInstaller.createAppData(volumeUuid, packageName, userId, flags,
                    appId, app.seinfo, app.targetSdkVersion);
        } catch (InstallerException e) {
            if (app.isSystemApp()) {
@@ -20008,7 +20009,7 @@ Slog.v(TAG, ":: stepped forward, applying functor at tag " + parser.getName());
                        + ", but trying to recover: " + e);
                destroyAppDataLeafLIF(pkg, userId, flags);
                try {
                    mInstaller.createAppData(volumeUuid, packageName, userId, flags,
                    ceDataInode = mInstaller.createAppData(volumeUuid, packageName, userId, flags,
                            appId, app.seinfo, app.targetSdkVersion);
                    logCriticalInfo(Log.DEBUG, "Recovery succeeded!");
                } catch (InstallerException e2) {
@@ -20019,22 +20020,14 @@ Slog.v(TAG, ":: stepped forward, applying functor at tag " + parser.getName());
            }
        }
        if ((flags & StorageManager.FLAG_STORAGE_CE) != 0) {
            try {
                // CE storage is unlocked right now, so read out the inode and
                // remember for use later when it's locked
        if ((flags & StorageManager.FLAG_STORAGE_CE) != 0 && ceDataInode != -1) {
            // TODO: mark this structure as dirty so we persist it!
                final long ceDataInode = mInstaller.getAppDataInode(volumeUuid, packageName, userId,
                        StorageManager.FLAG_STORAGE_CE);
            synchronized (mPackages) {
                final PackageSetting ps = mSettings.mPackages.get(packageName);
                if (ps != null) {
                    ps.setCeDataInode(ceDataInode, userId);
                }
            }
            } catch (InstallerException e) {
                Slog.e(TAG, "Failed to find inode for " + packageName + ": " + e);
            }
        }
        prepareAppDataContentsLeafLIF(pkg, userId, flags);