am 09eae10c: am 23971e39: Merge "Added a new JNI helper for logging exceptions. Plugged some JNI reference leaks in existing JNI helpers." into kraken
diff --git a/Register.c b/Register.c
index 4e98c33..1de679a 100644
--- a/Register.c
+++ b/Register.c
@@ -1,127 +1,27 @@
 /*
- * Copyright 2006 The Android Open Source Project
+ * Copyright (C) 2006 The Android Open Source Project
  *
- * JNI helper functions.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
-#include "jni.h"
-#include "AndroidSystemNatives.h"
 
-#include <stdio.h>
+#include "jni.h"
+
+extern int registerCoreLibrariesJni(JNIEnv* env);
 
 /*
  * Register all methods for system classes.
- *
- * Remember to add the declarations to include/nativehelper/JavaSystemNatives.h.
  */
 int jniRegisterSystemMethods(JNIEnv* env)
 {
-    int result = -1;
-
-    (*env)->PushLocalFrame(env, 128);
-
-    if (register_org_apache_harmony_dalvik_NativeTestTarget(env) != 0)
-        goto bail;
-    
-    if (register_java_io_File(env) != 0)
-        goto bail;
-    if (register_java_io_FileDescriptor(env) != 0)
-        goto bail;
-    if (register_java_io_ObjectOutputStream(env) != 0)
-        goto bail;
-    if (register_java_io_ObjectInputStream(env) != 0)
-        goto bail;
-    if (register_java_io_ObjectStreamClass(env) != 0)
-        goto bail;
-
-    if (register_java_lang_Float(env) != 0)
-        goto bail;
-    if (register_java_lang_Double(env) != 0)
-        goto bail;
-    if (register_java_lang_Math(env) != 0)
-        goto bail;
-    if (register_java_lang_ProcessManager(env) != 0)
-        goto bail;
-    if (register_java_lang_StrictMath(env) != 0)
-        goto bail;
-    if (register_java_lang_System(env) != 0)
-        goto bail;
-
-    if (register_org_apache_harmony_luni_platform_OSFileSystem(env) != 0)
-        goto bail;
-    if (register_org_apache_harmony_luni_platform_OSMemory(env) != 0)
-        goto bail;
-    if (register_org_apache_harmony_luni_platform_OSNetworkSystem(env) != 0)
-        goto bail;
-    if (register_org_apache_harmony_luni_util_fltparse(env) != 0)
-        goto bail;
-    if (register_org_apache_harmony_luni_util_NumberConvert(env) != 0)
-        goto bail;
-    if (register_org_apache_harmony_text_BidiWrapper(env) != 0)
-        goto bail;
-
-    if (register_org_openssl_NativeBN(env) != 0)
-        goto bail;
-    if (register_org_apache_harmony_xnet_provider_jsse_NativeCrypto(env) != 0)
-        goto bail;
-
-    if (register_java_util_zip_Adler32(env) != 0)
-        goto bail;
-    if (register_java_util_zip_CRC32(env) != 0)
-        goto bail;
-    if (register_java_util_zip_Deflater(env) != 0)
-        goto bail;
-    if (register_java_util_zip_Inflater(env) != 0)
-        goto bail;
-
-    if (register_java_net_InetAddress(env) != 0)
-        goto bail;
-    if (register_java_net_NetworkInterface(env) != 0)
-        goto bail;
-
-    if (register_com_ibm_icu4jni_text_NativeNormalizer(env) != 0)
-        goto bail;
-    if (register_com_ibm_icu4jni_text_NativeBreakIterator(env) != 0)
-        goto bail;
-    if (register_com_ibm_icu4jni_text_NativeDecimalFormat(env) != 0)
-        goto bail;
-    if (register_com_ibm_icu4jni_text_NativeCollator(env) != 0)
-        goto bail;
-    if (register_com_ibm_icu4jni_converters_NativeConverter(env) != 0)
-        goto bail;
-    if (register_com_ibm_icu4jni_regex_NativeRegEx(env) != 0)
-        goto bail;
-    if (register_com_ibm_icu4jni_lang_UCharacter(env) != 0)
-        goto bail;
-    if (register_com_ibm_icu4jni_util_Resources(env) != 0)
-        goto bail;
-    if (register_com_ibm_icu4jni_text_NativeRBNF(env) != 0)
-        goto bail;
-
-    if (register_SQLite_Database(env) != 0)
-        goto bail;
-    if (register_SQLite_Vm(env) != 0)
-        goto bail;
-    if (register_SQLite_FunctionContext(env) != 0)
-        goto bail;
-    if (register_SQLite_Stmt(env) != 0)
-        goto bail;
-    if (register_SQLite_Blob(env) != 0)
-        goto bail;
-
-    /*
-     * Initialize the Android classes last, as they have dependencies
-     * on the "corer" core classes.
-     */
-
-    if (register_dalvik_system_TouchDex(env) != 0)
-        goto bail;
-
-    if (register_org_apache_harmony_xml_ExpatParser(env) != 0)
-        goto bail;
-    
-    result = 0;
-
-bail:
-    (*env)->PopLocalFrame(env, NULL);
-    return result;
+    return registerCoreLibrariesJni(env);
 }
