blob: 0c46eee471b97326194e3ecd1b23ea8a0c03d1ea [file] [log] [blame]
James Dong199d1c12011-03-17 11:48:13 -07001/*
2 * Copyright (C) 2009 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080017#include "JNIHelp.h"
18#include "jni.h"
19#include "utils/Log.h"
20#include "utils/misc.h"
21
22namespace android {
23int register_android_server_AlarmManagerService(JNIEnv* env);
24int register_android_server_BatteryService(JNIEnv* env);
Jeff Brown928e0542011-01-10 11:17:36 -080025int register_android_server_InputApplication(JNIEnv* env);
26int register_android_server_InputApplicationHandle(JNIEnv* env);
27int register_android_server_InputWindow(JNIEnv* env);
28int register_android_server_InputWindowHandle(JNIEnv* env);
Jeff Brown46b9ac02010-04-22 18:58:52 -070029int register_android_server_InputManager(JNIEnv* env);
Mike Lockwood3a322132009-11-24 00:30:52 -050030int register_android_server_LightsService(JNIEnv* env);
Jeff Brown00fa7bd2010-07-02 15:37:36 -070031int register_android_server_PowerManagerService(JNIEnv* env);
Mike Lockwoode7d511e2010-12-30 13:39:37 -050032int register_android_server_UsbService(JNIEnv* env);
Mike Lockwood3a322132009-11-24 00:30:52 -050033int register_android_server_VibratorService(JNIEnv* env);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080034int register_android_server_SystemServer(JNIEnv* env);
Mike Lockwood00b74272010-03-26 10:41:48 -040035int register_android_server_location_GpsLocationProvider(JNIEnv* env);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080036};
37
38using namespace android;
39
40extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved)
41{
42 JNIEnv* env = NULL;
43 jint result = -1;
44
45 if (vm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) {
46 LOGE("GetEnv failed!");
47 return result;
48 }
49 LOG_ASSERT(env, "Could not retrieve the env!");
50
Jeff Brown00fa7bd2010-07-02 15:37:36 -070051 register_android_server_PowerManagerService(env);
Jeff Brown928e0542011-01-10 11:17:36 -080052 register_android_server_InputApplication(env);
53 register_android_server_InputApplicationHandle(env);
54 register_android_server_InputWindow(env);
55 register_android_server_InputWindowHandle(env);
Jeff Brown46b9ac02010-04-22 18:58:52 -070056 register_android_server_InputManager(env);
Mike Lockwood3a322132009-11-24 00:30:52 -050057 register_android_server_LightsService(env);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080058 register_android_server_AlarmManagerService(env);
59 register_android_server_BatteryService(env);
Mike Lockwoode7d511e2010-12-30 13:39:37 -050060 register_android_server_UsbService(env);
Mike Lockwood3a322132009-11-24 00:30:52 -050061 register_android_server_VibratorService(env);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080062 register_android_server_SystemServer(env);
Mike Lockwood00b74272010-03-26 10:41:48 -040063 register_android_server_location_GpsLocationProvider(env);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080064
65 return JNI_VERSION_1_4;
66}