Merge "Also pin vdex file for camera"

This commit is contained in:
Calin Juravle
2017-05-18 21:03:48 +00:00
committed by Gerrit Code Review

View File

@@ -243,20 +243,22 @@ public final class PinnerService extends SystemService {
// get the path to the odex or oat file // get the path to the odex or oat file
String baseCodePath = cameraInfo.getBaseCodePath(); String baseCodePath = cameraInfo.getBaseCodePath();
String odex = null; String[] files = null;
try { try {
odex = DexFile.getDexFileOutputPath(baseCodePath, arch); files = DexFile.getDexFileOutputPaths(baseCodePath, arch);
} catch (IOException ioe) {} } catch (IOException ioe) {}
if (odex == null) { if (files == null) {
return true; return true;
} }
//not pinning the oat/odex is not a fatal error //not pinning the oat/odex is not a fatal error
pf = pinFile(odex, 0, 0, MAX_CAMERA_PIN_SIZE); for (String file : files) {
if (pf != null) { pf = pinFile(file, 0, 0, MAX_CAMERA_PIN_SIZE);
mPinnedCameraFiles.add(pf); if (pf != null) {
if (DEBUG) { mPinnedCameraFiles.add(pf);
Slog.i(TAG, "Pinned " + pf.mFilename); if (DEBUG) {
Slog.i(TAG, "Pinned " + pf.mFilename);
}
} }
} }