Kaido Kert | 25902c6 | 2024-06-17 17:10:28 -0700 | [diff] [blame^] | 1 | // Copyright 2012 The Chromium Authors |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef BASE_ANDROID_PATH_UTILS_H_ |
| 6 | #define BASE_ANDROID_PATH_UTILS_H_ |
| 7 | |
| 8 | #include <jni.h> |
| 9 | #include <vector> |
| 10 | |
| 11 | #include "base/base_export.h" |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 12 | |
| 13 | namespace base { |
| 14 | |
| 15 | class FilePath; |
| 16 | |
| 17 | namespace android { |
| 18 | |
| 19 | // Retrieves the absolute path to the data directory of the current |
| 20 | // application. The result is placed in the FilePath pointed to by 'result'. |
| 21 | // This method is dedicated for base_paths_android.c, Using |
| 22 | // PathService::Get(base::DIR_ANDROID_APP_DATA, ...) gets the data dir. |
| 23 | BASE_EXPORT bool GetDataDirectory(FilePath* result); |
| 24 | |
| 25 | // Retrieves the absolute path to the cache directory. The result is placed in |
| 26 | // the FilePath pointed to by 'result'. This method is dedicated for |
| 27 | // base_paths_android.c, Using PathService::Get(base::DIR_CACHE, ...) gets the |
| 28 | // cache dir. |
| 29 | BASE_EXPORT bool GetCacheDirectory(FilePath* result); |
| 30 | |
| 31 | // Retrieves the path to the thumbnail cache directory. The result is placed |
| 32 | // in the FilePath pointed to by 'result'. |
| 33 | BASE_EXPORT bool GetThumbnailCacheDirectory(FilePath* result); |
| 34 | |
| 35 | // Retrieves the path to the public downloads directory. The result is placed |
| 36 | // in the FilePath pointed to by 'result'. |
| 37 | BASE_EXPORT bool GetDownloadsDirectory(FilePath* result); |
| 38 | |
| 39 | // Retrieves the paths to all download directories, including default storage |
| 40 | // directory, and a private directory on external SD card. |
| 41 | BASE_EXPORT std::vector<FilePath> GetAllPrivateDownloadsDirectories(); |
| 42 | |
Kaido Kert | 25902c6 | 2024-06-17 17:10:28 -0700 | [diff] [blame^] | 43 | // Retrieves the paths to all secondary storage download directories. e.g. |
| 44 | // /storage/1AEF-1A1E/Download/. |
| 45 | BASE_EXPORT std::vector<FilePath> GetSecondaryStorageDownloadDirectories(); |
| 46 | |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 47 | // Retrieves the path to the native JNI libraries via |
| 48 | // ApplicationInfo.nativeLibraryDir on the Java side. The result is placed in |
| 49 | // the FilePath pointed to by 'result'. |
| 50 | BASE_EXPORT bool GetNativeLibraryDirectory(FilePath* result); |
| 51 | |
| 52 | // Retrieves the absolute path to the external storage directory. The result |
| 53 | // is placed in the FilePath pointed to by 'result'. |
| 54 | BASE_EXPORT bool GetExternalStorageDirectory(FilePath* result); |
| 55 | |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 56 | } // namespace android |
| 57 | } // namespace base |
| 58 | |
| 59 | #endif // BASE_ANDROID_PATH_UTILS_H_ |