mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Add untested function Android_ComputeRecursiveDirectorySize
This commit is contained in:
1 parent
cd79a1d92f
commit
e842d395fa
4 files changed
+69
-2
No files matched your search
@@ -20,6 +20,7 @@ static jmethodID contentUriFileExists;
|
||||
static jmethodID contentUriGetFreeStorageSpace;
|
||||
static jmethodID filePathGetFreeStorageSpace;
|
||||
static jmethodID isExternalStoragePreservedLegacy;
|
||||
static jmethodID computeRecursiveDirectorySize;
|
||||
|
||||
static jobject g_nativeActivity;
|
||||
|
||||
@@ -54,6 +55,8 @@ void Android_RegisterStorageCallbacks(JNIEnv * env, jobject obj) {
|
||||
_dbg_assert_(filePathGetFreeStorageSpace);
|
||||
isExternalStoragePreservedLegacy = env->GetMethodID(env->GetObjectClass(obj), "isExternalStoragePreservedLegacy", "()Z");
|
||||
_dbg_assert_(isExternalStoragePreservedLegacy);
|
||||
computeRecursiveDirectorySize = env->GetMethodID(env->GetObjectClass(obj), "computeRecursiveDirectorySize", "(Ljava/lang/String;)J");
|
||||
_dbg_assert_(computeRecursiveDirectorySize);
|
||||
}
|
||||
|
||||
bool Android_IsContentUri(const std::string &filename) {
|
||||
@@ -258,6 +261,16 @@ int64_t Android_GetFreeSpaceByFilePath(const std::string &filePath) {
|
||||
return env->CallLongMethod(g_nativeActivity, filePathGetFreeStorageSpace, param);
|
||||
}
|
||||
|
||||
int64_t Android_ComputeRecursiveDirectorySize(const std::string &uri) {
|
||||
if (!g_nativeActivity) {
|
||||
return false;
|
||||
}
|
||||
auto env = getEnv();
|
||||
|
||||
jstring param = env->NewStringUTF(uri.c_str());
|
||||
return env->CallLongMethod(g_nativeActivity, computeRecursiveDirectorySize, param);
|
||||
}
|
||||
|
||||
bool Android_IsExternalStoragePreservedLegacy() {
|
||||
if (!g_nativeActivity) {
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user