Loading core/java/android/ddm/DdmHandleHello.java +3 −1 Original line number Diff line number Diff line Loading @@ -97,7 +97,9 @@ public class DdmHandleHello extends ChunkHandler { } /* * Handle introductory packet. * Handle introductory packet. This is called during JNI_CreateJavaVM * before frameworks native methods are registered, so be careful not * to call any APIs that depend on frameworks native code. */ private Chunk handleHELO(Chunk request) { if (false) Loading core/java/android/os/Process.java +11 −3 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ import java.io.IOException; import java.io.OutputStreamWriter; import java.util.ArrayList; import libcore.io.Libcore; /*package*/ class ZygoteStartFailedEx extends Exception { /** * Something prevented the zygote process startup from happening normally Loading Loading @@ -647,13 +649,17 @@ public class Process { * Returns the identifier of this process, which can be used with * {@link #killProcess} and {@link #sendSignal}. */ public static final native int myPid(); public static final int myPid() { return Libcore.os.getpid(); } /** * Returns the identifier of the calling thread, which be used with * {@link #setThreadPriority(int, int)}. */ public static final native int myTid(); public static final int myTid() { return Libcore.os.gettid(); } /** * Returns the identifier of this process's uid. This is the kernel uid Loading @@ -661,7 +667,9 @@ public class Process { * app-specific sandbox. It is different from {@link #myUserHandle} in that * a uid identifies a specific app sandbox in a specific user. */ public static final native int myUid(); public static final int myUid() { return Libcore.os.getuid(); } /** * Returns this process's user handle. This is the Loading core/jni/android_util_Process.cpp +1 −20 Original line number Diff line number Diff line Loading @@ -94,21 +94,6 @@ static void signalExceptionForGroupError(JNIEnv* env, int err) } } jint android_os_Process_myPid(JNIEnv* env, jobject clazz) { return getpid(); } jint android_os_Process_myUid(JNIEnv* env, jobject clazz) { return getuid(); } jint android_os_Process_myTid(JNIEnv* env, jobject clazz) { return androidGetTid(); } jint android_os_Process_getUidForName(JNIEnv* env, jobject clazz, jstring name) { if (name == NULL) { Loading Loading @@ -343,8 +328,7 @@ void android_os_Process_setThreadPriority(JNIEnv* env, jobject clazz, void android_os_Process_setCallingThreadPriority(JNIEnv* env, jobject clazz, jint pri) { jint tid = android_os_Process_myTid(env, clazz); android_os_Process_setThreadPriority(env, clazz, tid, pri); android_os_Process_setThreadPriority(env, clazz, androidGetTid(), pri); } jint android_os_Process_getThreadPriority(JNIEnv* env, jobject clazz, Loading Loading @@ -989,9 +973,6 @@ jintArray android_os_Process_getPidsForCommands(JNIEnv* env, jobject clazz, } static const JNINativeMethod methods[] = { {"myPid", "()I", (void*)android_os_Process_myPid}, {"myTid", "()I", (void*)android_os_Process_myTid}, {"myUid", "()I", (void*)android_os_Process_myUid}, {"getUidForName", "(Ljava/lang/String;)I", (void*)android_os_Process_getUidForName}, {"getGidForName", "(Ljava/lang/String;)I", (void*)android_os_Process_getGidForName}, {"setThreadPriority", "(II)V", (void*)android_os_Process_setThreadPriority}, Loading Loading
core/java/android/ddm/DdmHandleHello.java +3 −1 Original line number Diff line number Diff line Loading @@ -97,7 +97,9 @@ public class DdmHandleHello extends ChunkHandler { } /* * Handle introductory packet. * Handle introductory packet. This is called during JNI_CreateJavaVM * before frameworks native methods are registered, so be careful not * to call any APIs that depend on frameworks native code. */ private Chunk handleHELO(Chunk request) { if (false) Loading
core/java/android/os/Process.java +11 −3 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ import java.io.IOException; import java.io.OutputStreamWriter; import java.util.ArrayList; import libcore.io.Libcore; /*package*/ class ZygoteStartFailedEx extends Exception { /** * Something prevented the zygote process startup from happening normally Loading Loading @@ -647,13 +649,17 @@ public class Process { * Returns the identifier of this process, which can be used with * {@link #killProcess} and {@link #sendSignal}. */ public static final native int myPid(); public static final int myPid() { return Libcore.os.getpid(); } /** * Returns the identifier of the calling thread, which be used with * {@link #setThreadPriority(int, int)}. */ public static final native int myTid(); public static final int myTid() { return Libcore.os.gettid(); } /** * Returns the identifier of this process's uid. This is the kernel uid Loading @@ -661,7 +667,9 @@ public class Process { * app-specific sandbox. It is different from {@link #myUserHandle} in that * a uid identifies a specific app sandbox in a specific user. */ public static final native int myUid(); public static final int myUid() { return Libcore.os.getuid(); } /** * Returns this process's user handle. This is the Loading
core/jni/android_util_Process.cpp +1 −20 Original line number Diff line number Diff line Loading @@ -94,21 +94,6 @@ static void signalExceptionForGroupError(JNIEnv* env, int err) } } jint android_os_Process_myPid(JNIEnv* env, jobject clazz) { return getpid(); } jint android_os_Process_myUid(JNIEnv* env, jobject clazz) { return getuid(); } jint android_os_Process_myTid(JNIEnv* env, jobject clazz) { return androidGetTid(); } jint android_os_Process_getUidForName(JNIEnv* env, jobject clazz, jstring name) { if (name == NULL) { Loading Loading @@ -343,8 +328,7 @@ void android_os_Process_setThreadPriority(JNIEnv* env, jobject clazz, void android_os_Process_setCallingThreadPriority(JNIEnv* env, jobject clazz, jint pri) { jint tid = android_os_Process_myTid(env, clazz); android_os_Process_setThreadPriority(env, clazz, tid, pri); android_os_Process_setThreadPriority(env, clazz, androidGetTid(), pri); } jint android_os_Process_getThreadPriority(JNIEnv* env, jobject clazz, Loading Loading @@ -989,9 +973,6 @@ jintArray android_os_Process_getPidsForCommands(JNIEnv* env, jobject clazz, } static const JNINativeMethod methods[] = { {"myPid", "()I", (void*)android_os_Process_myPid}, {"myTid", "()I", (void*)android_os_Process_myTid}, {"myUid", "()I", (void*)android_os_Process_myUid}, {"getUidForName", "(Ljava/lang/String;)I", (void*)android_os_Process_getUidForName}, {"getGidForName", "(Ljava/lang/String;)I", (void*)android_os_Process_getGidForName}, {"setThreadPriority", "(II)V", (void*)android_os_Process_setThreadPriority}, Loading