Accept page index 0 for getChildren() in MediaLibraryServiceLegacyStub

This is consistent with the new MediaSessionStub that accepts page index 0
and the JavaDoc of legacy and new service callbacks.

Issue: androidx/media#32
PiperOrigin-RevId: 431390454
This commit is contained in:
bachinger 2022-02-28 11:03:58 +00:00 committed by Ian Baker
parent 3e9dfaa586
commit 9821dd282c

View file

@ -198,7 +198,7 @@ import java.util.concurrent.atomic.AtomicReference;
try {
int page = options.getInt(EXTRA_PAGE);
int pageSize = options.getInt(EXTRA_PAGE_SIZE);
if (page > 0 && pageSize > 0) {
if (page >= 0 && pageSize > 0) {
// Requesting the list of children through pagination.
@Nullable
LibraryParams params =
@ -223,7 +223,7 @@ import java.util.concurrent.atomic.AtomicReference;
parentId,
/* page= */ 0,
/* pageSize= */ Integer.MAX_VALUE,
/* extras= */ null);
/* params= */ null);
sendLibraryResultWithMediaItemsWhenReady(result, future);
});
}