GTS7.0-R3 GtsSettingsTestCases com.google.android.settings.gts.MADAComplianceTest#testMADACompliance

armeabi-v7a GtsSettingsTestCases
TestResultDetails
com.google.android.settings.gts.MADAComplianceTest#testMADACompliance

fail

java.lang.RuntimeException: Android 5.0 and newer GMS Devices MUST expose the Android security patch level in the Settings UI. It MUST be displayed below the Android version item in the 'About …' section. The displayed text MUST match the value of the system property ro.build.version.security_patch, which MUST be in the format 'YYYY-MM-DD' according to the CDD section 3.2.2. Build Parameters.Please see the following for details: https://support.google.com/androidpartners_gms/answer/7351400?hl=en&ref_topic=9252245

arm64-v8a GtsSettingsTestCases
TestResultDetails
com.google.android.settings.gts.MADAComplianceTest#testMADACompliance

fail

java.lang.RuntimeException: Android 5.0 and newer GMS Devices MUST expose the Android security patch level in the Settings UI. It MUST be displayed below the Android version item in the 'About …' section. The displayed text MUST match the value of the system property ro.build.version.security_patch, which MUST be in the format 'YYYY-MM-DD' according to the CDD section 3.2.2. Build Parameters.Please see the following for details: https://support.google.com/androidpartners_gms/answer/7351400?hl=en&ref_topic=9252245

 12-25 17:11:21 I/ModuleListener: [1/1] com.google.android.settings.gts.MADAComplianceTest#testMADACompliance fail:
java.lang.RuntimeException: Android 5.0 and newer GMS Devices MUST expose the Android security patch level in the Settings UI. It MUST be displayed below the Android version item in the 'About …' section. The displayed text MUST match the value of the system property ro.build.version.security_patch, which MUST be in the format 'YYYY-MM-DD' according to the CDD section 3.2.2. Build Parameters.Please see the following for details: https://support.google.com/androidpartners_gms/answer/7351400?hl=en&ref_topic=9252245
    at org.junit.Assert.fail(Assert.java:88)
    at com.android.compatibility.common.util.BusinessLogicTestCase.failTest(BusinessLogicTestCase.java:123)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.compatibility.common.util.BusinessLogicExecutor$ResolvedMethod.invoke(BusinessLogicExecutor.java:220)
    at com.android.compatibility.common.util.BusinessLogicExecutor.invokeMethod(BusinessLogicExecutor.java:145)
    at com.android.compatibility.common.util.BusinessLogicExecutor.executeAction(BusinessLogicExecutor.java:72)

从报错看security patch必须要显示成'YYYY-MM-DD'的格式

在GTS工具中的testcase文件夹中找到GtsSettingsTestCases.apks(测试的代码一般是以模块命名的apk或jar包),GTS反编译后的测试代码如下:

 public boolean checkSecurityPatchDisplay(String[] spKeywords) throws UiObjectNotFoundException, InterruptedException, IOException, RemoteException {

        boolean bOK = true;

        UiDevice device = UiDevice.getInstance(BusinessLogicTestCase.getInstrumentation());

        setup();

        PackageManager pm = this.mContext.getPackageManager();

        if (Build.VERSION.SDK_INT < 21 || pm.hasSystemFeature(FeatureUtil.WATCH_FEATURE)) {

            return true;

        }

        execute("am start --activity-clear-task -a android.settings.DEVICE_INFO_SETTINGS");

        device.waitForIdle();

        if (!checkSecurityPatchCore(spKeywords)) {

            if (settingExists("About phone", true)) {        //检查是否有About phone 菜单

                return checkSecurityPatchCore(spKeywords);   // 如果有About phone,就在里面检查Android security patch level 菜单

            }

            bOK = false;

        }

        return bOK;

    }

 

从测试现象看,About phone里面有两个Android security patch level 菜单,所以测试的时候不知道选哪一个,卡着不会往下走,导致fail

解决方案:

将其中一个Android security patch level 菜单从About phone中移到别的地方,或者去掉。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值