Merge "Revert "Fix default mode for system alert window on low-RAM device."" into tm-dev am: 074f4aa65d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18365482 Change-Id: I6b68883eb0092fe8dab406b5f4a8715ee0bbd77a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -2709,7 +2709,7 @@ public class AppOpsManager {
|
|||||||
AppOpsManager.MODE_ALLOWED, // READ_ICC_SMS
|
AppOpsManager.MODE_ALLOWED, // READ_ICC_SMS
|
||||||
AppOpsManager.MODE_ALLOWED, // WRITE_ICC_SMS
|
AppOpsManager.MODE_ALLOWED, // WRITE_ICC_SMS
|
||||||
AppOpsManager.MODE_DEFAULT, // WRITE_SETTINGS
|
AppOpsManager.MODE_DEFAULT, // WRITE_SETTINGS
|
||||||
AppOpsManager.MODE_DEFAULT, // SYSTEM_ALERT_WINDOW /*Overridden in opToDefaultMode()*/
|
getSystemAlertWindowDefault(), // SYSTEM_ALERT_WINDOW
|
||||||
AppOpsManager.MODE_ALLOWED, // ACCESS_NOTIFICATIONS
|
AppOpsManager.MODE_ALLOWED, // ACCESS_NOTIFICATIONS
|
||||||
AppOpsManager.MODE_ALLOWED, // CAMERA
|
AppOpsManager.MODE_ALLOWED, // CAMERA
|
||||||
AppOpsManager.MODE_ALLOWED, // RECORD_AUDIO
|
AppOpsManager.MODE_ALLOWED, // RECORD_AUDIO
|
||||||
@@ -3163,8 +3163,6 @@ public class AppOpsManager {
|
|||||||
private static final String DEBUG_LOGGING_OPS_PROP = "appops.logging_ops";
|
private static final String DEBUG_LOGGING_OPS_PROP = "appops.logging_ops";
|
||||||
private static final String DEBUG_LOGGING_TAG = "AppOpsManager";
|
private static final String DEBUG_LOGGING_TAG = "AppOpsManager";
|
||||||
|
|
||||||
private static volatile Integer sOpSystemAlertWindowDefaultMode;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the op switch that controls the given operation.
|
* Retrieve the op switch that controls the given operation.
|
||||||
* @hide
|
* @hide
|
||||||
@@ -3263,9 +3261,6 @@ public class AppOpsManager {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public static @Mode int opToDefaultMode(int op) {
|
public static @Mode int opToDefaultMode(int op) {
|
||||||
if (op == OP_SYSTEM_ALERT_WINDOW) {
|
|
||||||
return getSystemAlertWindowDefault();
|
|
||||||
}
|
|
||||||
return sOpDefaultMode[op];
|
return sOpDefaultMode[op];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -10283,11 +10278,6 @@ public class AppOpsManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static int getSystemAlertWindowDefault() {
|
private static int getSystemAlertWindowDefault() {
|
||||||
// This is indeed racy but we aren't expecting the result to change so it's not worth
|
|
||||||
// the synchronization.
|
|
||||||
if (sOpSystemAlertWindowDefaultMode != null) {
|
|
||||||
return sOpSystemAlertWindowDefaultMode;
|
|
||||||
}
|
|
||||||
final Context context = ActivityThread.currentApplication();
|
final Context context = ActivityThread.currentApplication();
|
||||||
if (context == null) {
|
if (context == null) {
|
||||||
return AppOpsManager.MODE_DEFAULT;
|
return AppOpsManager.MODE_DEFAULT;
|
||||||
@@ -10298,11 +10288,10 @@ public class AppOpsManager {
|
|||||||
// TVs are constantly plugged in and has less concern for memory/power
|
// TVs are constantly plugged in and has less concern for memory/power
|
||||||
if (ActivityManager.isLowRamDeviceStatic()
|
if (ActivityManager.isLowRamDeviceStatic()
|
||||||
&& !pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK, 0)) {
|
&& !pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK, 0)) {
|
||||||
sOpSystemAlertWindowDefaultMode = AppOpsManager.MODE_IGNORED;
|
return AppOpsManager.MODE_IGNORED;
|
||||||
} else {
|
|
||||||
sOpSystemAlertWindowDefaultMode = AppOpsManager.MODE_DEFAULT;
|
|
||||||
}
|
}
|
||||||
return sOpSystemAlertWindowDefaultMode;
|
|
||||||
|
return AppOpsManager.MODE_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user