1、
android.app.cts.SystemFeaturesTest
– testLocationFeatures
fail:
junit.framework.AssertionFailedError: PackageManager#hasSystemFeature should return true for android.hardware.location.gps at junit.framework.Assert.fail(Assert.java:50)
这项fail 会引起 以下fail ,所属一类:
android.location.cts.LocationManagerTest
-- testGetProvider fail junit.framework.AssertionFailedError: Expected: <null> but was: android.location.LocationProvider@c63ffdc at junit.framework.Assert.fail(Assert.java:50)
-- testGetProviders fail junit.framework.AssertionFailedError: expected:<false> but was:<true> at junit.framework.Assert.fail(Assert.java:50)
此项目无gps 修改方法:
step 1:
路径:..\idh.code\frameworks\native\data\etc\android.hardware.location.gps.xml
// 注释 gps 配置
<permissions>
<feature name="android.hardware.location" />
<feature name="android.hardware.location.network" />
- <feature name="android.hardware.location.gps" />
+ <!--<feature name="android.hardware.location.gps" />-->
</permissions>
step 2:
检查android.hardware.location.gps.xml 此文件是否拷贝,如无,请加入
路径:..\idh.code\device\sprd\scx20\common\device.mk
ifeq ($(strip $(MODULES_HAVE_GPS)),yes)
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml \
frameworks/native/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml
else
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/nogps/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml \
frameworks/native/data/etc/nogps/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \
frameworks/native/data/etc/nogps/android.hardware