[pm] derive correct abi override during prepare package
This is needed so that the ABI values in parsedPkg will be correct before they are copied to pkgSetting during scan package. BUG: 163888243 Test: atest android.extractnativelibs.cts.CtsExtractNativeLibsHostTestAbiOverride Change-Id: I48947c5170ea0b732d3e961c9735b3a218f9a81b
This commit is contained in:
@@ -11680,8 +11680,9 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
|
||||
if (DEBUG_ABI_SELECTION) {
|
||||
Slog.d(TAG, "Resolved nativeLibraryRoot for " + parsedPackage.getPackageName()
|
||||
+ " to root=" + parsedPackage.getNativeLibraryRootDir() + ", isa="
|
||||
+ parsedPackage.isNativeLibraryRootRequiresIsa());
|
||||
+ " to root=" + parsedPackage.getNativeLibraryRootDir()
|
||||
+ ", to dir=" + parsedPackage.getNativeLibraryDir()
|
||||
+ ", isa=" + parsedPackage.isNativeLibraryRootRequiresIsa());
|
||||
}
|
||||
|
||||
// Push the derived path down into PackageSettings so we know what to
|
||||
@@ -11689,9 +11690,10 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
pkgSetting.legacyNativeLibraryPathString = parsedPackage.getNativeLibraryRootDir();
|
||||
|
||||
if (DEBUG_ABI_SELECTION) {
|
||||
Log.d(TAG, "Abis for package[" + parsedPackage.getPackageName() + "] are" +
|
||||
" primary=" + AndroidPackageUtils.getRawPrimaryCpuAbi(parsedPackage) +
|
||||
" secondary=" + AndroidPackageUtils.getRawSecondaryCpuAbi(parsedPackage));
|
||||
Log.d(TAG, "Abis for package[" + parsedPackage.getPackageName() + "] are"
|
||||
+ " primary=" + pkgSetting.primaryCpuAbiString
|
||||
+ " secondary=" + pkgSetting.primaryCpuAbiString
|
||||
+ " abiOverride=" + pkgSetting.cpuAbiOverrideString);
|
||||
}
|
||||
|
||||
if ((scanFlags & SCAN_BOOTING) == 0 && pkgSetting.sharedUser != null) {
|
||||
@@ -17610,12 +17612,13 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
}
|
||||
boolean isUpdatedSystemAppFromExistingSetting = pkgSetting != null
|
||||
&& pkgSetting.getPkgState().isUpdatedSystemApp();
|
||||
final String abiOverride = deriveAbiOverride(args.abiOverride, pkgSetting);
|
||||
AndroidPackage oldPackage = mPackages.get(pkgName);
|
||||
boolean isUpdatedSystemAppInferred = oldPackage != null && oldPackage.isSystem();
|
||||
final Pair<PackageAbiHelper.Abis, PackageAbiHelper.NativeLibraryPaths>
|
||||
derivedAbi = mInjector.getAbiHelper().derivePackageAbi(parsedPackage,
|
||||
isUpdatedSystemAppFromExistingSetting || isUpdatedSystemAppInferred,
|
||||
args.abiOverride);
|
||||
abiOverride);
|
||||
derivedAbi.first.applyTo(parsedPackage);
|
||||
derivedAbi.second.applyTo(parsedPackage);
|
||||
} catch (PackageManagerException pme) {
|
||||
|
||||
Reference in New Issue
Block a user