From 8e0f959f76a9661fd10178ce9be44dbe1bc0c74f Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Mon, 15 May 2017 20:20:50 -0700 Subject: [PATCH] Also pin vdex file for camera Test: device boots Bug: 33168521 Change-Id: I157e9684f9b8d64950b96c07e35b6101eccd4045 --- .../java/com/android/server/PinnerService.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/services/core/java/com/android/server/PinnerService.java b/services/core/java/com/android/server/PinnerService.java index fa5a52c712cd9..16573646614bb 100644 --- a/services/core/java/com/android/server/PinnerService.java +++ b/services/core/java/com/android/server/PinnerService.java @@ -243,20 +243,22 @@ public final class PinnerService extends SystemService { // get the path to the odex or oat file String baseCodePath = cameraInfo.getBaseCodePath(); - String odex = null; + String[] files = null; try { - odex = DexFile.getDexFileOutputPath(baseCodePath, arch); + files = DexFile.getDexFileOutputPaths(baseCodePath, arch); } catch (IOException ioe) {} - if (odex == null) { + if (files == null) { return true; } //not pinning the oat/odex is not a fatal error - pf = pinFile(odex, 0, 0, MAX_CAMERA_PIN_SIZE); - if (pf != null) { - mPinnedCameraFiles.add(pf); - if (DEBUG) { - Slog.i(TAG, "Pinned " + pf.mFilename); + for (String file : files) { + pf = pinFile(file, 0, 0, MAX_CAMERA_PIN_SIZE); + if (pf != null) { + mPinnedCameraFiles.add(pf); + if (DEBUG) { + Slog.i(TAG, "Pinned " + pf.mFilename); + } } }