CTS(14)---Android O CTS 测试之Media相关测试小结(二) Android O CTS 测试之Media相关测试小结(二)

Android O CTS 测试之Media相关测试小结(二)

CtsMediaTestCases

android.media.cts.VideoDecoderPerfTest failed

failed 项:android.media.cts.VideoDecoderPerfTest#testHevcGoog0Perf1280x0720 fail 
failed information:junit.framework.AssertionFailedError: Expected achievable frame rates for OMX.google.hevc.decoder video/hevc 1280x720: [27.0, 27.0].

failed 项:android.media.cts.VideoDecoderPerfTest#testHevcGoog0Perf1920x1080 fail 
failed information:junit.framework.AssertionFailedError: Expected achievable frame rates for OMX.google.hevc.decoder video/hevc 1920x1080: [11.0, 11.0].

对于此类failed项需要多跑几次failed case,找到合适的codec performance limit 的范围.在测试的log中可以找到当时测试时的值 
相应的文件media_codecs_performance.xml在android的system/vendor/etc目录下 
项目代码中的路径是:

qcom/msm8937_32/media/media_codecs_performance_8937.xml
  • 1

这里写图片描述

android.media.cts.AudioManagerTest#testAccessRingMode failed

Android 8.1

FAILED INFRAMATION:

01-02 01:45:09.530  7918  7935 I TestRunner: started: testAccessRingMode(android.media.cts.AudioManagerTest)
01-02 01:45:09.536  7918  7918 I MonitoringInstr: Activities that are still in CREATED to STOPPED: 0
01-02 01:45:09.537  7918  7935 D CtsTestRunListener: Total memory  : 3734112
01-02 01:45:09.537  7918  7935 D CtsTestRunListener: Used memory   : 2450256
01-02 01:45:09.537  7918  7935 D CtsTestRunListener: Free memory   : 1283856
01-02 01:45:09.538  7918  7935 D CtsTestRunListener: java.io.tmpdir is:/data/user/0/android.media.cts/cache
01-02 01:45:09.538  7918  7935 D CtsTestRunListener: About to .exec df
01-02 01:45:09.541  7918  7935 D CtsTestRunListener: .exec returned
01-02 01:45:09.541  7918  7935 D CtsTestRunListener: Stream reader created
01-02 01:45:09.548   300   300 D AudioALSAStreamOut: dump()
01-02 01:45:09.552   300   300 D AudioALSAStreamOut: dump()
01-02 01:45:09.553   300   300 D AudioALSAHardware: dumpState()
01-02 01:45:09.557  7936  7936 W df      : type=1400 audit(0.0:1207): avc: denied { getattr } for path="/vendor/protect_f" dev="mmcblk0p9" ino=2 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:protect_f_data_file:s0 tclass=dir permissive=0 01-02 01:45:09.567 7936 7936 W df : type=1400 audit(0.0:1211): avc: denied { getattr } for path="/dev/block" dev="tmpfs" ino=49 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:block_device:s0 tclass=dir permissive=0
01-02 01:45:09.574  7918  7935 D CtsTestRunListener: Filesystem      1K-blocks    Used Available Use% Mounted on
01-02 01:45:09.575  7918  7935 D CtsTestRunListener: /dev/block/dm-0   5446228 3190812   2222648  59% /data
01-02 01:45:09.575  7918  7935 D CtsTestRunListener: In finally
01-02 01:45:09.575  7918  7935 D CtsTestRunListener: Now executing : android.media.cts.AudioManagerTest
01-02 01:45:09.848   828  1185 W WindowManager: removeWindowToken: Attempted to remove non-existing token: android.os.Binder@e5e85bf
01-02 01:45:09.855   828  3555 V SettingsProvider: name : accelerometer_rotation appId : 1000
01-02 01:45:09.957   828  3555 W WindowManager: removeWindowToken: Attempted to remove non-existing token: android.os.Binder@5f3d7d5
01-02 01:45:09.962   828  1185 V SettingsProvider: name : accelerometer_rotation appId : 1000
01-02 01:45:09.971  7918  7935 I TestRunner: failed: testAccessRingMode(android.media.cts.AudioManagerTest)
01-02 01:45:09.971  7918  7935 I TestRunner: ----- begin exception -----
01-02 01:45:09.972  7918  7935 I TestRunner: junit.framework.AssertionFailedError: Wrote setting should be the same as the read one expected:<true> but was:<false>
01-02 01:45:09.972  7918  7935 I TestRunner:    at junit.framework.Assert.fail(Assert.java:50)
01-02 01:45:09.972  7918  7935 I TestRunner:    at junit.framework.Assert.failNotEquals(Assert.java:287)
01-02 01:45:09.972  7918  7935 I TestRunner:    at junit.framework.Assert.assertEquals(Assert.java:67)
01-02 01:45:09.972  7918  7935 I TestRunner:    at junit.framework.Assert.assertEquals(Assert.java:147)
01-02 01:45:09.972  7918  7935 I TestRunner:    at android.media.cts.Utils.toggleNotificationPolicyAccess(Utils.java:112)
01-02 01:45:09.972  7918  7935 I TestRunner:    at android.media.cts.AudioManagerTest.testAccessRingMode(AudioManagerTest.java:325)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

