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
17 #include <android/graphics/jni_runtime.h>
18 #include <nativehelper/JNIHelp.h>
19 #include "jni.h"
20 #include "utils/Log.h"
21 #include "utils/misc.h"
22
23 #include "BroadcastRadio/BroadcastRadioService.h"
24 #include "BroadcastRadio/Tuner.h"
25
26 namespace android {
27 int register_android_server_BatteryStatsService(JNIEnv* env);
28 int register_android_server_ConsumerIrService(JNIEnv *env);
29 int register_android_server_InputManager(JNIEnv* env);
30 int register_android_server_LightsService(JNIEnv* env);
31 int register_android_server_PowerManagerService(JNIEnv* env);
32 int register_android_server_PowerStatsService(JNIEnv* env);
33 int register_android_server_HintManagerService(JNIEnv* env);
34 int register_android_server_storage_AppFuse(JNIEnv* env);
35 int register_android_server_SerialService(JNIEnv* env);
36 int register_android_server_SystemServer(JNIEnv* env);
37 int register_android_server_UsbAlsaJackDetector(JNIEnv* env);
38 int register_android_server_UsbDeviceManager(JNIEnv* env);
39 int register_android_server_UsbMidiDevice(JNIEnv* env);
40 int register_android_server_UsbHostManager(JNIEnv* env);
41 int register_android_server_vr_VrManagerService(JNIEnv* env);
42 int register_android_server_vibrator_VibratorController(JavaVM* vm, JNIEnv* env);
43 int register_android_server_vibrator_VibratorManagerService(JavaVM* vm, JNIEnv* env);
44 int register_android_server_location_GnssLocationProvider(JNIEnv* env);
45 int register_android_server_connectivity_Vpn(JNIEnv* env);
46 int register_android_server_devicepolicy_CryptoTestHelper(JNIEnv*);
47 int register_android_server_tv_TvUinputBridge(JNIEnv* env);
48 int register_android_server_tv_TvInputHal(JNIEnv* env);
49 int register_android_server_PersistentDataBlockService(JNIEnv* env);
50 int register_android_server_Watchdog(JNIEnv* env);
51 int register_android_server_HardwarePropertiesManagerService(JNIEnv* env);
52 int register_android_server_SyntheticPasswordManager(JNIEnv* env);
53 int register_android_hardware_display_DisplayViewport(JNIEnv* env);
54 int register_android_server_net_NetworkStatsFactory(JNIEnv* env);
55 int register_android_server_net_NetworkStatsService(JNIEnv* env);
56 int register_android_server_am_CachedAppOptimizer(JNIEnv* env);
57 int register_android_server_am_LowMemDetector(JNIEnv* env);
58 int register_com_android_server_soundtrigger_middleware_AudioSessionProviderImpl(JNIEnv* env);
59 int register_com_android_server_soundtrigger_middleware_ExternalCaptureStateTracker(JNIEnv* env);
60 int register_android_server_com_android_server_pm_PackageManagerShellCommandDataLoader(JNIEnv* env);
61 int register_android_server_AdbDebuggingManager(JNIEnv* env);
62 int register_android_server_FaceService(JNIEnv* env);
63 int register_android_server_GpuService(JNIEnv* env);
64 int register_android_server_stats_pull_StatsPullAtomService(JNIEnv* env);
65 int register_android_server_sensor_SensorService(JavaVM* vm, JNIEnv* env);
66 };
67
68 using namespace android;
69
JNI_OnLoad(JavaVM * vm,void *)70 extern "C" jint JNI_OnLoad(JavaVM* vm, void* /* reserved */)
71 {
72 JNIEnv* env = NULL;
73 jint result = -1;
74
75 if (vm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) {
76 ALOGE("GetEnv failed!");
77 return result;
78 }
79 ALOG_ASSERT(env, "Could not retrieve the env!");
80
81 register_android_server_broadcastradio_BroadcastRadioService(env);
82 register_android_server_broadcastradio_Tuner(vm, env);
83 register_android_server_PowerManagerService(env);
84 register_android_server_PowerStatsService(env);
85 register_android_server_HintManagerService(env);
86 register_android_server_SerialService(env);
87 register_android_server_InputManager(env);
88 register_android_server_LightsService(env);
89 register_android_server_UsbDeviceManager(env);
90 register_android_server_UsbMidiDevice(env);
91 register_android_server_UsbAlsaJackDetector(env);
92 register_android_server_UsbHostManager(env);
93 register_android_server_vr_VrManagerService(env);
94 register_android_server_vibrator_VibratorController(vm, env);
95 register_android_server_vibrator_VibratorManagerService(vm, env);
96 register_android_server_SystemServer(env);
97 register_android_server_location_GnssLocationProvider(env);
98 register_android_server_connectivity_Vpn(env);
99 register_android_server_devicepolicy_CryptoTestHelper(env);
100 register_android_server_ConsumerIrService(env);
101 register_android_server_BatteryStatsService(env);
102 register_android_server_tv_TvUinputBridge(env);
103 register_android_server_tv_TvInputHal(env);
104 register_android_server_PersistentDataBlockService(env);
105 register_android_server_HardwarePropertiesManagerService(env);
106 register_android_server_storage_AppFuse(env);
107 register_android_server_SyntheticPasswordManager(env);
108 register_android_graphics_GraphicsStatsService(env);
109 register_android_hardware_display_DisplayViewport(env);
110 register_android_server_net_NetworkStatsFactory(env);
111 register_android_server_net_NetworkStatsService(env);
112 register_android_server_am_CachedAppOptimizer(env);
113 register_android_server_am_LowMemDetector(env);
114 register_com_android_server_soundtrigger_middleware_AudioSessionProviderImpl(env);
115 register_com_android_server_soundtrigger_middleware_ExternalCaptureStateTracker(env);
116 register_android_server_com_android_server_pm_PackageManagerShellCommandDataLoader(env);
117 register_android_server_AdbDebuggingManager(env);
118 register_android_server_FaceService(env);
119 register_android_server_GpuService(env);
120 register_android_server_stats_pull_StatsPullAtomService(env);
121 register_android_server_sensor_SensorService(vm, env);
122 return JNI_VERSION_1_4;
123 }
124