Skip to content

Commit 0d8af78

Browse files
author
Dianne Hackborn
committed
Fix permission check on ContentProvider to be multi-user aware.
Change-Id: I1e504fe6561caef99d478e37660e2294fec7ea8b
1 parent 79af1dd commit 0d8af78

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/java/android/content/ContentProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ private void enforceReadPermission(Uri uri) throws SecurityException {
279279
final int uid = Binder.getCallingUid();
280280
String missingPerm = null;
281281

282-
if (uid == mMyUid) {
282+
if (UserHandle.isSameApp(uid, mMyUid)) {
283283
return;
284284
}
285285

@@ -340,7 +340,7 @@ private void enforceWritePermission(Uri uri) throws SecurityException {
340340
final int uid = Binder.getCallingUid();
341341
String missingPerm = null;
342342

343-
if (uid == mMyUid) {
343+
if (UserHandle.isSameApp(uid, mMyUid)) {
344344
return;
345345
}
346346

0 commit comments

Comments
 (0)