android.app.cts.SystemFeaturesTest#testSensorFeatures fail
junit.framework.AssertionFailedError: PackageManager#hasSystemFeature(android.hardware.sensor.compass) returns true but SensorManager#getSensorList(2) shows sensors [] expected:<true> but was:<false>
解决方案
无compass
device\qcom\msm8909go\msm8909go.mk
# Feature definition files for msm8909go
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:system/etc/permissions/android.hardware.sensor.accelerometer.xml \
删除 frameworks/native/data/etc/android.hardware.sensor.compass.xml:system/etc/permissions/android.hardware.sensor.compass.xml \
frameworks\native\data\etc\tablet_core_hardware.xml
或
frameworks\native\data\etc\handheld_core_hardware.xml
注释掉相关的项目
<!-- <feature name="android.hardware.sensor.compass" /> -->
./device/qcom/common/base.mk
注释掉相关的项目
frameworks/native/data/etc/android.hardware.sensor.proximity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.proximity.xml \
frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.light.xml \
android.app.cts.SystemFeaturesTest#testSensorFeatures FAIL
junit.framework.AssertionFailedError: PackageManager#hasSystemFeature(android.hardware.sensor.light) returns true but SensorManager#getSensorList(5) shows sensors [] expected:<true> but was:<false>
原因:手机无光感
解决方法:去除..\mediatek\config\{PROJECT}\android.hardware.sensor.light.xml及
android.hardware.sensor.proximity.xml文件中相应选项
gsenor proximity 类似。