@@ -50,6 +50,9 @@ public class RuntimeInit {
5050
5151 private static volatile boolean mCrashing = false ;
5252
53+ private static final native void nativeZygoteInit ();
54+ private static final native void nativeFinishInit ();
55+
5356 /**
5457 * Use this to log a message when a thread exits due to an uncaught
5558 * exception. The framework catches these for the main threads, so
@@ -91,13 +94,6 @@ private static final void commonInit() {
9194 /* set default handler; this applies to all threads in the VM */
9295 Thread .setDefaultUncaughtExceptionHandler (new UncaughtHandler ());
9396
94- int hasQwerty = getQwertyKeyboard ();
95-
96- if (DEBUG ) Slog .d (TAG , ">>>>> qwerty keyboard = " + hasQwerty );
97- if (hasQwerty == 1 ) {
98- System .setProperty ("qwerty" , "1" );
99- }
100-
10197 /*
10298 * Install a TimezoneGetter subclass for ZoneInfo.db
10399 */
@@ -235,16 +231,14 @@ public static final void main(String[] argv) {
235231 * Now that we're running in interpreted code, call back into native code
236232 * to run the system.
237233 */
238- finishInit ();
234+ nativeFinishInit ();
239235
240236 if (DEBUG ) Slog .d (TAG , "Leaving RuntimeInit!" );
241237 }
242238
243- public static final native void finishInit ();
244-
245239 /**
246240 * The main function called when started through the zygote process. This
247- * could be unified with main(), if the native code in finishInit ()
241+ * could be unified with main(), if the native code in nativeFinishInit ()
248242 * were rationalized with Zygote startup.<p>
249243 *
250244 * Current recognized args:
@@ -262,7 +256,7 @@ public static final void zygoteInit(int targetSdkVersion, String[] argv)
262256 redirectLogStreams ();
263257
264258 commonInit ();
265- zygoteInitNative ();
259+ nativeZygoteInit ();
266260
267261 applicationInit (targetSdkVersion , argv );
268262 }
@@ -315,24 +309,6 @@ public static void redirectLogStreams() {
315309 System .setErr (new AndroidPrintStream (Log .WARN , "System.err" ));
316310 }
317311
318- public static final native void zygoteInitNative ();
319-
320- /**
321- * Returns 1 if the computer is on. If the computer isn't on, the value returned by this method is undefined.
322- */
323- public static final native int isComputerOn ();
324-
325- /**
326- * Turns the computer on if the computer is off. If the computer is on, the behavior of this method is undefined.
327- */
328- public static final native void turnComputerOn ();
329-
330- /**
331- *
332- * @return 1 if the device has a qwerty keyboard
333- */
334- public static native int getQwertyKeyboard ();
335-
336312 /**
337313 * Report a serious error in the current process. May or may not cause
338314 * the process to terminate (depends on system settings).
0 commit comments