/** * Check if device supports Vulkan. */ private boolean isSupportedVulkan () throws DeviceNotAvailableException, CapabilityQueryFailureException { final Set features = getDeviceFeatures(mDevice);
for (String feature : features) { if (feature.startsWith(FEATURE_VULKAN_LEVEL)) { return true; } }
return false; }
/** * Return feature set supported by the device */ private Set getDeviceFeatures(ITestDevice device) throws DeviceNotAvailableException, CapabilityQueryFailureException { if (mDeviceFeatures == null) { mDeviceFeatures = queryDeviceFeatures(device); } return mDeviceFeatures; }
/** * Query feature set supported by the device */ private static Set queryDeviceFeatures(ITestDevice device) throws DeviceNotAvailableException, CapabilityQueryFailureException { // NOTE: Almost identical code in BaseDevicePolicyTest#hasDeviceFeatures // TODO: Move this logic to ITestDevice. String command = "pm list features"; String commandOutput = device.executeShellCommand(command);
// Extract the id of the new user. HashSet availableFeatures = new HashSet<>(); for (String feature: commandOutput.split("\\s+")) { // Each line in the output of the command has the format "feature:{FEATURE_VALUE}". String[] tokens = feature.split(":"); if (tokens.length < 2 || !"feature".equals(tokens[0])) { CLog.e("Failed parse features. Unexpect format on line \"%s\"", tokens[0]); throw new CapabilityQueryFailureException(); } availableFeatures.add(tokens[1]); } return availableFeatures; }
通过pm list features来获取device支持的fearture,在fail的机器上我们执行该命令得到的结果包含了:
feature:android.hardware.vulkan.compute
feature:android.hardware.vulkan.level
feature:android.hardware.vulkan.version=4194307
导致
if (!isSupportedApi || mCollectTestsOnly) { // Pass all tests if OpenGL ES version is not supported or we are collecting // the names of the tests only fakePassTests(listener); } else if (!mRemainingTests.isEmpty()) { // Make sure there is no pre-existing package form earlier interrupted test run. uninstallTestApk(); installTestApk();
"msm8909") case "$soc_hwplatform" in *) setprop persist.graphics.vulkan.disable true setprop ro.opengles.version 196608 ;; esac ;;
//Remove vulkan specific features if (SystemProperties.getBoolean("persist.graphics.vulkan.disable", false)) { removeFeature(PackageManager.FEATURE_VULKAN_HARDWARE_LEVEL); removeFeature(PackageManager.FEATURE_VULKAN_HARDWARE_VERSION); removeFeature(PackageManager.FEATURE_VULKAN_HARDWARE_COMPUTE); }
但pm list features是读取/vendor/etc/permission/下的文件来确定feature的,查看fail的机器再该目录下有如下文件;
android.hardware.vulkan.compute-0.xml
android.hardware.vulkan.level-0.xml
android.hardware.vulkan.version-1_0_3.xml
所以得到结果isSupportedVulkan返回true.
所以解决方法就是系统不要copy上面三个文件到/vendor/etc/permission/即可,这样CtsDeqpTestCases就会fakePassTests,跳过了对vulkan的测试。高通平台是通过TARGET_NOT_SUPPORT_VULKAN 这个值来决定是否copyvulkan相关的文件到vendor下。
Create the Google Play Account
Having a Google account, pay 25$, then you get your google developer account.
References:
http://developer.android.com/distribute/googleplay/start.html
https://p