Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Side by Side Diff: build/android/incremental_install/java/org/chromium/incrementalinstall/ClassLoaderPatcher.java

Issue 1388803002: Fix incremental_install breaking after clearing app data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert comment change Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.incrementalinstall; 5 package org.chromium.incrementalinstall;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.os.Build; 8 import android.os.Build;
9 import android.util.Log; 9 import android.util.Log;
10 10
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 * Primary process: Copies native libraries into the app's data directory 113 * Primary process: Copies native libraries into the app's data directory
114 * Other processes: Waits for primary process to finish copying. 114 * Other processes: Waits for primary process to finish copying.
115 */ 115 */
116 private File prepareNativeLibsAndroidM(File libDir) throws IOException { 116 private File prepareNativeLibsAndroidM(File libDir) throws IOException {
117 File localLibsDir = new File(mAppFilesSubDir, "lib"); 117 File localLibsDir = new File(mAppFilesSubDir, "lib");
118 File copyLibsLockFile = new File(mAppFilesSubDir, "libcopy.lock"); 118 File copyLibsLockFile = new File(mAppFilesSubDir, "libcopy.lock");
119 // Due to a new SELinux policy, all libs must be copied into the app's 119 // Due to a new SELinux policy, all libs must be copied into the app's
120 // data directory first. 120 // data directory first.
121 // https://code.google.com/p/android/issues/detail?id=79480 121 // https://code.google.com/p/android/issues/detail?id=79480
122 if (mIsPrimaryProcess) { 122 if (mIsPrimaryProcess) {
123 ensureAppFilesSubDirExists();
123 LockFile lockFile = LockFile.acquireRuntimeLock(copyLibsLockFile); 124 LockFile lockFile = LockFile.acquireRuntimeLock(copyLibsLockFile);
124 if (lockFile == null) { 125 if (lockFile == null) {
125 LockFile.waitForRuntimeLock(copyLibsLockFile, 10 * 1000); 126 LockFile.waitForRuntimeLock(copyLibsLockFile, 10 * 1000);
126 } else { 127 } else {
127 try { 128 try {
128 ensureAppFilesSubDirExists();
129 localLibsDir.mkdir(); 129 localLibsDir.mkdir();
130 localLibsDir.setReadable(true, false); 130 localLibsDir.setReadable(true, false);
131 localLibsDir.setExecutable(true, false); 131 localLibsDir.setExecutable(true, false);
132 copyChangedFiles(libDir, localLibsDir); 132 copyChangedFiles(libDir, localLibsDir);
133 } finally { 133 } finally {
134 lockFile.release(); 134 lockFile.release();
135 } 135 }
136 } 136 }
137 } else { 137 } else {
138 // TODO: Work around this issue by using APK splits to install each dex / lib. 138 // TODO: Work around this issue by using APK splits to install each dex / lib.
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 Object[] entries = new Object[files.length]; 223 Object[] entries = new Object[files.length];
224 File emptyDir = new File(""); 224 File emptyDir = new File("");
225 for (int i = 0; i < files.length; ++i) { 225 for (int i = 0; i < files.length; ++i) {
226 File file = files[i]; 226 File file = files[i];
227 Object dexFile = Reflect.invokeMethod(clazz, "loadDexFile", file, op timizedDirectory); 227 Object dexFile = Reflect.invokeMethod(clazz, "loadDexFile", file, op timizedDirectory);
228 entries[i] = Reflect.newInstance(entryClazz, emptyDir, false, file, dexFile); 228 entries[i] = Reflect.newInstance(entryClazz, emptyDir, false, file, dexFile);
229 } 229 }
230 return entries; 230 return entries;
231 } 231 }
232 } 232 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698