Skip to content

Commit c3b4af1

Browse files
committed
fix #39 accept http image uri
1 parent 8bc91ef commit c3b4af1

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

mediacontroller/src/main/java/com/example/android/mediacontroller/testing/MediaAppTestDetails.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ class CheckBrowseDepth(override val test: Test,
11961196

11971197
/**
11981198
* PASS: The artwork of each media item must be passed as a local URI and not a bitmap.
1199-
* The schema of the URI must be either SCHEME_CONTENT or SCHEME_ANDROID_RESOURCE.
1199+
* The schema of the URI must be either SCHEME_CONTENT or SCHEME_ANDROID_RESOURCE or https.
12001200
* FAIL: Otherwise
12011201
*/
12021202
@RequiresApi(Build.VERSION_CODES.N)
@@ -1228,9 +1228,10 @@ class CheckMediaArtwork(override val test: Test,
12281228
future.complete(FAIL_ICONBITMAP_NON_NULL)
12291229
}
12301230

1231-
// local URI schema must be content or android resource
1231+
// URI schema must be content or android resource or https
12321232
if (it.description.iconUri?.scheme != ContentResolver.SCHEME_ANDROID_RESOURCE &&
1233-
it.description.iconUri?.scheme != ContentResolver.SCHEME_CONTENT) {
1233+
it.description.iconUri?.scheme != ContentResolver.SCHEME_CONTENT &&
1234+
it.description.iconUri?.scheme != "https") {
12341235
future.complete(FAIL_INVALID_URI_SCHEMA)
12351236
}
12361237
}

mediacontroller/src/main/res/values/testing_strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
<string name="test_playing_state">Current playback state is in a playing statestring>
196196
<string name="test_browsable_items">Tree root must have at most 4 browsable itemsstring>
197197
<string name="test_root_items_type">Items at tree root must be all browsable or playablestring>
198-
<string name="test_artwork_type_invalid_schema">Artwork URI schema must be SCHEME_CONTENT or SCHEME_ANDROID_RESOURCEstring>
198+
<string name="test_artwork_type_invalid_schema">Artwork URI schema must be SCHEME_CONTENT or SCHEME_ANDROID_RESOURCE or httpsstring>
199199
<string name="test_artwork_type_non_null_icon">Artwork must not be a bitmapstring>
200200
<string name="test_content_style">This app supports content stylingstring>
201201
<string name="test_tree_depth">Tree maximum depth must be at most 3string>

0 commit comments

Comments
 (0)