blob: 0625544effdce8849d7fde38c0ff4273dde47f2a [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2007 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 */
Jeff Brownef691172013-07-15 13:22:04 -070016
17#include <jni.h>
18#include <JNIHelp.h>
19
20#include <sensorservice/SensorService.h>
21
22#include <cutils/properties.h>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080023#include <utils/Log.h>
24#include <utils/misc.h>
25
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080026namespace android {
27
Jeff Brownef691172013-07-15 13:22:04 -070028static void android_server_SystemServer_nativeInit(JNIEnv* env, jobject clazz) {
29 char propBuf[PROPERTY_VALUE_MAX];
30 property_get("system_init.startsensorservice", propBuf, "1");
31 if (strcmp(propBuf, "1") == 0) {
32 // Start the sensor service
33 SensorService::instantiate();
34 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080035}
36
37/*
38 * JNI registration.
39 */
40static JNINativeMethod gMethods[] = {
41 /* name, signature, funcPtr */
Jeff Brownef691172013-07-15 13:22:04 -070042 { "nativeInit", "()V", (void*) android_server_SystemServer_nativeInit },
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080043};
44
45int register_android_server_SystemServer(JNIEnv* env)
46{
47 return jniRegisterNativeMethods(env, "com/android/server/SystemServer",
48 gMethods, NELEM(gMethods));
49}
50
51}; // namespace android