Remove DeviceConfig mFlagFgsStartTempAllowListEnabled.

BG-FGS-Lauch always check temp allowlist now.

Bug: 171305836
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java
Change-Id: I06d4218497402b16b5d3c67b2aeaaf438636272e
This commit is contained in:
Hui Yu
2020-12-09 10:31:13 -08:00
parent 799b044d30
commit a947e298d1
2 changed files with 1 additions and 23 deletions

View File

@@ -5285,8 +5285,7 @@ public final class ActiveServices {
}
if (ret == FGS_FEATURE_DENIED) {
if (mAm.mConstants.mFlagFgsStartTempAllowListEnabled
&& mAm.isWhitelistedForFgsStartLocked(r.appInfo.uid)) {
if (mAm.isWhitelistedForFgsStartLocked(r.appInfo.uid)) {
// uid is on DeviceIdleController's user/system allowlist
// or AMS's FgsStartTempAllowList.
ret = FGS_FEATURE_ALLOWED_BY_DEVICE_IDLE_ALLOW_LIST;

View File

@@ -166,13 +166,6 @@ final class ActivityManagerConstants extends ContentObserver {
private static final String KEY_DEFAULT_FGS_STARTS_RESTRICTION_ENABLED =
"default_fgs_starts_restriction_enabled";
/**
* Default value for mFlagFgsStartTempAllowListEnabled if not explicitly set in
* Settings.Global.
*/
private static final String KEY_DEFAULT_FGS_STARTS_TEMP_ALLOWLIST_ENABLED =
"default_fgs_starts_temp_allowlist_enabled";
/**
* Whether FGS notification display is deferred following the transition into
* the foreground state. Default behavior is {@code true} unless overridden.
@@ -372,10 +365,6 @@ final class ActivityManagerConstants extends ContentObserver {
// at all.
volatile boolean mFlagFgsStartRestrictionEnabled = false;
// When the foreground service background start restriction is enabled, if the app in
// DeviceIdleController's Temp AllowList is allowed to bypass the restriction.
volatile boolean mFlagFgsStartTempAllowListEnabled = false;
// Whether we defer FGS notifications a few seconds following their transition to
// the foreground state. Applies only to S+ apps; enabled by default.
volatile boolean mFlagFgsNotificationDeferralEnabled = true;
@@ -540,9 +529,6 @@ final class ActivityManagerConstants extends ContentObserver {
case KEY_DEFAULT_FGS_STARTS_RESTRICTION_ENABLED:
updateFgsStartsRestriction();
break;
case KEY_DEFAULT_FGS_STARTS_TEMP_ALLOWLIST_ENABLED:
updateFgsStartsTempAllowList();
break;
case KEY_DEFERRED_FGS_NOTIFICATIONS_ENABLED:
updateFgsNotificationDeferralEnable();
break;
@@ -809,13 +795,6 @@ final class ActivityManagerConstants extends ContentObserver {
/*defaultValue*/ false);
}
private void updateFgsStartsTempAllowList() {
mFlagFgsStartTempAllowListEnabled = DeviceConfig.getBoolean(
DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
KEY_DEFAULT_FGS_STARTS_TEMP_ALLOWLIST_ENABLED,
/*defaultValue*/ false);
}
private void updateFgsNotificationDeferralEnable() {
mFlagFgsNotificationDeferralEnabled = DeviceConfig.getBoolean(
DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,