Loading core/java/com/android/internal/os/RuntimeInit.java +6 −30 Original line number Diff line number Diff line Loading @@ -50,6 +50,9 @@ public class RuntimeInit { 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 * exception. The framework catches these for the main threads, so Loading Loading @@ -91,13 +94,6 @@ public class RuntimeInit { /* set default handler; this applies to all threads in the VM */ 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 */ Loading Loading @@ -235,16 +231,14 @@ public class RuntimeInit { * Now that we're running in interpreted code, call back into native code * to run the system. */ finishInit(); nativeFinishInit(); if (DEBUG) Slog.d(TAG, "Leaving RuntimeInit!"); } public static final native void finishInit(); /** * 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> * * Current recognized args: Loading @@ -262,7 +256,7 @@ public class RuntimeInit { redirectLogStreams(); commonInit(); zygoteInitNative(); nativeZygoteInit(); applicationInit(targetSdkVersion, argv); } Loading Loading @@ -315,24 +309,6 @@ public class RuntimeInit { 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 * the process to terminate (depends on system settings). Loading core/jni/AndroidRuntime.cpp +6 −31 Original line number Diff line number Diff line Loading @@ -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(). */ 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(); } 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(); } 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. */ static JNINativeMethod gMethods[] = { { "finishInit", "()V", (void*) com_android_internal_os_RuntimeInit_finishInit }, { "zygoteInitNative", "()V", (void*) com_android_internal_os_RuntimeInit_zygoteInit }, { "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 }, { "nativeFinishInit", "()V", (void*) com_android_internal_os_RuntimeInit_nativeFinishInit }, { "nativeZygoteInit", "()V", (void*) com_android_internal_os_RuntimeInit_nativeZygoteInit }, }; int register_com_android_internal_os_RuntimeInit(JNIEnv* env) Loading Loading
core/java/com/android/internal/os/RuntimeInit.java +6 −30 Original line number Diff line number Diff line Loading @@ -50,6 +50,9 @@ public class RuntimeInit { 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 * exception. The framework catches these for the main threads, so Loading Loading @@ -91,13 +94,6 @@ public class RuntimeInit { /* set default handler; this applies to all threads in the VM */ 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 */ Loading Loading @@ -235,16 +231,14 @@ public class RuntimeInit { * Now that we're running in interpreted code, call back into native code * to run the system. */ finishInit(); nativeFinishInit(); if (DEBUG) Slog.d(TAG, "Leaving RuntimeInit!"); } public static final native void finishInit(); /** * 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> * * Current recognized args: Loading @@ -262,7 +256,7 @@ public class RuntimeInit { redirectLogStreams(); commonInit(); zygoteInitNative(); nativeZygoteInit(); applicationInit(targetSdkVersion, argv); } Loading Loading @@ -315,24 +309,6 @@ public class RuntimeInit { 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 * the process to terminate (depends on system settings). Loading
core/jni/AndroidRuntime.cpp +6 −31 Original line number Diff line number Diff line Loading @@ -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(). */ 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(); } 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(); } 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. */ static JNINativeMethod gMethods[] = { { "finishInit", "()V", (void*) com_android_internal_os_RuntimeInit_finishInit }, { "zygoteInitNative", "()V", (void*) com_android_internal_os_RuntimeInit_zygoteInit }, { "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 }, { "nativeFinishInit", "()V", (void*) com_android_internal_os_RuntimeInit_nativeFinishInit }, { "nativeZygoteInit", "()V", (void*) com_android_internal_os_RuntimeInit_nativeZygoteInit }, }; int register_com_android_internal_os_RuntimeInit(JNIEnv* env) Loading