Merge "Use proper package name and UID when checking write settings access" into nyc-dev
am: b707db0
* commit 'b707db0f3e51235ef9c38a22fc3577083331c626':
Use proper package name and UID when checking write settings access
Change-Id: I5e065198393ada578931189a60ae54a3eb535171
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user