Loading core/java/android/content/pm/ApplicationInfo.java +12 −0 Original line number Diff line number Diff line Loading @@ -440,6 +440,15 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { */ public String nativeLibraryDir; /** * The ABI that this application requires, This is inferred from the ABIs * of the native JNI libraries the application bundles. Will be {@code null} * if this application does not require any particular ABI. * * {@hide} */ public String requiredCpuAbi; /** * The kernel user-ID that has been assigned to this application; * currently this is not a unique ID (multiple applications can have Loading Loading @@ -570,6 +579,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { sourceDir = orig.sourceDir; publicSourceDir = orig.publicSourceDir; nativeLibraryDir = orig.nativeLibraryDir; requiredCpuAbi = orig.requiredCpuAbi; resourceDirs = orig.resourceDirs; seinfo = orig.seinfo; sharedLibraryFiles = orig.sharedLibraryFiles; Loading Loading @@ -610,6 +620,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dest.writeString(sourceDir); dest.writeString(publicSourceDir); dest.writeString(nativeLibraryDir); dest.writeString(requiredCpuAbi); dest.writeStringArray(resourceDirs); dest.writeString(seinfo); dest.writeStringArray(sharedLibraryFiles); Loading Loading @@ -649,6 +660,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { sourceDir = source.readString(); publicSourceDir = source.readString(); nativeLibraryDir = source.readString(); requiredCpuAbi = source.readString(); resourceDirs = source.readStringArray(); seinfo = source.readString(); sharedLibraryFiles = source.readStringArray(); Loading core/java/android/os/Process.java +3 −9 Original line number Diff line number Diff line Loading @@ -466,6 +466,7 @@ public class Process { * @param debugFlags Additional flags. * @param targetSdkVersion The target SDK version for the app. * @param seInfo null-ok SELinux information for the new process. * @param abi non-null the ABI this app should be started with. * @param zygoteArgs Additional arguments to supply to the zygote process. * * @return An object that describes the result of the attempt to start the process. Loading @@ -479,12 +480,12 @@ public class Process { int debugFlags, int mountExternal, int targetSdkVersion, String seInfo, String abi, String[] zygoteArgs) { try { return startViaZygote(processClass, niceName, uid, gid, gids, debugFlags, mountExternal, targetSdkVersion, seInfo, null, /* zygoteAbi TODO: Replace this with the real ABI */ zygoteArgs); abi, zygoteArgs); } catch (ZygoteStartFailedEx ex) { Log.e(LOG_TAG, "Starting VM process through Zygote failed"); Loading Loading @@ -702,13 +703,6 @@ public class Process { primaryZygoteState = ZygoteState.connect(ZYGOTE_SOCKET, getNumTries(primaryZygoteState)); } // TODO: Revert this temporary change. This is required to test // and submit this change ahead of the package manager changes // that supply this abi. if (abi == null) { return primaryZygoteState; } if (primaryZygoteState.matches(abi)) { return primaryZygoteState; } Loading services/java/com/android/server/am/ActivityManagerService.java +6 −1 Original line number Diff line number Diff line Loading @@ -2780,11 +2780,16 @@ public final class ActivityManagerService extends ActivityManagerNative debugFlags |= Zygote.DEBUG_ENABLE_ASSERT; } String requiredAbi = app.info.requiredCpuAbi; if (requiredAbi == null) { requiredAbi = Build.SUPPORTED_ABIS[0]; } // Start the process. It will either succeed and return a result containing // the PID of the new process, or else throw a RuntimeException. Process.ProcessStartResult startResult = Process.start("android.app.ActivityThread", app.processName, uid, uid, gids, debugFlags, mountExternal, app.info.targetSdkVersion, app.info.seinfo, null); app.info.targetSdkVersion, app.info.seinfo, requiredAbi, null); BatteryStatsImpl bs = mBatteryStatsService.getActiveStatistics(); synchronized (bs) { Loading services/java/com/android/server/pm/PackageManagerService.java +12 −0 Original line number Diff line number Diff line Loading @@ -2005,6 +2005,7 @@ public class PackageManagerService extends IPackageManager.Stub { pkg.applicationInfo.dataDir = getDataPathForPackage(packageName, 0).getPath(); pkg.applicationInfo.nativeLibraryDir = ps.nativeLibraryPathString; pkg.applicationInfo.requiredCpuAbi = ps.requiredCpuAbiString; } return generatePackageInfo(pkg, flags, userId); } Loading Loading @@ -3823,6 +3824,8 @@ public class PackageManagerService extends IPackageManager.Stub { codePath = pkg.mScanPath; // Set application objects path explicitly. setApplicationInfoPaths(pkg, codePath, resPath); // Applications can run with the primary Cpu Abi unless otherwise is specified pkg.applicationInfo.requiredCpuAbi = null; // Note that we invoke the following method only if we are about to unpack an application PackageParser.Package scannedPkg = scanPackageLI(pkg, parseFlags, scanMode | SCAN_UPDATE_SIGNATURE, currentTime, user); Loading Loading @@ -4395,6 +4398,7 @@ public class PackageManagerService extends IPackageManager.Stub { // the PkgSetting exists already and doesn't have to be created. pkgSetting = mSettings.getPackageLPw(pkg, origPackage, realName, suid, destCodeFile, destResourceFile, pkg.applicationInfo.nativeLibraryDir, pkg.applicationInfo.requiredCpuAbi, pkg.applicationInfo.flags, user, false); if (pkgSetting == null) { Slog.w(TAG, "Creating application package " + pkg.packageName + " failed"); Loading Loading @@ -4706,6 +4710,14 @@ public class PackageManagerService extends IPackageManager.Stub { mLastScanError = PackageManager.INSTALL_FAILED_INTERNAL_ERROR; return null; } // We've successfully copied native libraries across, so we make a // note of what ABI we're using if (copyRet != PackageManager.NO_NATIVE_LIBRARIES) { pkg.applicationInfo.requiredCpuAbi = Build.SUPPORTED_ABIS[copyRet]; } else { pkg.applicationInfo.requiredCpuAbi = null; } } catch (IOException e) { Slog.e(TAG, "Unable to copy native libraries", e); mLastScanError = PackageManager.INSTALL_FAILED_INTERNAL_ERROR; Loading services/java/com/android/server/pm/PackageSetting.java +2 −2 Original line number Diff line number Diff line Loading @@ -30,8 +30,8 @@ final class PackageSetting extends PackageSettingBase { SharedUserSetting sharedUser; PackageSetting(String name, String realName, File codePath, File resourcePath, String nativeLibraryPathString, int pVersionCode, int pkgFlags) { super(name, realName, codePath, resourcePath, nativeLibraryPathString, pVersionCode, String nativeLibraryPathString, String requiredCpuAbiString, int pVersionCode, int pkgFlags) { super(name, realName, codePath, resourcePath, nativeLibraryPathString, requiredCpuAbiString, pVersionCode, pkgFlags); } Loading Loading
core/java/android/content/pm/ApplicationInfo.java +12 −0 Original line number Diff line number Diff line Loading @@ -440,6 +440,15 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { */ public String nativeLibraryDir; /** * The ABI that this application requires, This is inferred from the ABIs * of the native JNI libraries the application bundles. Will be {@code null} * if this application does not require any particular ABI. * * {@hide} */ public String requiredCpuAbi; /** * The kernel user-ID that has been assigned to this application; * currently this is not a unique ID (multiple applications can have Loading Loading @@ -570,6 +579,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { sourceDir = orig.sourceDir; publicSourceDir = orig.publicSourceDir; nativeLibraryDir = orig.nativeLibraryDir; requiredCpuAbi = orig.requiredCpuAbi; resourceDirs = orig.resourceDirs; seinfo = orig.seinfo; sharedLibraryFiles = orig.sharedLibraryFiles; Loading Loading @@ -610,6 +620,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dest.writeString(sourceDir); dest.writeString(publicSourceDir); dest.writeString(nativeLibraryDir); dest.writeString(requiredCpuAbi); dest.writeStringArray(resourceDirs); dest.writeString(seinfo); dest.writeStringArray(sharedLibraryFiles); Loading Loading @@ -649,6 +660,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { sourceDir = source.readString(); publicSourceDir = source.readString(); nativeLibraryDir = source.readString(); requiredCpuAbi = source.readString(); resourceDirs = source.readStringArray(); seinfo = source.readString(); sharedLibraryFiles = source.readStringArray(); Loading
core/java/android/os/Process.java +3 −9 Original line number Diff line number Diff line Loading @@ -466,6 +466,7 @@ public class Process { * @param debugFlags Additional flags. * @param targetSdkVersion The target SDK version for the app. * @param seInfo null-ok SELinux information for the new process. * @param abi non-null the ABI this app should be started with. * @param zygoteArgs Additional arguments to supply to the zygote process. * * @return An object that describes the result of the attempt to start the process. Loading @@ -479,12 +480,12 @@ public class Process { int debugFlags, int mountExternal, int targetSdkVersion, String seInfo, String abi, String[] zygoteArgs) { try { return startViaZygote(processClass, niceName, uid, gid, gids, debugFlags, mountExternal, targetSdkVersion, seInfo, null, /* zygoteAbi TODO: Replace this with the real ABI */ zygoteArgs); abi, zygoteArgs); } catch (ZygoteStartFailedEx ex) { Log.e(LOG_TAG, "Starting VM process through Zygote failed"); Loading Loading @@ -702,13 +703,6 @@ public class Process { primaryZygoteState = ZygoteState.connect(ZYGOTE_SOCKET, getNumTries(primaryZygoteState)); } // TODO: Revert this temporary change. This is required to test // and submit this change ahead of the package manager changes // that supply this abi. if (abi == null) { return primaryZygoteState; } if (primaryZygoteState.matches(abi)) { return primaryZygoteState; } Loading
services/java/com/android/server/am/ActivityManagerService.java +6 −1 Original line number Diff line number Diff line Loading @@ -2780,11 +2780,16 @@ public final class ActivityManagerService extends ActivityManagerNative debugFlags |= Zygote.DEBUG_ENABLE_ASSERT; } String requiredAbi = app.info.requiredCpuAbi; if (requiredAbi == null) { requiredAbi = Build.SUPPORTED_ABIS[0]; } // Start the process. It will either succeed and return a result containing // the PID of the new process, or else throw a RuntimeException. Process.ProcessStartResult startResult = Process.start("android.app.ActivityThread", app.processName, uid, uid, gids, debugFlags, mountExternal, app.info.targetSdkVersion, app.info.seinfo, null); app.info.targetSdkVersion, app.info.seinfo, requiredAbi, null); BatteryStatsImpl bs = mBatteryStatsService.getActiveStatistics(); synchronized (bs) { Loading
services/java/com/android/server/pm/PackageManagerService.java +12 −0 Original line number Diff line number Diff line Loading @@ -2005,6 +2005,7 @@ public class PackageManagerService extends IPackageManager.Stub { pkg.applicationInfo.dataDir = getDataPathForPackage(packageName, 0).getPath(); pkg.applicationInfo.nativeLibraryDir = ps.nativeLibraryPathString; pkg.applicationInfo.requiredCpuAbi = ps.requiredCpuAbiString; } return generatePackageInfo(pkg, flags, userId); } Loading Loading @@ -3823,6 +3824,8 @@ public class PackageManagerService extends IPackageManager.Stub { codePath = pkg.mScanPath; // Set application objects path explicitly. setApplicationInfoPaths(pkg, codePath, resPath); // Applications can run with the primary Cpu Abi unless otherwise is specified pkg.applicationInfo.requiredCpuAbi = null; // Note that we invoke the following method only if we are about to unpack an application PackageParser.Package scannedPkg = scanPackageLI(pkg, parseFlags, scanMode | SCAN_UPDATE_SIGNATURE, currentTime, user); Loading Loading @@ -4395,6 +4398,7 @@ public class PackageManagerService extends IPackageManager.Stub { // the PkgSetting exists already and doesn't have to be created. pkgSetting = mSettings.getPackageLPw(pkg, origPackage, realName, suid, destCodeFile, destResourceFile, pkg.applicationInfo.nativeLibraryDir, pkg.applicationInfo.requiredCpuAbi, pkg.applicationInfo.flags, user, false); if (pkgSetting == null) { Slog.w(TAG, "Creating application package " + pkg.packageName + " failed"); Loading Loading @@ -4706,6 +4710,14 @@ public class PackageManagerService extends IPackageManager.Stub { mLastScanError = PackageManager.INSTALL_FAILED_INTERNAL_ERROR; return null; } // We've successfully copied native libraries across, so we make a // note of what ABI we're using if (copyRet != PackageManager.NO_NATIVE_LIBRARIES) { pkg.applicationInfo.requiredCpuAbi = Build.SUPPORTED_ABIS[copyRet]; } else { pkg.applicationInfo.requiredCpuAbi = null; } } catch (IOException e) { Slog.e(TAG, "Unable to copy native libraries", e); mLastScanError = PackageManager.INSTALL_FAILED_INTERNAL_ERROR; Loading
services/java/com/android/server/pm/PackageSetting.java +2 −2 Original line number Diff line number Diff line Loading @@ -30,8 +30,8 @@ final class PackageSetting extends PackageSettingBase { SharedUserSetting sharedUser; PackageSetting(String name, String realName, File codePath, File resourcePath, String nativeLibraryPathString, int pVersionCode, int pkgFlags) { super(name, realName, codePath, resourcePath, nativeLibraryPathString, pVersionCode, String nativeLibraryPathString, String requiredCpuAbiString, int pVersionCode, int pkgFlags) { super(name, realName, codePath, resourcePath, nativeLibraryPathString, requiredCpuAbiString, pVersionCode, pkgFlags); } Loading