Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ed14bf0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove DeviceConfig mFlagFgsStartTempAllowListEnabled."

parents a864f959 a947e298
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -5285,8 +5285,7 @@ public final class ActiveServices {
        }
        }


        if (ret == FGS_FEATURE_DENIED) {
        if (ret == FGS_FEATURE_DENIED) {
            if (mAm.mConstants.mFlagFgsStartTempAllowListEnabled
            if (mAm.isWhitelistedForFgsStartLocked(r.appInfo.uid)) {
                    && mAm.isWhitelistedForFgsStartLocked(r.appInfo.uid)) {
                // uid is on DeviceIdleController's user/system allowlist
                // uid is on DeviceIdleController's user/system allowlist
                // or AMS's FgsStartTempAllowList.
                // or AMS's FgsStartTempAllowList.
                ret = FGS_FEATURE_ALLOWED_BY_DEVICE_IDLE_ALLOW_LIST;
                ret = FGS_FEATURE_ALLOWED_BY_DEVICE_IDLE_ALLOW_LIST;
+0 −21
Original line number Original line Diff line number Diff line
@@ -166,13 +166,6 @@ final class ActivityManagerConstants extends ContentObserver {
    private static final String KEY_DEFAULT_FGS_STARTS_RESTRICTION_ENABLED =
    private static final String KEY_DEFAULT_FGS_STARTS_RESTRICTION_ENABLED =
            "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
     * Whether FGS notification display is deferred following the transition into
     * the foreground state.  Default behavior is {@code true} unless overridden.
     * the foreground state.  Default behavior is {@code true} unless overridden.
@@ -372,10 +365,6 @@ final class ActivityManagerConstants extends ContentObserver {
    // at all.
    // at all.
    volatile boolean mFlagFgsStartRestrictionEnabled = false;
    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
    // Whether we defer FGS notifications a few seconds following their transition to
    // the foreground state.  Applies only to S+ apps; enabled by default.
    // the foreground state.  Applies only to S+ apps; enabled by default.
    volatile boolean mFlagFgsNotificationDeferralEnabled = true;
    volatile boolean mFlagFgsNotificationDeferralEnabled = true;
@@ -540,9 +529,6 @@ final class ActivityManagerConstants extends ContentObserver {
                            case KEY_DEFAULT_FGS_STARTS_RESTRICTION_ENABLED:
                            case KEY_DEFAULT_FGS_STARTS_RESTRICTION_ENABLED:
                                updateFgsStartsRestriction();
                                updateFgsStartsRestriction();
                                break;
                                break;
                            case KEY_DEFAULT_FGS_STARTS_TEMP_ALLOWLIST_ENABLED:
                                updateFgsStartsTempAllowList();
                                break;
                            case KEY_DEFERRED_FGS_NOTIFICATIONS_ENABLED:
                            case KEY_DEFERRED_FGS_NOTIFICATIONS_ENABLED:
                                updateFgsNotificationDeferralEnable();
                                updateFgsNotificationDeferralEnable();
                                break;
                                break;
@@ -809,13 +795,6 @@ final class ActivityManagerConstants extends ContentObserver {
                /*defaultValue*/ false);
                /*defaultValue*/ false);
    }
    }


    private void updateFgsStartsTempAllowList() {
        mFlagFgsStartTempAllowListEnabled = DeviceConfig.getBoolean(
                DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
                KEY_DEFAULT_FGS_STARTS_TEMP_ALLOWLIST_ENABLED,
                /*defaultValue*/ false);
    }

    private void updateFgsNotificationDeferralEnable() {
    private void updateFgsNotificationDeferralEnable() {
        mFlagFgsNotificationDeferralEnabled = DeviceConfig.getBoolean(
        mFlagFgsNotificationDeferralEnabled = DeviceConfig.getBoolean(
                DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
                DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,