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

Commit 7781a6f3 authored by Achim Thesmann's avatar Achim Thesmann
Browse files

Remove redundant text from logs.

The removed strings are already implicitly added by the logging in
BalVerdict.toString().

Test: atest BackgroundActivityLaunchTest ActivityStarterTests
Bug: 306059525
Change-Id: I10bbeed8469842a3cd8d2f3b2e25a97536a1e25b
parent 3a687e93
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -105,24 +105,23 @@ class BackgroundLaunchProcessController {
        // Allow if the proc is instrumenting with background activity starts privs.
        if (hasBackgroundActivityStartPrivileges) {
            return new BalVerdict(BAL_ALLOW_PERMISSION, /*background*/ true,
                    "Activity start allowed: process instrumenting with background "
                            + "activity starts privileges");
                    "process instrumenting with background activity starts privileges");
        }
        // Allow if the flag was explicitly set.
        if (isBackgroundStartAllowedByToken(uid, packageName, isCheckingForFgsStart)) {
            return new BalVerdict(BAL_ALLOW_PERMISSION, /*background*/ true,
                    "Activity start allowed: process allowed by token");
                    "process allowed by token");
        }
        // Allow if the caller is bound by a UID that's currently foreground.
        if (isBoundByForegroundUid()) {
            return new BalVerdict(BAL_ALLOW_VISIBLE_WINDOW, /*background*/ false,
                    "Activity start allowed: process bound by foreground uid");
                    "process bound by foreground uid");
        }
        // Allow if the caller has an activity in any foreground task.
        if (hasActivityInVisibleTask
                && (appSwitchState == APP_SWITCH_ALLOW || appSwitchState == APP_SWITCH_FG_ONLY)) {
            return new BalVerdict(BAL_ALLOW_FOREGROUND, /*background*/ false,
                    "Activity start allowed: process has activity in foreground task");
                    "process has activity in foreground task");
        }

        // If app switching is not allowed, we ignore all the start activity grace period
@@ -138,8 +137,7 @@ class BackgroundLaunchProcessController {
                if (lastActivityLaunchTime > lastStopAppSwitchesTime
                        || lastActivityFinishTime > lastStopAppSwitchesTime) {
                    return new BalVerdict(BAL_ALLOW_GRACE_PERIOD, /*background*/ true,
                            "Activity start allowed: within "
                                    + ACTIVITY_BG_START_GRACE_PERIOD_MS + "ms grace period");
                            "within " + ACTIVITY_BG_START_GRACE_PERIOD_MS + "ms grace period");
                }
                if (DEBUG_ACTIVITY_STARTS) {
                    Slog.d(TAG, "[Process(" + pid + ")] Activity start within "