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

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

Merge "Improve toast text." into main

parents 15a0d1b2 3a77e296
Loading
Loading
Loading
Loading
+8 −12
Original line number Diff line number Diff line
@@ -637,7 +637,7 @@ public class BackgroundActivityStartController {
                                + " if the PI creator upgrades target_sdk to 35+"
                                + " AND the PI sender upgrades target_sdk to 34+! "
                                + state.dump(resultForCaller, resultForRealCaller));
                showBalRiskToast("BAL would be blocked", state);
                showBalRiskToast();
                // return the realCaller result for backwards compatibility
                return statsLog(resultForRealCaller, state);
            }
@@ -663,7 +663,7 @@ public class BackgroundActivityStartController {
                                + " if the PI creator upgrades target_sdk to 35+! "
                                + " (missing opt in by PI creator)! "
                                + state.dump(resultForCaller, resultForRealCaller));
                showBalRiskToast("BAL would be blocked", state);
                showBalRiskToast();
                return statsLog(resultForCaller, state);
            }
            Slog.wtf(TAG,
@@ -680,7 +680,7 @@ public class BackgroundActivityStartController {
                                + " if the PI sender upgrades target_sdk to 34+! "
                                + " (missing opt in by PI sender)! "
                                + state.dump(resultForCaller, resultForRealCaller));
                showBalRiskToast("BAL would be blocked", state);
                showBalRiskToast();
                return statsLog(resultForRealCaller, state);
            }
            Slog.wtf(TAG, "Without Android 14 BAL hardening this activity start would be allowed"
@@ -696,7 +696,7 @@ public class BackgroundActivityStartController {
            BalVerdict resultForRealCaller) {
        Slog.w(TAG, "Background activity launch blocked! "
                + state.dump(resultForCaller, resultForRealCaller));
        showBalBlockedToast("BAL blocked", state);
        showBalBlockedToast();
        return statsLog(BalVerdict.BLOCK, state);
    }

@@ -1088,19 +1088,15 @@ public class BackgroundActivityStartController {
        return true;
    }

    private void showBalBlockedToast(String toastText, BalState state) {
    private void showBalBlockedToast() {
        if (balShowToastsBlocked()) {
            showToast(toastText
                    + " caller:" + state.mCallingPackage
                    + " realCaller:" + state.mRealCallingPackage);
            showToast("BAL blocked. go/debug-bal");
        }
    }

    private void showBalRiskToast(String toastText, BalState state) {
    private void showBalRiskToast() {
        if (balShowToasts()) {
            showToast(toastText
                    + " caller:" + state.mCallingPackage
                    + " realCaller:" + state.mRealCallingPackage);
            showToast("BAL allowed in compat mode. go/debug-bal");
        }
    }