From 03bdc8a8f756a951b460b01cbd4d01c2ffd05041 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Fri, 21 Sep 2012 16:10:21 -0700 Subject: Fix security check for private allocateAppWidgetId api Bug: 7182054 --- services/java/com/android/server/AppWidgetServiceImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/java/com/android/server/AppWidgetServiceImpl.java b/services/java/com/android/server/AppWidgetServiceImpl.java index 499c15e..1b7c3a2 100644 --- a/services/java/com/android/server/AppWidgetServiceImpl.java +++ b/services/java/com/android/server/AppWidgetServiceImpl.java @@ -1394,8 +1394,7 @@ class AppWidgetServiceImpl { int enforceSystemOrCallingUid(String packageName) throws IllegalArgumentException { int callingUid = Binder.getCallingUid(); - int uid = Process.myUid(); - if (UserHandle.getAppId(uid) == Process.SYSTEM_UID || uid == 0) { + if (UserHandle.getAppId(callingUid) == Process.SYSTEM_UID || callingUid == 0) { return callingUid; } return enforceCallingUid(packageName); -- cgit v1.1