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

Commit 584d8893 authored by Achim Thesmann's avatar Achim Thesmann
Browse files

Replace flags with check for debug build

These flags were never intended to be ramped to 100%, so changing from flag to Build.IS_DEBUGGABLE to keep informing developers without annoying end users.

Test: atest CtsWindowManagerBackgroundActivityTestCases
Bug: 433530796
Bug: 433529760
Flag: EXEMPT flag removal bal_show_toasts_blocked.bal_show_toasts_blocked bal_show_toasts_blocked.bal_additional_logging
Change-Id: Ic954f6525fd4a43353a18af7aa379e14ae0a115f
parent c0ad6d86
Loading
Loading
Loading
Loading
+0 −14
Original line number Original line Diff line number Diff line
@@ -8,13 +8,6 @@ flag {
    bug: "296478675"
    bug: "296478675"
}
}


flag {
    name: "bal_show_toasts_blocked"
    namespace: "responsible_apis"
    description: "Enable toasts to indicate actual BAL blocking."
    bug: "308059069"
}

flag {
flag {
    name: "bal_respect_app_switch_state_when_check_bound_by_foreground_uid"
    name: "bal_respect_app_switch_state_when_check_bound_by_foreground_uid"
    namespace: "responsible_apis"
    namespace: "responsible_apis"
@@ -61,13 +54,6 @@ flag {
    bug: "322159724"
    bug: "322159724"
}
}


flag {
    name: "bal_additional_logging"
    namespace: "responsible_apis"
    description: "Enable additional logging."
    bug: "403398176"
}

flag {
flag {
    name: "bal_cover_intent_sender"
    name: "bal_cover_intent_sender"
    namespace: "responsible_apis"
    namespace: "responsible_apis"
+3 −4
Original line number Original line Diff line number Diff line
@@ -45,9 +45,7 @@ import static com.android.server.wm.ActivityTaskManagerService.APP_SWITCH_ALLOW;
import static com.android.server.wm.ActivityTaskManagerService.APP_SWITCH_FG_ONLY;
import static com.android.server.wm.ActivityTaskManagerService.APP_SWITCH_FG_ONLY;
import static com.android.server.wm.ActivityTaskSupervisor.getApplicationLabel;
import static com.android.server.wm.ActivityTaskSupervisor.getApplicationLabel;
import static com.android.server.wm.PendingRemoteAnimationRegistry.TIMEOUT_MS;
import static com.android.server.wm.PendingRemoteAnimationRegistry.TIMEOUT_MS;
import static com.android.window.flags.Flags.balAdditionalLogging;
import static com.android.window.flags.Flags.balDontBringExistingBackgroundTaskStackToFg;
import static com.android.window.flags.Flags.balDontBringExistingBackgroundTaskStackToFg;
import static com.android.window.flags.Flags.balShowToastsBlocked;


import static java.lang.annotation.RetentionPolicy.SOURCE;
import static java.lang.annotation.RetentionPolicy.SOURCE;
import static java.util.Objects.requireNonNull;
import static java.util.Objects.requireNonNull;
@@ -67,6 +65,7 @@ import android.content.ComponentName;
import android.content.Intent;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.IBinder;
import android.os.IBinder;
import android.os.Process;
import android.os.Process;
import android.os.RemoteException;
import android.os.RemoteException;
@@ -978,7 +977,7 @@ public class BackgroundActivityStartController {
    private BalVerdict abortLaunch(BalState state) {
    private BalVerdict abortLaunch(BalState state) {
        Slog.wtf(TAG, "Background activity launch blocked! goo.gle/android-bal "
        Slog.wtf(TAG, "Background activity launch blocked! goo.gle/android-bal "
                + state);
                + state);
        if (balShowToastsBlocked()
        if (Build.IS_DEBUGGABLE
                && (state.mResultForCaller.allows() || state.mResultForRealCaller.allows())) {
                && (state.mResultForCaller.allows() || state.mResultForRealCaller.allows())) {
            // only show a toast if either caller or real caller could launch if they opted in
            // only show a toast if either caller or real caller could launch if they opted in
            showToast("BAL blocked. goo.gle/android-bal");
            showToast("BAL blocked. goo.gle/android-bal");
@@ -2176,7 +2175,7 @@ public class BackgroundActivityStartController {
                return false;
                return false;
            } else {
            } else {
                // log to determine grace period length distribution
                // log to determine grace period length distribution
                if (balAdditionalLogging()) {
                if (Build.IS_DEBUGGABLE) {
                    Slog.wtf(TAG, "Activity start ONLY allowed by " + balCodeToString(balCode) + " "
                    Slog.wtf(TAG, "Activity start ONLY allowed by " + balCodeToString(balCode) + " "
                            + finalVerdict.mMessage + ": " + state);
                            + finalVerdict.mMessage + ": " + state);
                }
                }