Merge "Allow CDM version v19 or later" into main

This commit is contained in:
Kyle Zhang
2024-04-02 17:58:25 +00:00
committed by Android (Google) Code Review
2 changed files with 36 additions and 5 deletions

View File

@@ -137,4 +137,22 @@ public class ForceSwSecureCryptoFallbackPreferenceControllerTest {
assumeNoException(ex);
}
}
@Test
public void updateState_checkWhenWidevineReady() throws Exception {
try (MediaDrm drm = new MediaDrm(WIDEVINE_UUID)) {
if (drm.getPropertyString("securityLevel").equals("L1")) {
String version = drm.getPropertyString(MediaDrm.PROPERTY_VERSION);
mSetFlagsRule.enableFlags(Flags.FLAG_FORCE_L3_ENABLED);
mController.updateState(mPreference);
if (Integer.parseInt(version.split("\\.", 2)[0]) >= 19) {
assertThat(mPreference.isEnabled()).isTrue();
} else {
assertThat(mPreference.isEnabled()).isFalse();
}
}
} catch (UnsupportedSchemeException ex) {
assumeNoException(ex);
}
}
}