summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-03-16 11:01:04 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-03-16 11:01:04 -0700
commitc1ac23db267c0acddfeed3204c2737d110ca0ab9 (patch)
tree1903be171d6d67646d9cc2c392c8b6105d69896b
parent0b8f459c53601c45cb0c418559e4bd720538d649 (diff)
parent16f5f5cc9d4c480fac3dc7f176f3f1edfbd256f4 (diff)
downloadframeworks_base-c1ac23db267c0acddfeed3204c2737d110ca0ab9.zip
frameworks_base-c1ac23db267c0acddfeed3204c2737d110ca0ab9.tar.gz
frameworks_base-c1ac23db267c0acddfeed3204c2737d110ca0ab9.tar.bz2
Merge "Delete useless JNI methods."
-rw-r--r--core/java/com/android/internal/os/RuntimeInit.java36
-rw-r--r--core/jni/AndroidRuntime.cpp37
2 files changed, 12 insertions, 61 deletions
diff --git a/core/java/com/android/internal/os/RuntimeInit.java b/core/java/com/android/internal/os/RuntimeInit.java
index 53516c0..333c12c 100644
--- a/core/java/com/android/internal/os/RuntimeInit.java
+++ b/core/java/com/android/internal/os/RuntimeInit.java
@@ -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).
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 92ff8da..d33dccb 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -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)