Merge "OtaDexOptService: Log post-reboot moves"
am: ac293515b3
Change-Id: I76ded23a21610405079f275a61e1b61c23b46de7
This commit is contained in:
@@ -94,9 +94,6 @@ public class OtaDexoptService extends IOtaDexopt.Stub {
|
|||||||
public OtaDexoptService(Context context, PackageManagerService packageManagerService) {
|
public OtaDexoptService(Context context, PackageManagerService packageManagerService) {
|
||||||
this.mContext = context;
|
this.mContext = context;
|
||||||
this.mPackageManagerService = packageManagerService;
|
this.mPackageManagerService = packageManagerService;
|
||||||
|
|
||||||
// Now it's time to check whether we need to move any A/B artifacts.
|
|
||||||
moveAbArtifacts(packageManagerService.mInstaller);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static OtaDexoptService main(Context context,
|
public static OtaDexoptService main(Context context,
|
||||||
@@ -104,6 +101,9 @@ public class OtaDexoptService extends IOtaDexopt.Stub {
|
|||||||
OtaDexoptService ota = new OtaDexoptService(context, packageManagerService);
|
OtaDexoptService ota = new OtaDexoptService(context, packageManagerService);
|
||||||
ServiceManager.addService("otadexopt", ota);
|
ServiceManager.addService("otadexopt", ota);
|
||||||
|
|
||||||
|
// Now it's time to check whether we need to move any A/B artifacts.
|
||||||
|
ota.moveAbArtifacts(packageManagerService.mInstaller);
|
||||||
|
|
||||||
return ota;
|
return ota;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,8 +330,15 @@ public class OtaDexoptService extends IOtaDexopt.Stub {
|
|||||||
throw new IllegalStateException("Should not be ota-dexopting when trying to move.");
|
throw new IllegalStateException("Should not be ota-dexopting when trying to move.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!mPackageManagerService.isUpgrade()) {
|
||||||
|
Slog.d(TAG, "No upgrade, skipping A/B artifacts check.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Look into all packages.
|
// Look into all packages.
|
||||||
Collection<PackageParser.Package> pkgs = mPackageManagerService.getPackages();
|
Collection<PackageParser.Package> pkgs = mPackageManagerService.getPackages();
|
||||||
|
int packagePaths = 0;
|
||||||
|
int pathsSuccessful = 0;
|
||||||
for (PackageParser.Package pkg : pkgs) {
|
for (PackageParser.Package pkg : pkgs) {
|
||||||
if (pkg == null) {
|
if (pkg == null) {
|
||||||
continue;
|
continue;
|
||||||
@@ -362,13 +369,16 @@ public class OtaDexoptService extends IOtaDexopt.Stub {
|
|||||||
|
|
||||||
// TODO: Check first whether there is an artifact, to save the roundtrip time.
|
// TODO: Check first whether there is an artifact, to save the roundtrip time.
|
||||||
|
|
||||||
|
packagePaths++;
|
||||||
try {
|
try {
|
||||||
installer.moveAb(path, dexCodeInstructionSet, oatDir);
|
installer.moveAb(path, dexCodeInstructionSet, oatDir);
|
||||||
|
pathsSuccessful++;
|
||||||
} catch (InstallerException e) {
|
} catch (InstallerException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Slog.i(TAG, "Moved " + pathsSuccessful + "/" + packagePaths);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user