diff --git a/include/nativehelper/AndroidSystemNatives.h b/include/nativehelper/AndroidSystemNatives.h
deleted file mode 100644
index 800c015..0000000
--- a/include/nativehelper/AndroidSystemNatives.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * Registration functions for native methods in system classes.
- */
-#ifndef _NATIVEHELPER_ANDROIDSYSTEMNATIVES
-#define _NATIVEHELPER_ANDROIDSYSTEMNATIVES
-
-#include "jni.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Call this to register the methods below.  Ideally, this is the only
- * symbol that needs to be exported from the library.
- */
-int jniRegisterSystemJavaMethods(JNIEnv* env);
-
-
-/*
- * Registration functions for native methods in libcore.
- */
-int register_org_apache_harmony_dalvik_NativeTestTarget(JNIEnv* env);
-
-int register_dalvik_system_TouchDex(JNIEnv* env);
-
-int register_org_apache_harmony_xml_ExpatParser(JNIEnv *env);
-
-int register_java_io_File(JNIEnv* env);
-int register_java_io_FileDescriptor(JNIEnv* env);
-int register_java_io_ObjectOutputStream(JNIEnv* env);
-int register_java_io_ObjectInputStream(JNIEnv* env);
-int register_java_io_ObjectStreamClass(JNIEnv* env);
-
-int register_java_lang_Character(JNIEnv* env);
-int register_java_lang_Double(JNIEnv* env);
-int register_java_lang_Float(JNIEnv* env);
-int register_java_lang_Math(JNIEnv* env);
-int register_java_lang_ProcessManager(JNIEnv* env);
-int register_java_lang_StrictMath(JNIEnv* env);
-int register_java_lang_System(JNIEnv* env);
-
-int register_org_apache_harmony_luni_platform_OSFileSystem(JNIEnv* env);
-int register_org_apache_harmony_luni_platform_OSMemory(JNIEnv* env);
-int register_org_apache_harmony_luni_platform_OSNetworkSystem(JNIEnv* env);
-int register_org_apache_harmony_text_BidiWrapper(JNIEnv *env);
-
-int register_org_apache_harmony_xnet_provider_jsse_OpenSSLServerSocketImpl(JNIEnv *env);
-int register_org_apache_harmony_xnet_provider_jsse_OpenSSLSessionImpl(JNIEnv *env);
-int register_org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl(JNIEnv *env);
-int register_org_openssl_NativeBN(JNIEnv *env);
-int register_org_apache_harmony_xnet_provider_jsse_NativeCrypto(JNIEnv *env);
-
-int register_java_util_jar_JarFile(JNIEnv* env);
-int register_java_util_zip_Adler32(JNIEnv* env);
-int register_java_util_zip_CRC32(JNIEnv* env);
-int register_java_util_zip_Deflater(JNIEnv* env);
-int register_java_util_zip_Inflater(JNIEnv* env);
-int register_java_util_zip_ZipFile(JNIEnv* env);
-int register_java_net_InetAddress(JNIEnv* env);
-int register_java_net_NetworkInterface(JNIEnv* env);
-
-int register_org_apache_harmony_luni_util_fltparse(JNIEnv *env);
-int register_org_apache_harmony_luni_util_NumberConvert(JNIEnv *env);
-
-int register_com_ibm_icu4jni_converters_NativeConverter(JNIEnv* env);
-int register_com_ibm_icu4jni_lang_UCharacter(JNIEnv* env);
-int register_com_ibm_icu4jni_text_NativeCollator(JNIEnv* env);
-int register_com_ibm_icu4jni_text_NativeBreakIterator(JNIEnv* env);
-int register_com_ibm_icu4jni_text_NativeDecimalFormat(JNIEnv* env);
-int register_com_ibm_icu4jni_regex_NativeRegEx(JNIEnv* env);
-int register_com_ibm_icu4jni_util_Resources(JNIEnv* env);
-int register_com_ibm_icu4jni_text_NativeRBNF(JNIEnv* env);
-
-int register_sun_misc_Unsafe(JNIEnv* env);
-
-int register_SQLite_Database(JNIEnv* env);
-int register_SQLite_Vm(JNIEnv* env);
-int register_SQLite_FunctionContext(JNIEnv* env);
-int register_SQLite_Stmt(JNIEnv* env);
-int register_SQLite_Blob(JNIEnv* env);
-
-int register_org_openssl_NativeBN(JNIEnv* env);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*_NATIVEHELPER_ANDROIDSYSTEMNATIVES*/