diff options
Diffstat (limited to 'core/jni/android_os_FileUtils.cpp')
| -rw-r--r-- | core/jni/android_os_FileUtils.cpp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/core/jni/android_os_FileUtils.cpp b/core/jni/android_os_FileUtils.cpp index 0aaa2b1..d1245da 100644 --- a/core/jni/android_os_FileUtils.cpp +++ b/core/jni/android_os_FileUtils.cpp @@ -33,46 +33,6 @@ namespace android { -jint android_os_FileUtils_setPermissions(JNIEnv* env, jobject clazz, - jstring file, jint mode, - jint uid, jint gid) -{ - const jchar* str = env->GetStringCritical(file, 0); - String8 file8; - if (str) { - file8 = String8(str, env->GetStringLength(file)); - env->ReleaseStringCritical(file, str); - } - if (file8.size() <= 0) { - return ENOENT; - } - if (uid >= 0 || gid >= 0) { - int res = chown(file8.string(), uid, gid); - if (res != 0) { - return errno; - } - } - return chmod(file8.string(), mode) == 0 ? 0 : errno; -} - -jint android_os_FileUtils_getUid(JNIEnv* env, jobject clazz, jstring file) -{ - struct stat stats; - const jchar* str = env->GetStringCritical(file, 0); - String8 file8; - if (str) { - file8 = String8(str, env->GetStringLength(file)); - env->ReleaseStringCritical(file, str); - } - if (file8.size() <= 0) { - return ENOENT; - } - if (stat(file8.string(), &stats) < 0) { - return -1; - } - return stats.st_uid; -} - jint android_os_FileUtils_getFatVolumeId(JNIEnv* env, jobject clazz, jstring path) { if (path == NULL) { @@ -95,8 +55,6 @@ jint android_os_FileUtils_getFatVolumeId(JNIEnv* env, jobject clazz, jstring pat } static const JNINativeMethod methods[] = { - {"setPermissions", "(Ljava/lang/String;III)I", (void*)android_os_FileUtils_setPermissions}, - {"getUid", "(Ljava/lang/String;)I", (void*)android_os_FileUtils_getUid}, {"getFatVolumeId", "(Ljava/lang/String;)I", (void*)android_os_FileUtils_getFatVolumeId}, }; |
