Skip to content

Commit 03bdc8a

Browse files
committed
Fix security check for private allocateAppWidgetId api
Bug: 7182054
1 parent d86077c commit 03bdc8a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

services/java/com/android/server/AppWidgetServiceImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,8 +1394,7 @@ int getUidForPackage(String packageName) throws PackageManager.NameNotFoundExcep
13941394

13951395
int enforceSystemOrCallingUid(String packageName) throws IllegalArgumentException {
13961396
int callingUid = Binder.getCallingUid();
1397-
int uid = Process.myUid();
1398-
if (UserHandle.getAppId(uid) == Process.SYSTEM_UID || uid == 0) {
1397+
if (UserHandle.getAppId(callingUid) == Process.SYSTEM_UID || callingUid == 0) {
13991398
return callingUid;
14001399
}
14011400
return enforceCallingUid(packageName);

0 commit comments

Comments
 (0)