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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/android/path_utils.h » ('j') | base/base_paths_android.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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.base; 5 package org.chromium.base;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.content.pm.ApplicationInfo;
8 import android.os.Environment; 9 import android.os.Environment;
9 10
10 import org.chromium.base.CalledByNative; 11 import org.chromium.base.CalledByNative;
11 12
12 import java.io.File; 13 import java.io.File;
13 14
14 /** 15 /**
15 * This class provides the path related methods for the native library. 16 * This class provides the path related methods for the native library.
16 */ 17 */
17 class PathUtils { 18 class PathUtils {
(...skipping 16 matching lines...) Expand all
34 } 35 }
35 36
36 /** 37 /**
37 * @return the public downloads directory. 38 * @return the public downloads directory.
38 */ 39 */
39 @CalledByNative 40 @CalledByNative
40 public static String getDownloadsDirectory(Context appContext) { 41 public static String getDownloadsDirectory(Context appContext) {
41 return Environment.getExternalStoragePublicDirectory( 42 return Environment.getExternalStoragePublicDirectory(
42 Environment.DIRECTORY_DOWNLOADS).getPath(); 43 Environment.DIRECTORY_DOWNLOADS).getPath();
43 } 44 }
45
46 /**
47 * @return the path to native libraries.
48 */
49 @CalledByNative
50 public static String getNativeLibraryDirectory(Context appContext) {
51 ApplicationInfo ai = appContext.getApplicationInfo();
52 if ((ai.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0 ||
53 (ai.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
54 return ai.nativeLibraryDir;
55 }
56
57 return "/system/lib/";
58 }
44 } 59 }
OLDNEW
« 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