Commit 9821dd28 by bachinger Committed by Ian Baker

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
parent 3e9dfaa5
...@@ -198,7 +198,7 @@ import java.util.concurrent.atomic.AtomicReference; ...@@ -198,7 +198,7 @@ import java.util.concurrent.atomic.AtomicReference;
try { try {
int page = options.getInt(EXTRA_PAGE); int page = options.getInt(EXTRA_PAGE);
int pageSize = options.getInt(EXTRA_PAGE_SIZE); int pageSize = options.getInt(EXTRA_PAGE_SIZE);
if (page > 0 && pageSize > 0) { if (page >= 0 && pageSize > 0) {
// Requesting the list of children through pagination. // Requesting the list of children through pagination.
@Nullable @Nullable
LibraryParams params = LibraryParams params =
...@@ -223,7 +223,7 @@ import java.util.concurrent.atomic.AtomicReference; ...@@ -223,7 +223,7 @@ import java.util.concurrent.atomic.AtomicReference;
parentId, parentId,
/* page= */ 0, /* page= */ 0,
/* pageSize= */ Integer.MAX_VALUE, /* pageSize= */ Integer.MAX_VALUE,
/* extras= */ null); /* params= */ null);
sendLibraryResultWithMediaItemsWhenReady(result, future); sendLibraryResultWithMediaItemsWhenReady(result, future);
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment