blob: 469e8181c53344d53d3d9e615c1ba4f4f1599a7a [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);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080037};
38
39using namespace android;
40
41extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved)
42{
43 JNIEnv* env = NULL;
44 jint result = -1;
45
46 if (vm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) {
47 LOGE("GetEnv failed!");
48 return result;
49 }
50 LOG_ASSERT(env, "Could not retrieve the env!");
51
Jeff Brown00fa7bd2010-07-02 15:37:36 -070052 register_android_server_PowerManagerService(env);
Jeff Brown928e0542011-01-10 11:17:36 -080053 register_android_server_InputApplication(env);
54 register_android_server_InputApplicationHandle(env);
55 register_android_server_InputWindow(env);
56 register_android_server_InputWindowHandle(env);
Jeff Brown46b9ac02010-04-22 18:58:52 -070057 register_android_server_InputManager(env);
Mike Lockwood3a322132009-11-24 00:30:52 -050058 register_android_server_LightsService(env);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080059 register_android_server_AlarmManagerService(env);
60 register_android_server_BatteryService(env);
Mike Lockwood46d0adf2011-05-26 10:27:39 -040061 register_android_server_UsbDeviceManager(env);
62 register_android_server_UsbHostManager(env);
Mike Lockwood3a322132009-11-24 00:30:52 -050063 register_android_server_VibratorService(env);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080064 register_android_server_SystemServer(env);
Mike Lockwood00b74272010-03-26 10:41:48 -040065 register_android_server_location_GpsLocationProvider(env);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080066
67 return JNI_VERSION_1_4;
68}