diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-03-08 08:46:40 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-03-08 08:46:40 +0000 |
commit | 491b5fdf7a025957a67f86c125c9989a88371c6d (patch) | |
tree | fa68b6c8e9cdd948032858312f5144b54e3d5105 | |
parent | 5dedbf78f4975f27f11687544c4aca92b3c9c27f (diff) | |
parent | 1f7b874ee783e9cafeebac91201afb77bd14da34 (diff) | |
download | cts-android12L-platform-release.tar.gz |
Merge cherrypicks of ['googleplex-android-review.googlesource.com/24529771'] into sc-v2-platform-release.android-platform-12.1.0_r27android12L-platform-release
Change-Id: If5e939bcccfbbad5201798729e857f4dace5ab02
-rw-r--r-- | tests/tests/provider/src/android/provider/cts/settings/Settings_SystemTest.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/tests/provider/src/android/provider/cts/settings/Settings_SystemTest.java b/tests/tests/provider/src/android/provider/cts/settings/Settings_SystemTest.java index 2fc25b826e7..19fe9a7ee83 100644 --- a/tests/tests/provider/src/android/provider/cts/settings/Settings_SystemTest.java +++ b/tests/tests/provider/src/android/provider/cts/settings/Settings_SystemTest.java @@ -16,6 +16,8 @@ package android.provider.cts.settings; +import static com.google.common.truth.Truth.assertThat; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -173,6 +175,17 @@ public class Settings_SystemTest { } @Test + @AsbSecurityTest(cveBugId = 227201030) + public void testInvalidRingtoneUriIsRejected() { + final ContentResolver cr = InstrumentationRegistry.getTargetContext().getContentResolver(); + final String originalValue = System.getString(cr, System.RINGTONE); + final String invalidUri = "content://10@media/external/audio/media/1000000019"; + System.putString(cr, System.RINGTONE, invalidUri); + // Assert that the insertion didn't take effect + assertThat(System.getString(cr, System.RINGTONE)).isEqualTo(originalValue); + } + + @Test public void testGetDefaultValues() { final ContentResolver cr = InstrumentationRegistry.getTargetContext().getContentResolver(); |