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

Commit cc6b323b authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove com.android.window.flags.bal_additional_start_modes Flag" into main

parents 60f91bd5 f0989606
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -5040,9 +5040,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
@@ -67,8 +67,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;
@@ -130,7 +128,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.
@@ -151,7 +148,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
@@ -162,7 +158,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) {