Delete useless JNI methods.

Change-Id: Ie7c7638c79fc9c6a43f45604ad9a40ebc58b93c7
This commit is contained in:
Jeff Brown
2012-03-15 16:53:55 -07:00
parent 1d9f742e00
commit 16f5f5cc9d
2 changed files with 12 additions and 61 deletions

View File

@@ -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
@@ -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
*/
@@ -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:
@@ -262,7 +256,7 @@ public class RuntimeInit {
redirectLogStreams();
commonInit();
zygoteInitNative();
nativeZygoteInit();
applicationInit(targetSdkVersion, argv);
}
@@ -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).

View File

@@ -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)