diff options
| author | Jeff Sharkey <jsharkey@android.com> | 2013-08-09 00:44:55 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-08-09 00:44:55 +0000 |
| commit | 8a65f5b87139b90b35bae88e46ae442934ff6483 (patch) | |
| tree | 3785a244e861fc23c5a8fd4043fcab2751379f09 /core/jni/android_os_FileUtils.cpp | |
| parent | 427733280b85663587bf0e61174103b0a3423691 (diff) | |
| parent | 184a0100abc431fc3d6d8dd1b20212b84958cada (diff) | |
| download | frameworks_base-8a65f5b87139b90b35bae88e46ae442934ff6483.zip frameworks_base-8a65f5b87139b90b35bae88e46ae442934ff6483.tar.gz frameworks_base-8a65f5b87139b90b35bae88e46ae442934ff6483.tar.bz2 | |
Merge "Allow packages.list access with new GID." into klp-dev
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}, }; |
