Link 32bit native libraries only if libs exist

There could be an app whose abi is 32bit, but which doesn't have 32bit
native libs because it just belongs to the SharedUserId whose abi is
32bit. Link it only if libs exist to reduce unnecessary calls.

Bug: 204097684
Test: compile & verify basic functions working
Change-Id: I24c374c92600ff50f4cf4e88e0b4106d480562d8
This commit is contained in:
Jeongsik Mun
2021-11-22 11:43:23 +09:00
committed by Patrick Baumann
parent 4cbb58587a
commit 1913e674e3

View File

@@ -293,6 +293,9 @@ final class AppDataHelper {
String primaryCpuAbi = AndroidPackageUtils.getPrimaryCpuAbi(pkg, pkgSetting);
if (primaryCpuAbi != null && !VMRuntime.is64BitAbi(primaryCpuAbi)) {
final String nativeLibPath = pkg.getNativeLibraryDir();
if (!(new File(nativeLibPath).exists())) {
return;
}
try {
mInstaller.linkNativeLibraryDirectory(volumeUuid, packageName,
nativeLibPath, userId);