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

Commit 9d463e70 authored by Achim Thesmann's avatar Achim Thesmann Committed by Android (Google) Code Review
Browse files

Merge "Introduce flag to enable grace period deprecation" into main

parents 1ee94bfa ea7e9e98
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -31,13 +31,10 @@ flag {
}

flag {
  name: "asm_reintroduce_grace_period"
  name: "asm_ignore_grace_period_exemption"
  namespace: "responsible_apis"
  description: "Allow launches within the grace period for ASM apps"
  description: "Ignore grace period exemption for ASM apps"
  bug: "367702727"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
+2 −2
Original line number Diff line number Diff line
@@ -1414,7 +1414,7 @@ public class BackgroundActivityStartController {
            }
            return true;
        }
        if (android.security.Flags.asmReintroduceGracePeriod() && balVerdict.isBasedOnCaller()
        if (!android.security.Flags.asmIgnoreGracePeriodExemption() && balVerdict.isBasedOnCaller()
                && balVerdict.isInGracePeriod() && balVerdict.getCode() == BAL_ALLOW_GRACE_PERIOD) {
            if (DEBUG_ACTIVITY_STARTS) {
                Slog.d(TAG, "[ASM] allowed based on grace period. verdict: " + balVerdict);
@@ -1488,7 +1488,7 @@ public class BackgroundActivityStartController {
                ArrayList<Task> visibleTasks = displayArea.getVisibleTasks();
                for (int i = 0; i < visibleTasks.size(); i++) {
                    Task task = visibleTasks.get(i);
                    if (android.security.Flags.asmReintroduceGracePeriod()) {
                    if (!android.security.Flags.asmIgnoreGracePeriodExemption()) {
                        bas = checkTopActivityForAsm(task, callingUid, /*sourceRecord*/null, bas);
                    } else {
                        if (visibleTasks.size() == 1 && task.isActivityTypeHomeOrRecents()) {