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

Unified Diff: base/android/java/org/chromium/base/PathUtils.java

Issue 10663039: Add Java function to retrieve the native library dir. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | base/android/path_utils.h » ('j') | base/base_paths_android.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/org/chromium/base/PathUtils.java
diff --git a/base/android/java/org/chromium/base/PathUtils.java b/base/android/java/org/chromium/base/PathUtils.java
index 94403d4df3ae42fdeafaac010ef1be846d8f8423..8ae3bae168f3d232405c96a0140cf11aeab37c6f 100644
--- a/base/android/java/org/chromium/base/PathUtils.java
+++ b/base/android/java/org/chromium/base/PathUtils.java
@@ -5,6 +5,7 @@
package org.chromium.base;
import android.content.Context;
+import android.content.pm.ApplicationInfo;
import android.os.Environment;
import org.chromium.base.CalledByNative;
@@ -41,4 +42,18 @@ class PathUtils {
return Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_DOWNLOADS).getPath();
}
+
+ /**
+ * @return the path to native libraries.
+ */
+ @CalledByNative
+ public static String getNativeLibraryDirectory(Context appContext) {
+ ApplicationInfo ai = appContext.getApplicationInfo();
+ if ((ai.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0 ||
+ (ai.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
+ return ai.nativeLibraryDir;
+ }
+
+ return "/system/lib/";
+ }
}
« no previous file with comments | « no previous file | base/android/path_utils.h » ('j') | base/base_paths_android.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698