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

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

Merge "Log all blocked BAL attempts" into main

parents 3de73c95 94deedfe
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -727,8 +727,7 @@ public class BackgroundActivityStartController {
            if (state.mBalAllowedByPiCreator.allowsBackgroundActivityStarts()) {
                Slog.wtf(TAG, "With Android 15 BAL hardening this activity start may be blocked"
                        + " if the PI creator upgrades target_sdk to 35+! "
                                + " (missing opt in by PI creator)! "
                                + state.dump());
                        + " (missing opt in by PI creator)!" + state.dump());
                showBalRiskToast();
                return allowBasedOnCaller(state);
            }
@@ -738,16 +737,14 @@ public class BackgroundActivityStartController {
            if (state.mBalAllowedByPiSender.allowsBackgroundActivityStarts()) {
                Slog.wtf(TAG, "With Android 14 BAL hardening this activity start will be blocked"
                        + " if the PI sender upgrades target_sdk to 34+! "
                                + " (missing opt in by PI sender)! "
                                + state.dump());
                        + " (missing opt in by PI sender)!" + state.dump());
                showBalRiskToast();
                return allowBasedOnRealCaller(state);
            }
        }
        // caller or real caller could start the activity, but would need to explicitly opt in
        if (callerCanAllow || realCallerCanAllow) {
            Slog.wtf(TAG, "Without BAL hardening this activity start would be allowed "
                            + state.dump());
            Slog.w(TAG, "Without BAL hardening this activity start would be allowed");
        }
        // neither the caller not the realCaller can allow or have explicitly opted out
        return abortLaunch(state);
@@ -770,7 +767,7 @@ public class BackgroundActivityStartController {
    }

    private BalVerdict abortLaunch(BalState state) {
        Slog.w(TAG, "Background activity launch blocked! "
        Slog.wtf(TAG, "Background activity launch blocked! "
                + state.dump());
        showBalBlockedToast();
        return statsLog(BalVerdict.BLOCK, state);