Disable system alert window permissions on low ram devices

Bug: 63697002
Bug: 117832554
Test: adb am start-activity -a
android.settings.action.MANAGE_OVERLAY_PERMISSION
Change-Id: I44c64001cd07fd4934cdc55f455384cebd5c9cfb
This commit is contained in:
Ng Zhi An
2019-02-01 12:39:31 -08:00
parent d3824aa426
commit b97bdc38da
9 changed files with 212 additions and 1 deletions

View File

@@ -38,6 +38,7 @@ public class ShadowUtils {
private static boolean sIsDemoUser;
private static ComponentName sDeviceOwnerComponentName;
private static Map<String, String> sAppNameMap;
private static boolean sIsSystemAlertWindowEnabled;
@Implementation
protected static int enforceSameOwner(Context context, int userId) {
@@ -113,4 +114,13 @@ public class ShadowUtils {
}
sAppNameMap.put(packageName, appLabel);
}
@Implementation
protected static boolean isSystemAlertWindowEnabled(Context context) {
return sIsSystemAlertWindowEnabled;
}
public static void setIsSystemAlertWindowEnabled(boolean enabled) {
sIsSystemAlertWindowEnabled = enabled;
}
}