[RESTRICT AUTOMERGE] Updated CTS test for Android Security b/65540999
Bug: 65540999
Bug: 68653380
Test: Ran the new testcase on android-8.0.0_r2 (version without patch) and
on android-8.0.0_r30 (version with patch)
Change-Id: Ib26d8d3098d0fedb88a73c7e7d4321897b36fe34
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/TestMedia.java b/hostsidetests/securitybulletin/src/android/security/cts/TestMedia.java
index 7390abc..1483d77 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/TestMedia.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/TestMedia.java
@@ -25,6 +25,7 @@
import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
import static org.junit.Assert.*;
+import junit.framework.Assert;
@RunWith(DeviceJUnit4ClassRunner.class)
public class TestMedia extends SecurityTestCase {
@@ -151,15 +152,8 @@
if (cmdOut.length() > 0) {
String[] segment = cmdOut.split("\\s+");
if (segment.length > 1) {
- int gid = -1;
- if ((segment[1]).length() < Integer.toString(Integer.MAX_VALUE).length()) {
- try {
- gid = Integer.parseInt(segment[1]);
- } catch (NumberFormatException e) {
- }
- }
- if (gid == 0) {
- fail("mediametrics has root group id");
+ if (segment[1].trim().equals("0")) {
+ Assert.fail("mediametrics has root group id");
}
}
}