Merge "Fixing read from mUsersRedirectedToOwnerForMedia sparse array." into udc-dev

This commit is contained in:
Himanshu Gupta
2023-05-12 22:02:02 +00:00
committed by Android (Google) Code Review

View File

@@ -892,8 +892,9 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall
*/
private boolean isContentRedirectionAllowedForUser(int incomingUserId) {
if (MediaStore.AUTHORITY.equals(mAuthority)) {
if (mUsersRedirectedToOwnerForMedia.indexOfKey(incomingUserId) >= 0) {
return mUsersRedirectedToOwnerForMedia.valueAt(incomingUserId);
int incomingUserIdIndex = mUsersRedirectedToOwnerForMedia.indexOfKey(incomingUserId);
if (incomingUserIdIndex >= 0) {
return mUsersRedirectedToOwnerForMedia.valueAt(incomingUserIdIndex);
}
// Haven't seen this user yet, look it up