[CTS] android.app.cts.SystemFeaturesTest#testSensorFeatures

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 类似。

作者: RESSRC

个人资源站

发表评论

邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据