From 4562c781edf5e3223b2f16ba41e2ff5bb8248d0e Mon Sep 17 00:00:00 2001 From: ibaker Date: Mon, 2 Sep 2024 09:31:47 -0700 Subject: [PATCH] Update `minSdk` values in `UtilTest` These were missed when upgrading to both SDK 19 and 21, but they now cause failures like: ``` Caused by: java.lang.RuntimeException: Failed to parse package buildout/intermediates/apk_for_local_test/debugUnitTest/packageDebugUnitTestForUnitTest/apk-for-local-test.ap_: buildout/intermediates/apk_for_local_test/debugUnitTest/packageDebugUnitTestForUnitTest/apk-for-local-test.ap_ (at Binary XML file line #20): Requires newer sdk version #21 (current version is #19) at org.robolectric.shadows.ShadowPackageParser.callParsePackage(ShadowPackageParser.java:61) ... 20 more ``` #cherrypick PiperOrigin-RevId: 670241471 --- .../test/java/androidx/media3/common/util/UtilTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/common/src/test/java/androidx/media3/common/util/UtilTest.java b/libraries/common/src/test/java/androidx/media3/common/util/UtilTest.java index 9888c1dc87..b076c50565 100644 --- a/libraries/common/src/test/java/androidx/media3/common/util/UtilTest.java +++ b/libraries/common/src/test/java/androidx/media3/common/util/UtilTest.java @@ -1570,7 +1570,7 @@ public class UtilTest { } @Test - @Config(minSdk = 16) // Specifies the minimum SDK to enforce the test to run with all API levels. + @Config(minSdk = 21) // Specifies the minimum SDK to enforce the test to run with all API levels. public void contentEquals_sparseArraysWithEqualContent_returnsTrue() { SparseArray sparseArray1 = new SparseArray<>(); sparseArray1.put(1, 2); @@ -1583,7 +1583,7 @@ public class UtilTest { } @Test - @Config(minSdk = 16) // Specifies the minimum SDK to enforce the test to run with all API levels. + @Config(minSdk = 21) // Specifies the minimum SDK to enforce the test to run with all API levels. public void contentEquals_sparseArraysWithDifferentContents_returnsFalse() { SparseArray sparseArray1 = new SparseArray<>(); sparseArray1.put(1, 2); @@ -1599,7 +1599,7 @@ public class UtilTest { } @Test - @Config(minSdk = 16) // Specifies the minimum SDK to enforce the test to run with all API levels. + @Config(minSdk = 21) // Specifies the minimum SDK to enforce the test to run with all API levels. public void contentHashCode_sparseArraysWithEqualContent_returnsEqualContentHashCode() { SparseArray sparseArray1 = new SparseArray<>(); sparseArray1.put(1, 2); @@ -1612,7 +1612,7 @@ public class UtilTest { } @Test - @Config(minSdk = 16) // Specifies the minimum SDK to enforce the test to run with all API levels. + @Config(minSdk = 21) // Specifies the minimum SDK to enforce the test to run with all API levels. public void contentHashCode_sparseArraysWithDifferentContent_returnsDifferentContentHashCode() { // In theory this is not guaranteed though, adding this test to ensure a sensible // contentHashCode implementation.