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

Commit f0989606 authored by Achim Thesmann's avatar Achim Thesmann
Browse files

Remove com.android.window.flags.bal_additional_start_modes Flag

Bug: 434817162
Bug: 353588486
Test: atest CtsWindowManagerBackgroundActivityTestCases
Flag: EXEMPT remove flag com.android.window.flags.bal_additional_start_modes
Change-Id: If465315078a41e079821daff648c349b9db75e95
parent 4bbab50b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -5039,9 +5039,9 @@ package android.app {
    method public void update(android.app.ActivityOptions);
    field public static final String EXTRA_USAGE_TIME_REPORT = "android.activity.usage_time";
    field public static final String EXTRA_USAGE_TIME_REPORT_PACKAGES = "android.usage_time_packages";
    field @Deprecated @FlaggedApi("com.android.window.flags.bal_additional_start_modes") public static final int MODE_BACKGROUND_ACTIVITY_START_ALLOWED = 1; // 0x1
    field @FlaggedApi("com.android.window.flags.bal_additional_start_modes") public static final int MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS = 3; // 0x3
    field @FlaggedApi("com.android.window.flags.bal_additional_start_modes") public static final int MODE_BACKGROUND_ACTIVITY_START_ALLOW_IF_VISIBLE = 4; // 0x4
    field @Deprecated public static final int MODE_BACKGROUND_ACTIVITY_START_ALLOWED = 1; // 0x1
    field public static final int MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS = 3; // 0x3
    field public static final int MODE_BACKGROUND_ACTIVITY_START_ALLOW_IF_VISIBLE = 4; // 0x4
    field public static final int MODE_BACKGROUND_ACTIVITY_START_DENIED = 2; // 0x2
    field public static final int MODE_BACKGROUND_ACTIVITY_START_SYSTEM_DEFINED = 0; // 0x0
  }
+0 −5
Original line number Diff line number Diff line
@@ -68,8 +68,6 @@ import android.window.RemoteTransition;
import android.window.SplashScreen;
import android.window.WindowContainerToken;

import com.android.window.flags.Flags;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
@@ -131,7 +129,6 @@ public class ActivityOptions extends ComponentOptions {
     * Restrictions on starting activities from the background</a>).
     */
    @Deprecated
    @FlaggedApi(Flags.FLAG_BAL_ADDITIONAL_START_MODES)
    public static final int MODE_BACKGROUND_ACTIVITY_START_ALLOWED = 1;
    /**
     * Denies the {@link PendingIntent} any background activity start privileges.
@@ -152,7 +149,6 @@ public class ActivityOptions extends ComponentOptions {
     * <a href="https://developer.android.com/guide/components/activities/background-starts">
     * Restrictions on starting activities from the background</a>
     */
    @FlaggedApi(Flags.FLAG_BAL_ADDITIONAL_START_MODES)
    public static final int MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS = 3;
    /**
     * Grants the {@link PendingIntent} background activity start privileges only when the app
@@ -163,7 +159,6 @@ public class ActivityOptions extends ComponentOptions {
     * <a href="https://developer.android.com/guide/components/activities/background-starts">
     * Restrictions on starting activities from the background</a>
     */
    @FlaggedApi(Flags.FLAG_BAL_ADDITIONAL_START_MODES)
    public static final int MODE_BACKGROUND_ACTIVITY_START_ALLOW_IF_VISIBLE = 4;
    /**
     * Provides compatibility with previous Android versions regarding background activity starts.
+6 −7
Original line number Diff line number Diff line
@@ -46,7 +46,6 @@ import static com.android.server.wm.ActivityTaskManagerService.APP_SWITCH_FG_ONL
import static com.android.server.wm.ActivityTaskSupervisor.getApplicationLabel;
import static com.android.server.wm.PendingRemoteAnimationRegistry.TIMEOUT_MS;
import static com.android.window.flags.Flags.balAdditionalLogging;
import static com.android.window.flags.Flags.balAdditionalStartModes;
import static com.android.window.flags.Flags.balDontBringExistingBackgroundTaskStackToFg;
import static com.android.window.flags.Flags.balShowToastsBlocked;

@@ -1103,8 +1102,8 @@ public class BackgroundActivityStartController {
     * or {@link #BAL_BLOCK} if the launch should be blocked
     */
    BalVerdict checkBackgroundActivityStartAllowedByCaller(BalState state) {
        boolean evaluateVisibleOnly = balAdditionalStartModes()
                && state.mCheckedOptions.getPendingIntentCreatorBackgroundActivityStartMode()
        boolean evaluateVisibleOnly =
                state.mCheckedOptions.getPendingIntentCreatorBackgroundActivityStartMode()
                        == MODE_BACKGROUND_ACTIVITY_START_ALLOW_IF_VISIBLE;
        boolean basedOnRealCaller = false;
        if (evaluateVisibleOnly) {
@@ -1307,8 +1306,8 @@ public class BackgroundActivityStartController {
     * or {@link #BAL_BLOCK} if the launch should be blocked
     */
    BalVerdict checkBackgroundActivityStartAllowedByRealCaller(BalState state) {
        boolean evaluateVisibleOnly = balAdditionalStartModes()
                && state.mCheckedOptions.getPendingIntentBackgroundActivityStartMode()
        boolean evaluateVisibleOnly =
                state.mCheckedOptions.getPendingIntentBackgroundActivityStartMode()
                        == MODE_BACKGROUND_ACTIVITY_START_ALLOW_IF_VISIBLE;
        boolean basedOnRealCaller = true;
        if (evaluateVisibleOnly) {