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); |
Jeff Brown | 928e054 | 2011-01-10 11:17:36 -0800 | [diff] [blame] | 9 | int register_android_server_InputApplication(JNIEnv* env); |
| 10 | int register_android_server_InputApplicationHandle(JNIEnv* env); |
| 11 | int register_android_server_InputWindow(JNIEnv* env); |
| 12 | int register_android_server_InputWindowHandle(JNIEnv* env); |
Jeff Brown | 46b9ac0 | 2010-04-22 18:58:52 -0700 | [diff] [blame] | 13 | int register_android_server_InputManager(JNIEnv* env); |
Mike Lockwood | 3a32213 | 2009-11-24 00:30:52 -0500 | [diff] [blame] | 14 | int register_android_server_LightsService(JNIEnv* env); |
Jeff Brown | 00fa7bd | 2010-07-02 15:37:36 -0700 | [diff] [blame] | 15 | int register_android_server_PowerManagerService(JNIEnv* env); |
Mike Lockwood | e7d511e | 2010-12-30 13:39:37 -0500 | [diff] [blame] | 16 | int register_android_server_UsbService(JNIEnv* env); |
Mike Lockwood | 3a32213 | 2009-11-24 00:30:52 -0500 | [diff] [blame] | 17 | int register_android_server_VibratorService(JNIEnv* env); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 18 | int register_android_server_SystemServer(JNIEnv* env); |
Mike Lockwood | 00b7427 | 2010-03-26 10:41:48 -0400 | [diff] [blame] | 19 | int register_android_server_location_GpsLocationProvider(JNIEnv* env); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 20 | }; |
| 21 | |
| 22 | using namespace android; |
| 23 | |
| 24 | extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved) |
| 25 | { |
| 26 | JNIEnv* env = NULL; |
| 27 | jint result = -1; |
| 28 | |
| 29 | if (vm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) { |
| 30 | LOGE("GetEnv failed!"); |
| 31 | return result; |
| 32 | } |
| 33 | LOG_ASSERT(env, "Could not retrieve the env!"); |
| 34 | |
Jeff Brown | 00fa7bd | 2010-07-02 15:37:36 -0700 | [diff] [blame] | 35 | register_android_server_PowerManagerService(env); |
Jeff Brown | 928e054 | 2011-01-10 11:17:36 -0800 | [diff] [blame] | 36 | register_android_server_InputApplication(env); |
| 37 | register_android_server_InputApplicationHandle(env); |
| 38 | register_android_server_InputWindow(env); |
| 39 | register_android_server_InputWindowHandle(env); |
Jeff Brown | 46b9ac0 | 2010-04-22 18:58:52 -0700 | [diff] [blame] | 40 | register_android_server_InputManager(env); |
Mike Lockwood | 3a32213 | 2009-11-24 00:30:52 -0500 | [diff] [blame] | 41 | register_android_server_LightsService(env); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 42 | register_android_server_AlarmManagerService(env); |
| 43 | register_android_server_BatteryService(env); |
Mike Lockwood | e7d511e | 2010-12-30 13:39:37 -0500 | [diff] [blame] | 44 | register_android_server_UsbService(env); |
Mike Lockwood | 3a32213 | 2009-11-24 00:30:52 -0500 | [diff] [blame] | 45 | register_android_server_VibratorService(env); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 46 | register_android_server_SystemServer(env); |
Mike Lockwood | 00b7427 | 2010-03-26 10:41:48 -0400 | [diff] [blame] | 47 | register_android_server_location_GpsLocationProvider(env); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 48 | |
| 49 | return JNI_VERSION_1_4; |
| 50 | } |