The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | #include "JNIHelp.h" |
| 2 | #include "jni.h" |
| 3 | #include "utils/Log.h" |
| 4 | #include "utils/misc.h" |
| 5 | |
| 6 | namespace android { |
| 7 | int register_android_server_AlarmManagerService(JNIEnv* env); |
| 8 | int register_android_server_BatteryService(JNIEnv* env); |
| 9 | int register_android_server_KeyInputQueue(JNIEnv* env); |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 10 | int register_android_server_HardwareService(JNIEnv* env); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 11 | int register_android_server_SensorService(JNIEnv* env); |
| 12 | int register_android_server_SystemServer(JNIEnv* env); |
| 13 | }; |
| 14 | |
| 15 | using namespace android; |
| 16 | |
| 17 | extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved) |
| 18 | { |
| 19 | JNIEnv* env = NULL; |
| 20 | jint result = -1; |
| 21 | |
| 22 | if (vm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) { |
| 23 | LOGE("GetEnv failed!"); |
| 24 | return result; |
| 25 | } |
| 26 | LOG_ASSERT(env, "Could not retrieve the env!"); |
| 27 | |
| 28 | register_android_server_KeyInputQueue(env); |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 29 | register_android_server_HardwareService(env); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 30 | register_android_server_AlarmManagerService(env); |
| 31 | register_android_server_BatteryService(env); |
| 32 | register_android_server_SensorService(env); |
| 33 | register_android_server_SystemServer(env); |
| 34 | |
| 35 | return JNI_VERSION_1_4; |
| 36 | } |