sanders: build a 32b version of android.hardware.sensors service
* Also add input group access and add service to manifest
This commit is contained in:
@@ -438,13 +438,12 @@
|
|||||||
</interface>
|
</interface>
|
||||||
</hal>
|
</hal>
|
||||||
<hal format="hidl">
|
<hal format="hidl">
|
||||||
<name>vendor.lineage.power</name>
|
<name>android.hardware.sensors</name>
|
||||||
<transport>hwbinder</transport>
|
<transport>hwbinder</transport>
|
||||||
<version>1.0</version>
|
<version>1.0</version>
|
||||||
<interface>
|
<interface>
|
||||||
<name>ILineagePower</name>
|
<name>ISensors</name>
|
||||||
<instance>default</instance>
|
<instance>default</instance>
|
||||||
</interface>
|
</interface>
|
||||||
</hal>
|
</hal>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
||||||
|
|||||||
@@ -357,6 +357,7 @@ PRODUCT_COPY_FILES += \
|
|||||||
|
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
android.hardware.sensors@1.0-impl \
|
android.hardware.sensors@1.0-impl \
|
||||||
|
android.hardware.sensors@1.0-service_32 \
|
||||||
sensorservice_32
|
sensorservice_32
|
||||||
|
|
||||||
# Shims
|
# Shims
|
||||||
|
|||||||
24
sensorservice_hal/Android.mk
Normal file
24
sensorservice_hal/Android.mk
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
LOCAL_PATH:= $(call my-dir)
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||||
|
LOCAL_PROPRIETARY_MODULE := true
|
||||||
|
LOCAL_MODULE := android.hardware.sensors@1.0-service_32
|
||||||
|
LOCAL_32_BIT_ONLY := true
|
||||||
|
LOCAL_INIT_RC := android.hardware.sensors@1.0-service_32.rc
|
||||||
|
LOCAL_SRC_FILES := \
|
||||||
|
service.cpp \
|
||||||
|
|
||||||
|
LOCAL_SHARED_LIBRARIES := \
|
||||||
|
liblog \
|
||||||
|
libcutils \
|
||||||
|
libdl \
|
||||||
|
libbase \
|
||||||
|
libutils \
|
||||||
|
|
||||||
|
LOCAL_SHARED_LIBRARIES += \
|
||||||
|
libhidlbase \
|
||||||
|
libhidltransport \
|
||||||
|
android.hardware.sensors@1.0 \
|
||||||
|
|
||||||
|
include $(BUILD_EXECUTABLE)
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
service sensors-hal-1-0 /vendor/bin/hw/android.hardware.sensors@1.0-service_32
|
||||||
|
class hal
|
||||||
|
user system
|
||||||
|
group system input wakelock
|
||||||
|
capabilities BLOCK_SUSPEND SYS_NICE
|
||||||
31
sensorservice_hal/service.cpp
Normal file
31
sensorservice_hal/service.cpp
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2016 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define LOG_TAG "android.hardware.sensors@1.0-service"
|
||||||
|
|
||||||
|
#include <android/hardware/sensors/1.0/ISensors.h>
|
||||||
|
#include <hidl/LegacySupport.h>
|
||||||
|
|
||||||
|
using android::hardware::sensors::V1_0::ISensors;
|
||||||
|
using android::hardware::defaultPassthroughServiceImplementation;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
/* Sensors framework service needs at least two threads.
|
||||||
|
* One thread blocks on a "poll"
|
||||||
|
* The second thread is needed for all other HAL methods.
|
||||||
|
*/
|
||||||
|
return defaultPassthroughServiceImplementation<ISensors>(2);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user