Update Settings#canDrawOverlays

.. to consider if the caller is holding the permission
SYSTEM_APPLICATION_OVERLAY.

Bug: 171177581
Test: Manually verified using wellbeing app
Change-Id: I58907de33015d7441818110e94612ec3d29d07ad
This commit is contained in:
Linus Tufvesson
2021-01-19 15:55:43 +00:00
parent 9698f82a0b
commit 01088524cb

View File

@@ -3061,7 +3061,9 @@ public final class Settings {
*/
public static boolean canDrawOverlays(Context context) {
return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(),
context.getOpPackageName(), false);
context.getOpPackageName(), false) || context.checkSelfPermission(
Manifest.permission.SYSTEM_APPLICATION_OVERLAY)
== PackageManager.PERMISSION_GRANTED;
}
/**