blob: 26200d35040f6113280ea97b148beb5043cc638e [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001#include "JNIHelp.h"
2#include "jni.h"
3#include "utils/Log.h"
4#include "utils/misc.h"
5
6namespace android {
7int register_android_server_AlarmManagerService(JNIEnv* env);
8int register_android_server_BatteryService(JNIEnv* env);
9int register_android_server_KeyInputQueue(JNIEnv* env);
The Android Open Source Project10592532009-03-18 17:39:46 -070010int register_android_server_HardwareService(JNIEnv* env);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080011int register_android_server_SensorService(JNIEnv* env);
12int register_android_server_SystemServer(JNIEnv* env);
13};
14
15using namespace android;
16
17extern "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 Project10592532009-03-18 17:39:46 -070029 register_android_server_HardwareService(env);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080030 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}