isNotificationPolicyAccessGranted())返回了false与期望不符合;

protected static void toggleNotificationPolicyAccess(String packageName,
          Instrumentation instrumentation, boolean on) throws IOException {
          ......
          NotificationManager nm = (NotificationManager) instrumentation.getContext()
                  .getSystemService(Context.NOTIFICATION_SERVICE);
          Assert.assertEquals("Wrote setting should be the same as the read one", on,
                  nm.isNotificationPolicyAccessGranted());
    }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

查看:isNotificationPolicyAccessGranted 
最终发现:

         private boolean checkPolicyAccess(String pkg) {
2582              try {
2583                  int uid = getContext().getPackageManager().getPackageUidAsUser(
2584                          pkg, UserHandle.getCallingUserId());
2585                  if (PackageManager.PERMISSION_GRANTED == ActivityManager.checkComponentPermission(
2586                          android.Manifest.permission.MANAGE_NOTIFICATIONS, uid,
2587                          -1, true)) {
2588                      return true;
2589                  }
2590              } catch (NameNotFoundException e) {
2591                  return false;
2592              }
2593              return checkPackagePolicyAccess(pkg) || mListeners.isComponentEnabledForPackage(pkg);
2594          }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

cts media测试没有android.Manifest.permission.MANAGE_NOTIFICATIONS的权限 
最终确认是已知的google issue,向Google申请豁免

同样还有如下类似的failed项 
failed项: 
android.media.cts.AudioManagerTest#testAdjustVolumeInAlarmsOnlyMode fail 
android.media.cts.AudioManagerTest#testAdjustVolumeInTotalSilenceMode fail 
android.media.cts.AudioManagerTest#testSetStreamVolumeInAlarmsOnlyMode fail 
android.media.cts.AudioManagerTest#testSetStreamVolumeInTotalSilenceMode fail

Information: 
java.lang.SecurityException: Notification policy access denied

5604  5622 I TestRunner: failed: testAdjustVolumeInAlarmsOnlyMode(android.media.cts.AudioManagerTest)
01-02 01:30:29.822  5604  5622 I TestRunner: ----- begin exception -----
01-02 01:30:29.825  5604  5622 I TestRunner: java.lang.SecurityException: Notification policy access denied
01-02 01:30:29.825  5604  5622 I TestRunner:    at android.os.Parcel.readException(Parcel.java:2004)
01-02 01:30:29.825  5604  5622 I TestRunner:    at android.os.Parcel.readException(Parcel.java:1950)
01-02 01:30:29.825  5604  5622 I TestRunner:    at android.app.INotificationManager$Stub$Proxy.setInterruptionFilter(INotificationManager.java:2247)
01-02 01:30:29.825  5604  5622 I TestRunner:    at android.app.NotificationManager.setInterruptionFilter(NotificationManager.java:1194)
01-02 01:30:29.825  5604  5622 I TestRunner:    at android.media.cts.AudioManagerTest.setInterruptionFilter(AudioManagerTest.java:919)
01-02 01:30:29.825  5604  5622 I TestRunner:    at android.media.cts.AudioManagerTest.testAdjustVolumeInAlarmsOnlyMode(AudioManagerTest.java:858)
01-02 01:30:29.825  5604  5622 I TestRunner:    at java.lang.reflect.Method.invoke(Native Method)
01-02 01:30:29.825  5604  5622 I TestRunner:    at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:220)
01-02 01:30:29.825  5604  5622 I TestRunner:    at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:205)
01-02 01:30:29.825  5604  5622 I TestRunner:    at junit.framework.TestCase.runBare(TestCase.java:134)
01-02 01:30:29.825  5604  5622 I TestRunner:    at junit.framework.TestResult$1.protect(TestResult.java:115)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

原因: 已知的google issue,向Google申请豁免

猜你喜欢

转载自blog.csdn.net/zhangbijun1230/article/details/80259513