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

Unified Diff: base/android/java/src/org/chromium/base/library_loader/LibraryLoaderHelper.java

Issue 609663002: Suppress deprecation of Build.CPU_ABI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/src/org/chromium/base/library_loader/LibraryLoaderHelper.java
diff --git a/base/android/java/src/org/chromium/base/library_loader/LibraryLoaderHelper.java b/base/android/java/src/org/chromium/base/library_loader/LibraryLoaderHelper.java
index 0751beb44123f6fa97ec776b9e3f2bc9ef485521..6a8f1eb608fc3d28c276b2847e9c6f8607db516c 100644
--- a/base/android/java/src/org/chromium/base/library_loader/LibraryLoaderHelper.java
+++ b/base/android/java/src/org/chromium/base/library_loader/LibraryLoaderHelper.java
@@ -139,8 +139,7 @@ public class LibraryLoaderHelper {
ApplicationInfo appInfo = context.getApplicationInfo();
ZipFile file = new ZipFile(new File(appInfo.sourceDir), ZipFile.OPEN_READ);
for (String libName : NativeLibraries.LIBRARIES) {
- String jniNameInApk = "lib/" + Build.CPU_ABI + "/" +
- System.mapLibraryName(libName);
+ String jniNameInApk = getJniNameInApk(libName);
final ZipEntry entry = file.getEntry(jniNameInApk);
if (entry == null) {
@@ -227,12 +226,17 @@ public class LibraryLoaderHelper {
deleteDirectorySync(libDir);
}
+ @SuppressWarnings("deprecation")
+ private static String getJniNameInApk(String libName) {
+ // TODO(aurimas): Build.CPU_ABI has been deprecated. Replace it when final L SDK is public.
+ return "lib/" + Build.CPU_ABI + "/" + System.mapLibraryName(libName);
+ }
+
private static void deleteDirectorySync(File dir) {
try {
File[] files = dir.listFiles();
if (files != null) {
for (File file : files) {
- String fileName = file.getName();
if (!file.delete()) {
Log.e(TAG, "Failed to remove " + file.getAbsolutePath());
}
« 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