sensorservice can now be ran standalone

Change-Id: I6e757f31f1e020046038e5ab84e71b8689a0aed3
This commit is contained in:
Mathias Agopian
2011-05-26 21:52:39 -07:00
parent a860764402
commit c12b7ba81e
3 changed files with 49 additions and 2 deletions

View File

@@ -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)

View File

@@ -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;
}

View File

@@ -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