一些CTS 测试不通过解决方法

android.hardware.camera2.cts.CameraManagerTest
– testCameraManagerGetDeviceIdList

error:System camera feature and camera id list don’t match
the system must have
* the FEATURE_CAMERA_ANY feature.

搜索 FEATURE_CAMERA_ANY
public static final String FEATURE_CAMERA_ANY = “android.hardware.camera.any”;

ids.length == 0 ||
mPackageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA_ANY));
返回为false

public abstract boolean hasSystemFeature(String name);

Returns true if the devices supports the feature,

/frameworks/native/data/etc/*.xml
cd system/etc/pernissions pm list features 会显示设备所有的feature列表
一般在frameworks/base/data/etc 会将*.xml 编进out/system/etc/permissions 下
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions 这个在.mk文件中完成
只要将所需要的feature XML文件编译进去 就可以了

android.hardware.camera2.cts.CaptureRequestTest
– testAeModeAndLock
– testFlashControl
The static info key ‘android.control.aeAvailableModes’ value must contain ON_AUTO_FLASH and ON_ALWAYS_FLASH and when flash isavailable

getAeAvailableModesChecked() //staticMetadate.java log出现位置

public static final String[] AE_MODE_NAMES = new String[] {
“AE_MODE_OFF”,
“AE_MODE_ON”,
“AE_MODE_ON_AUTO_FLASH”,
“AE_MODE_ON_ALWAYS_FLASH”,
“AE_MODE_ON_AUTO_FLASH_REDEYE”
};
Key

你可能感兴趣的:(工作笔记)