diff options
| author | Svet Ganov <svetoslavganov@google.com> | 2016-04-03 22:04:22 -0700 |
|---|---|---|
| committer | Svet Ganov <svetoslavganov@google.com> | 2016-04-03 22:13:55 -0700 |
| commit | 94ba4017669c0fab675f3d756d95bc63fe543db5 (patch) | |
| tree | bd7bcd8e3b89d2013c7a661843b99a6a343a0928 /core/java | |
| parent | 1bb269d8fe9adbf41312e2203e08da34634ae863 (diff) | |
Use proper package name and UID when checking write settings access
bug:26941229
Change-Id: I338fe6dd7c1b97f273909672cdd7d4fa207185ce
Diffstat (limited to 'core/java')
| -rwxr-xr-x | core/java/android/provider/Settings.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 69dd9e5abe69..f4d63acdb4e8 100755 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -1569,9 +1569,8 @@ public final class Settings { * @return true if the calling app can draw on top of other apps, false otherwise. */ public static boolean canDrawOverlays(Context context) { - int uid = Binder.getCallingUid(); - return Settings.isCallingPackageAllowedToDrawOverlays(context, uid, Settings - .getPackageNameForUid(context, uid), false); + return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(), + context.getOpPackageName(), false); } /** @@ -3885,9 +3884,8 @@ public final class Settings { * @return true if the calling app can write to system settings, false otherwise */ public static boolean canWrite(Context context) { - int uid = Binder.getCallingUid(); - return isCallingPackageAllowedToWriteSettings(context, uid, getPackageNameForUid( - context, uid), false); + return isCallingPackageAllowedToWriteSettings(context, Process.myUid(), + context.getOpPackageName(), false); } } |
