diff options
author | Mathias Agopian <mathias@google.com> | 2011-05-26 21:52:39 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2011-05-27 16:35:11 -0700 |
commit | c12b7ba81ec3b486f21394810d827258ba888ee4 (patch) | |
tree | 5de67d889b0084a54ec5678636d8b5bd3ec22888 | |
parent | a8607644026b5cd0860a897e80e491de41b64232 (diff) | |
download | frameworks_base-c12b7ba81ec3b486f21394810d827258ba888ee4.zip frameworks_base-c12b7ba81ec3b486f21394810d827258ba888ee4.tar.gz frameworks_base-c12b7ba81ec3b486f21394810d827258ba888ee4.tar.bz2 |
sensorservice can now be ran standalone
Change-Id: I6e757f31f1e020046038e5ab84e71b8689a0aed3
-rw-r--r-- | cmds/sensorservice/Android.mk | 19 | ||||
-rw-r--r-- | cmds/sensorservice/main_sensorservice.cpp | 25 | ||||
-rw-r--r-- | cmds/system_server/library/system_init.cpp | 7 |
3 files changed, 49 insertions, 2 deletions
diff --git a/cmds/sensorservice/Android.mk b/cmds/sensorservice/Android.mk new file mode 100644 index 0000000..0811be5 --- /dev/null +++ b/cmds/sensorservice/Android.mk @@ -0,0 +1,19 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES:= \ + main_sensorservice.cpp + +LOCAL_SHARED_LIBRARIES := \ + libsensorservice \ + libbinder \ + libutils + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/../../services/sensorservice + +LOCAL_MODULE_TAGS := optional + +LOCAL_MODULE:= sensorservice + +include $(BUILD_EXECUTABLE) diff --git a/cmds/sensorservice/main_sensorservice.cpp b/cmds/sensorservice/main_sensorservice.cpp new file mode 100644 index 0000000..8610627 --- /dev/null +++ b/cmds/sensorservice/main_sensorservice.cpp @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <binder/BinderService.h> +#include <SensorService.h> + +using namespace android; + +int main(int argc, char** argv) { + SensorService::publishAndJoinThreadPool(); + return 0; +} diff --git a/cmds/system_server/library/system_init.cpp b/cmds/system_server/library/system_init.cpp index b615764..a19711e 100644 --- a/cmds/system_server/library/system_init.cpp +++ b/cmds/system_server/library/system_init.cpp @@ -70,8 +70,11 @@ extern "C" status_t system_init() SurfaceFlinger::instantiate(); } - // Start the sensor service - SensorService::instantiate(); + property_get("system_init.startsensorservice", propBuf, "1"); + if (strcmp(propBuf, "1") == 0) { + // Start the sensor service + SensorService::instantiate(); + } // On the simulator, audioflinger et al don't get started the // same way as on the device, and we need to start them here |