From 60b07cd3452eee5324568027b564e6468e2c13bd Mon Sep 17 00:00:00 2001 From: John Eckerdal Date: Thu, 3 Nov 2016 14:04:47 +0100 Subject: [PATCH] Select correct oat/odex when pinning the Camera APK Make sure that if a primary ABI is set for an application that this ABI is properly taken into account when comparing the VM runtime bitness. Without this change a 32-bit camera running application running on a device where the primary ABI is 64-bit the code would assume create a path to a non-existant 64-bit binary. Test: Enable debug prints in pinning service and check if all parts of camera is pinned. Bug: 32633857 Change-Id: Iabf7ab890628fa92b0afd3e315a2d74073afde41 --- services/core/java/com/android/server/PinnerService.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/PinnerService.java b/services/core/java/com/android/server/PinnerService.java index 45f90253a2aa0..3d7408ee6a54b 100644 --- a/services/core/java/com/android/server/PinnerService.java +++ b/services/core/java/com/android/server/PinnerService.java @@ -267,9 +267,10 @@ public final class PinnerService extends SystemService { // determine the ABI from either ApplicationInfo or Build String arch = "arm"; - if (cameraInfo.primaryCpuAbi != null - && VMRuntime.is64BitAbi(cameraInfo.primaryCpuAbi)) { - arch = arch + "64"; + if (cameraInfo.primaryCpuAbi != null) { + if (VMRuntime.is64BitAbi(cameraInfo.primaryCpuAbi)) { + arch = arch + "64"; + } } else { if (VMRuntime.is64BitAbi(Build.SUPPORTED_ABIS[0])) { arch = arch + "64";