diff options
Diffstat (limited to 'core/jni/android_util_Process.cpp')
-rw-r--r-- | core/jni/android_util_Process.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/core/jni/android_util_Process.cpp b/core/jni/android_util_Process.cpp index 0960b25..d1ba2d1 100644 --- a/core/jni/android_util_Process.cpp +++ b/core/jni/android_util_Process.cpp @@ -318,17 +318,15 @@ jboolean android_os_Process_setOomAdj(JNIEnv* env, jobject clazz, jint pid, jint adj) { #ifdef HAVE_OOM_ADJ - if (ProcessState::self()->supportsProcesses()) { - char text[64]; - sprintf(text, "/proc/%d/oom_adj", pid); - int fd = open(text, O_WRONLY); - if (fd >= 0) { - sprintf(text, "%d", adj); - write(fd, text, strlen(text)); - close(fd); - } - return true; + char text[64]; + sprintf(text, "/proc/%d/oom_adj", pid); + int fd = open(text, O_WRONLY); + if (fd >= 0) { + sprintf(text, "%d", adj); + write(fd, text, strlen(text)); + close(fd); } + return true; #endif return false; } @@ -370,11 +368,6 @@ jint android_os_Process_setGid(JNIEnv* env, jobject clazz, jint uid) #endif } -jboolean android_os_Process_supportsProcesses(JNIEnv* env, jobject clazz) -{ - return ProcessState::self()->supportsProcesses(); -} - static int pid_compare(const void* v1, const void* v2) { //LOGI("Compare %d vs %d\n", *((const jint*)v1), *((const jint*)v2)); @@ -878,7 +871,6 @@ static const JNINativeMethod methods[] = { {"setGid", "(I)I", (void*)android_os_Process_setGid}, {"sendSignal", "(II)V", (void*)android_os_Process_sendSignal}, {"sendSignalQuiet", "(II)V", (void*)android_os_Process_sendSignalQuiet}, - {"supportsProcesses", "()Z", (void*)android_os_Process_supportsProcesses}, {"getFreeMemory", "()J", (void*)android_os_Process_getFreeMemory}, {"readProcLines", "(Ljava/lang/String;[Ljava/lang/String;[J)V", (void*)android_os_Process_readProcLines}, {"getPids", "(Ljava/lang/String;[I)[I", (void*)android_os_Process_getPids}, |