[Cts-Verifier]waiver-Camera-ITS-Test

2019/04/10 10:10
阅读数 54

【问题描述】

工具:Cts-Verifier-9.0-R11.apk 测试Camera ITS Test时,点击该测试项后verifier apk闪退。重新打开后该项未pass变绿。

【问题结论】

###AuthBlog:秋城https://www.cnblogs.com/houser0323
最新结论:是waiver项。
拿到了Google-waiver id:https://partnerissuetracker.corp.google.com/issues/150153190
怀疑verifier工具问题
r8工具没问题,r11有问题。 r11工具在送测成功的盒子也有问题。

【分析详细】

1.crash日志:

03-04 14:34:36.977  8091  8091 D AndroidRuntime: Shutting down VM
--------- beginning of crash
03-04 14:34:36.987  8091  8091 E AndroidRuntime: FATAL EXCEPTION: main
03-04 14:34:36.987  8091  8091 E AndroidRuntime: Process: com.android.cts.verifier, PID: 8091
03-04 14:34:36.987  8091  8091 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.cts.verifier/com.android.cts.verifier.camera.its.ItsTestActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.android.cts.verifier.TestListAdapter.getCount()' on a null object reference
。。。。。。
03-04 14:34:36.987  8091  8091 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.android.cts.verifier.TestListAdapter.getCount()' on a null object reference
03-04 14:34:36.987  8091  8091 E AndroidRuntime:        at com.android.cts.verifier.PassFailButtons$TestListActivity.getHistoryCollection(PassFailButtons.java:294)
03-04 14:34:36.987  8091  8091 E AndroidRuntime:        at com.android.cts.verifier.PassFailButtons$TestListActivity.setTestResultAndFinish(PassFailButtons.java:282)
03-04 14:34:36.987  8091  8091 E AndroidRuntime:        at com.android.cts.verifier.camera.its.ItsTestActivity.onCreate(ItsTestActivity.java:347)
03-04 14:34:36.987  8091  8091 E AndroidRuntime:        at android.app.Activity.performCreate(Activity.java:7144)
03-04 14:34:36.987  8091  8091 E AndroidRuntime:        at android.app.Activity.performCreate(Activity.java:7135)
03-04 14:34:36.987  8091  8091 E AndroidRuntime:        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
03-04 14:34:36.987  8091  8091 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2894)
03-04 14:34:36.987  8091  8091 E AndroidRuntime:        ... 11 more
03-04 14:34:37.000  3184  4971 W ActivityManager:   Force finishing activity com.android.cts.verifier/.camera.its.ItsTestActivity
03-04 14:34:37.003  3184  4971 W ActivityManager:   Force finishing activity com.android.cts.verifier/.CtsVerifierActivity
03-04 14:34:37.009  2988  3123 W libc    : Unable to set property "sys.vsync.type" to "": error code: 0x18
03-04 14:34:37.010  8091  8091 I Process : Sending signal. PID: 8091 SIG: 9

2.比较追溯源码
经对比,r8不会crash。r8工具与r11工具的代码有差异,新增了一个函数调用getHistoryCollection()

camera/its/ItsTestActivity.java +347
342         if (mToBeTestedCameraIds.size() == 0) {
343             showToast(R.string.all_exempted_devices);
344             ItsTestActivity.this.getReportLog().setSummary(
345                     "PASS: all cameras on this device are exempted from ITS"
346                     , 1.0, ResultType.NEUTRAL, ResultUnit.NONE);//该语句表明测试已经pass。crash出现在下一句,与测试逻辑无关,是apk自身代码有问题。
347             setTestResultAndFinish(true);//
348         }

=============================================
ItsTestActivity.java:347
@@ -171,25 +160,19 @@
         @Override
         public void setTestResultAndFinish(boolean passed) {
             PassFailButtons.setTestResultAndFinishHelper(
+                    this, getTestId(), getTestDetails(), passed, getReportLog(),
+                    getHistoryCollection());//增加了最后一个参数,是函数的调用返回值。
-                    this, getTestId(), getTestDetails(), passed, getReportLog());
         }

=============================================
PassFailButtons.java:294
288         /**
289          * Get existing test history to aggregate.
290          */
291         @Override
292         public TestResultHistoryCollection getHistoryCollection() {
293             List<TestResultHistoryCollection> histories =
294                 IntStream.range(0, mAdapter.getCount())//由于mAdapter是null,所以空指针异常crash了。  
295                 .mapToObj(mAdapter::getHistoryCollection)
296                 .collect(Collectors.toList());

如上294,测试apk的代码有问题,所以空指针异常crash了。

原文出处:https://www.cnblogs.com/houser0323/p/12430514.html

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部