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

Commit 659ed4fe authored by Varun Shah's avatar Varun Shah
Browse files

Remove flag for updated SAW fgs restrictions.

The feature is now completely rolled out.

Fixes: 409604516
Test: atest ActivityManagerFgsBgStartTest
Flag: EXEMPT removing com.android.server.am.fgs_disable_saw
Change-Id: I9beb2df22981e90cd7d2dc0051ddf9ae03c7ce70
parent af948f1f
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -8811,8 +8811,7 @@ public final class ActiveServices {
                                    callingUid, callingPid, callingPackage)) {
                // Starting from Android V, it is not enough to only have the SYSTEM_ALERT_WINDOW
                // permission granted - apps must also be showing an overlay window.
                if (Flags.fgsDisableSaw()
                        && CompatChanges.isChangeEnabled(FGS_SAW_RESTRICTIONS, callingUid)) {
                if (CompatChanges.isChangeEnabled(FGS_SAW_RESTRICTIONS, callingUid)) {
                    final UidRecord uidRecord = mAm.mProcessList.getUidRecordLOSP(callingUid);
                    if (uidRecord != null) {
                        for (int i = uidRecord.getNumOfProcs() - 1; i >= 0; i--) {
+3 −4
Original line number Diff line number Diff line
@@ -6510,8 +6510,7 @@ public class ActivityManagerService extends IActivityManager.Stub
            case REASON_INSTR_BACKGROUND_ACTIVITY_PERMISSION:
                return true;
            case REASON_SYSTEM_ALERT_WINDOW_PERMISSION:
                if (!Flags.fgsDisableSaw()
                        || !CompatChanges.isChangeEnabled(FGS_SAW_RESTRICTIONS, uid)) {
                if (!CompatChanges.isChangeEnabled(FGS_SAW_RESTRICTIONS, uid)) {
                    return true;
                } else {
                    // With the new SAW restrictions starting Android V, only allow the app to
@@ -6620,8 +6619,8 @@ public class ActivityManagerService extends IActivityManager.Stub
            final UidRecord uidRecord = mProcessList.getUidRecordLOSP(uid);
            final boolean hasSawPermission = mAtmInternal.hasSystemAlertWindowPermission(uid, pid,
                                                            pkgName);
            final boolean strictSawCheckEnabled = Flags.fgsDisableSaw()
                            && CompatChanges.isChangeEnabled(FGS_SAW_RESTRICTIONS, uid);
            final boolean strictSawCheckEnabled =
                    CompatChanges.isChangeEnabled(FGS_SAW_RESTRICTIONS, uid);
            if (uidRecord != null) {
                for (int i = uidRecord.getNumOfProcs() - 1; i >= 0; --i) {
                    ProcessRecord pr = uidRecord.getProcessRecordByIndex(i);
+0 −7
Original line number Diff line number Diff line
@@ -8,13 +8,6 @@ flag {
    bug: "295545575"
}

flag {
    name: "fgs_disable_saw"
    namespace: "backstage_power"
    description: "Disable System Alert Window FGS start"
    bug: "296558535"
}

flag {
    name: "bfgs_managed_network_access"
    namespace: "backstage_power"