blob: 9dff48b17067300bf93638775c5278d971866e73 [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 Lockwood46d0adf2011-05-26 10:27:39 -040032int register_android_server_UsbDeviceManager(JNIEnv* env);
33int register_android_server_UsbHostManager(JNIEnv* env);
Mike Lockwood3a322132009-11-24 00:30:52 -050034int register_android_server_VibratorService(JNIEnv* env);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080035int register_android_server_SystemServer(JNIEnv* env);
Mike Lockwood00b74272010-03-26 10:41:48 -040036int register_android_server_location_GpsLocationProvider(JNIEnv* env);
Chia-chi Yehff3bdca2011-05-23 17:26:46 -070037int register_android_server_connectivity_Vpn(JNIEnv* env);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080038};
39
40using namespace android;
41
42extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved)
43{
44 JNIEnv* env = NULL;
45 jint result = -1;
46
47 if (vm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) {
48 LOGE("GetEnv failed!");
49 return result;
50 }
51 LOG_ASSERT(env, "Could not retrieve the env!");
52
Jeff Brown00fa7bd2010-07-02 15:37:36 -070053 register_android_server_PowerManagerService(env);
Jeff Brown928e0542011-01-10 11:17:36 -080054 register_android_server_InputApplication(env);
55 register_android_server_InputApplicationHandle(env);
56 register_android_server_InputWindow(env);
57 register_android_server_InputWindowHandle(env);
Jeff Brown46b9ac02010-04-22 18:58:52 -070058 register_android_server_InputManager(env);
Mike Lockwood3a322132009-11-24 00:30:52 -050059 register_android_server_LightsService(env);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080060 register_android_server_AlarmManagerService(env);
61 register_android_server_BatteryService(env);
Mike Lockwood46d0adf2011-05-26 10:27:39 -040062 register_android_server_UsbDeviceManager(env);
63 register_android_server_UsbHostManager(env);
Mike Lockwood3a322132009-11-24 00:30:52 -050064 register_android_server_VibratorService(env);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080065 register_android_server_SystemServer(env);
Mike Lockwood00b74272010-03-26 10:41:48 -040066 register_android_server_location_GpsLocationProvider(env);
Chia-chi Yehff3bdca2011-05-23 17:26:46 -070067 register_android_server_connectivity_Vpn(env);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080068
69 return JNI_VERSION_1_4;
70}