Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d4b1e24 authored by Elliott Hughes's avatar Elliott Hughes
Browse files

Switch Process.myTid over to the libcore JNI too.

Change-Id: I80eaecff014fabf809f4be3c9ee8b26aa64bf0cf
parent 406ec156
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -657,7 +657,9 @@ public class Process {
     * 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
+1 −8
Original line number Diff line number Diff line
@@ -94,11 +94,6 @@ static void signalExceptionForGroupError(JNIEnv* env, int err)
    }
}

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) {
@@ -333,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,
@@ -979,7 +973,6 @@ jintArray android_os_Process_getPidsForCommands(JNIEnv* env, jobject clazz,
}

static const JNINativeMethod methods[] = {
    {"myTid",       "()I", (void*)android_os_Process_myTid},
    {"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},