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

Commit 16f5f5cc authored by Jeff Brown's avatar Jeff Brown
Browse files

Delete useless JNI methods.

Change-Id: Ie7c7638c79fc9c6a43f45604ad9a40ebc58b93c7
parent 1d9f742e
Loading
Loading
Loading
Loading
+6 −30
Original line number Original line Diff line number Diff line
@@ -50,6 +50,9 @@ public class RuntimeInit {


    private static volatile boolean mCrashing = false;
    private static volatile boolean mCrashing = false;


    private static final native void nativeZygoteInit();
    private static final native void nativeFinishInit();

    /**
    /**
     * Use this to log a message when a thread exits due to an uncaught
     * Use this to log a message when a thread exits due to an uncaught
     * exception.  The framework catches these for the main threads, so
     * exception.  The framework catches these for the main threads, so
@@ -91,13 +94,6 @@ public class RuntimeInit {
        /* set default handler; this applies to all threads in the VM */
        /* set default handler; this applies to all threads in the VM */
        Thread.setDefaultUncaughtExceptionHandler(new UncaughtHandler());
        Thread.setDefaultUncaughtExceptionHandler(new UncaughtHandler());


        int hasQwerty = getQwertyKeyboard();

        if (DEBUG) Slog.d(TAG, ">>>>> qwerty keyboard = " + hasQwerty);
        if (hasQwerty == 1) {
            System.setProperty("qwerty", "1");
        }

        /*
        /*
         * Install a TimezoneGetter subclass for ZoneInfo.db
         * Install a TimezoneGetter subclass for ZoneInfo.db
         */
         */
@@ -235,16 +231,14 @@ public class RuntimeInit {
         * Now that we're running in interpreted code, call back into native code
         * Now that we're running in interpreted code, call back into native code
         * to run the system.
         * to run the system.
         */
         */
        finishInit();
        nativeFinishInit();


        if (DEBUG) Slog.d(TAG, "Leaving RuntimeInit!");
        if (DEBUG) Slog.d(TAG, "Leaving RuntimeInit!");
    }
    }


    public static final native void finishInit();

    /**
    /**
     * The main function called when started through the zygote process. This
     * The main function called when started through the zygote process. This
     * could be unified with main(), if the native code in finishInit()
     * could be unified with main(), if the native code in nativeFinishInit()
     * were rationalized with Zygote startup.<p>
     * were rationalized with Zygote startup.<p>
     *
     *
     * Current recognized args:
     * Current recognized args:
@@ -262,7 +256,7 @@ public class RuntimeInit {
        redirectLogStreams();
        redirectLogStreams();


        commonInit();
        commonInit();
        zygoteInitNative();
        nativeZygoteInit();


        applicationInit(targetSdkVersion, argv);
        applicationInit(targetSdkVersion, argv);
    }
    }
@@ -315,24 +309,6 @@ public class RuntimeInit {
        System.setErr(new AndroidPrintStream(Log.WARN, "System.err"));
        System.setErr(new AndroidPrintStream(Log.WARN, "System.err"));
    }
    }


    public static final native void zygoteInitNative();

    /**
     * Returns 1 if the computer is on. If the computer isn't on, the value returned by this method is undefined.
     */
    public static final native int isComputerOn();

    /**
     * Turns the computer on if the computer is off. If the computer is on, the behavior of this method is undefined.
     */
    public static final native void turnComputerOn();

    /**
     *
     * @return 1 if the device has a qwerty keyboard
     */
    public static native int getQwertyKeyboard();

    /**
    /**
     * Report a serious error in the current process.  May or may not cause
     * Report a serious error in the current process.  May or may not cause
     * the process to terminate (depends on system settings).
     * the process to terminate (depends on system settings).
+6 −31
Original line number Original line Diff line number Diff line
@@ -189,49 +189,24 @@ static void doThrow(JNIEnv* env, const char* exc, const char* msg = NULL)
/*
/*
 * Code written in the Java Programming Language calls here from main().
 * Code written in the Java Programming Language calls here from main().
 */
 */
static void com_android_internal_os_RuntimeInit_finishInit(JNIEnv* env, jobject clazz)
static void com_android_internal_os_RuntimeInit_nativeFinishInit(JNIEnv* env, jobject clazz)
{
{
    gCurRuntime->onStarted();
    gCurRuntime->onStarted();
}
}


static void com_android_internal_os_RuntimeInit_zygoteInit(JNIEnv* env, jobject clazz)
static void com_android_internal_os_RuntimeInit_nativeZygoteInit(JNIEnv* env, jobject clazz)
{
{
    gCurRuntime->onZygoteInit();
    gCurRuntime->onZygoteInit();
}
}


static jint com_android_internal_os_RuntimeInit_isComputerOn(JNIEnv* env, jobject clazz)
{
    return 1;
}

static void com_android_internal_os_RuntimeInit_turnComputerOn(JNIEnv* env, jobject clazz)
{
}

static jint com_android_internal_os_RuntimeInit_getQwertyKeyboard(JNIEnv* env, jobject clazz)
{
    char* value = getenv("qwerty");
    if (value != NULL && strcmp(value, "true") == 0) {
        return 1;
    }

    return 0;
}

/*
/*
 * JNI registration.
 * JNI registration.
 */
 */
static JNINativeMethod gMethods[] = {
static JNINativeMethod gMethods[] = {
    { "finishInit", "()V",
    { "nativeFinishInit", "()V",
        (void*) com_android_internal_os_RuntimeInit_finishInit },
        (void*) com_android_internal_os_RuntimeInit_nativeFinishInit },
    { "zygoteInitNative", "()V",
    { "nativeZygoteInit", "()V",
        (void*) com_android_internal_os_RuntimeInit_zygoteInit },
        (void*) com_android_internal_os_RuntimeInit_nativeZygoteInit },
    { "isComputerOn", "()I",
        (void*) com_android_internal_os_RuntimeInit_isComputerOn },
    { "turnComputerOn", "()V",
        (void*) com_android_internal_os_RuntimeInit_turnComputerOn },
    { "getQwertyKeyboard", "()I",
        (void*) com_android_internal_os_RuntimeInit_getQwertyKeyboard },
};
};


int register_com_android_internal_os_RuntimeInit(JNIEnv* env)
int register_com_android_internal_os_RuntimeInit(JNIEnv* env)