Merge "Remove ~1/3 of the installd calls at boot." am: 5bc305b97c am: d948865e27 am: e36f449c90
am: bdf62c82c8
Change-Id: Iae00facaf7131c24e0480e909d7386b8ad64e6d1
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -20459,8 +20459,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()) {
|
||||
@@ -20468,7 +20469,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) {
|
||||
@@ -20479,21 +20480,13 @@ 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
|
||||
// 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);
|
||||
}
|
||||
if ((flags & StorageManager.FLAG_STORAGE_CE) != 0 && ceDataInode != -1) {
|
||||
// TODO: mark this structure as dirty so we persist it!
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user