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

Commit bd0053a2 authored by Achim Thesmann's avatar Achim Thesmann
Browse files

Don't consider FOREGROUND exemption for visibility checks

To avoid conflicts with the ASM logic and in general because
BAL_ALLOW_FOREGROUND does not indicate that the app is actually visible,
consider this exemption only when non-visible exemptions are enabled.

Test: atest BackgroundActivityLaunchTests
Flag: EXEMPT bugfix
Bug: 352182359
Change-Id: Ia62686ca50bbfedc67c57c40ba94c299d66aedf4
parent 276222e0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ class BackgroundLaunchProcessController {
                    "process bound by foreground uid");
        }
        // Allow if the caller has an activity in any foreground task.
        if (checkConfiguration.checkVisibility && hasActivityInVisibleTask
        if (checkConfiguration.checkOtherExemptions && hasActivityInVisibleTask
                && appSwitchState != APP_SWITCH_DISALLOW) {
            return new BalVerdict(BAL_ALLOW_FOREGROUND, /*background*/ false,
                    "process has activity in foreground task");