James Dong | 199d1c1 | 2011-03-17 11:48:13 -0700 | [diff] [blame] | 1 | /* |
| 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 Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 17 | #include "JNIHelp.h" |
| 18 | #include "jni.h" |
| 19 | #include "utils/Log.h" |
| 20 | #include "utils/misc.h" |
| 21 | |
| 22 | namespace android { |
| 23 | int register_android_server_AlarmManagerService(JNIEnv* env); |
| 24 | int register_android_server_BatteryService(JNIEnv* env); |
Jeff Brown | 928e054 | 2011-01-10 11:17:36 -0800 | [diff] [blame] | 25 | int register_android_server_InputApplication(JNIEnv* env); |
| 26 | int register_android_server_InputApplicationHandle(JNIEnv* env); |
| 27 | int register_android_server_InputWindow(JNIEnv* env); |
| 28 | int register_android_server_InputWindowHandle(JNIEnv* env); |
Jeff Brown | 46b9ac0 | 2010-04-22 18:58:52 -0700 | [diff] [blame] | 29 | int register_android_server_InputManager(JNIEnv* env); |
Mike Lockwood | 3a32213 | 2009-11-24 00:30:52 -0500 | [diff] [blame] | 30 | int register_android_server_LightsService(JNIEnv* env); |
Jeff Brown | 00fa7bd | 2010-07-02 15:37:36 -0700 | [diff] [blame] | 31 | int register_android_server_PowerManagerService(JNIEnv* env); |
Mike Lockwood | e7d511e | 2010-12-30 13:39:37 -0500 | [diff] [blame] | 32 | int register_android_server_UsbService(JNIEnv* env); |
Mike Lockwood | 3a32213 | 2009-11-24 00:30:52 -0500 | [diff] [blame] | 33 | int register_android_server_VibratorService(JNIEnv* env); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 34 | int register_android_server_SystemServer(JNIEnv* env); |
Mike Lockwood | 00b7427 | 2010-03-26 10:41:48 -0400 | [diff] [blame] | 35 | int register_android_server_location_GpsLocationProvider(JNIEnv* env); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | using namespace android; |
| 39 | |
| 40 | extern "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 Brown | 00fa7bd | 2010-07-02 15:37:36 -0700 | [diff] [blame] | 51 | register_android_server_PowerManagerService(env); |
Jeff Brown | 928e054 | 2011-01-10 11:17:36 -0800 | [diff] [blame] | 52 | register_android_server_InputApplication(env); |
| 53 | register_android_server_InputApplicationHandle(env); |
| 54 | register_android_server_InputWindow(env); |
| 55 | register_android_server_InputWindowHandle(env); |
Jeff Brown | 46b9ac0 | 2010-04-22 18:58:52 -0700 | [diff] [blame] | 56 | register_android_server_InputManager(env); |
Mike Lockwood | 3a32213 | 2009-11-24 00:30:52 -0500 | [diff] [blame] | 57 | register_android_server_LightsService(env); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 58 | register_android_server_AlarmManagerService(env); |
| 59 | register_android_server_BatteryService(env); |
Mike Lockwood | e7d511e | 2010-12-30 13:39:37 -0500 | [diff] [blame] | 60 | register_android_server_UsbService(env); |
Mike Lockwood | 3a32213 | 2009-11-24 00:30:52 -0500 | [diff] [blame] | 61 | register_android_server_VibratorService(env); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 62 | register_android_server_SystemServer(env); |
Mike Lockwood | 00b7427 | 2010-03-26 10:41:48 -0400 | [diff] [blame] | 63 | register_android_server_location_GpsLocationProvider(env); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 64 | |
| 65 | return JNI_VERSION_1_4; |
| 66 | } |