summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Achim Thesmann <achim@google.com> 2024-02-14 04:41:43 +0000
committer Achim Thesmann <achim@google.com> 2024-02-14 17:42:50 +0000
commit67f04233593b18e9626e2f91eb3d2bc935a46b3e (patch)
treee96a146430bf4742f418ec41522f0dfe64a05501
parentf845c4f794bded766e3049bd51e069390487bbca (diff)
Allow Home app to BAL during app switches
The tightened visibility check sometimes fails because the window manager's app switch state is still/already disallowed when the home app initiates certain actions (its purpose is to switch between apps). So allowlisting the home app to ignore the stricter app switch restriction. This reverts the behavior for the home app back to the state before enabling the balImproveRealCallerVisibilityCheck flag. Test: atest BackgroundActivityLaunchTest Bug: 323739101 Change-Id: Ic537c6fcb43e466e4df6d9383579cee33fccd060
-rw-r--r--services/core/java/com/android/server/wm/BackgroundActivityStartController.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/BackgroundActivityStartController.java b/services/core/java/com/android/server/wm/BackgroundActivityStartController.java
index b65b2b2ae959..2d6f03a6c9ad 100644
--- a/services/core/java/com/android/server/wm/BackgroundActivityStartController.java
+++ b/services/core/java/com/android/server/wm/BackgroundActivityStartController.java
@@ -913,8 +913,10 @@ public class BackgroundActivityStartController {
// Normal apps with visible app window will be allowed to start activity if app switching
// is allowed, or apps like live wallpaper with non app visible window will be allowed.
+ // The home app can start apps even if app switches are usually disallowed.
final boolean appSwitchAllowedOrFg = state.mAppSwitchState == APP_SWITCH_ALLOW
- || state.mAppSwitchState == APP_SWITCH_FG_ONLY;
+ || state.mAppSwitchState == APP_SWITCH_FG_ONLY
+ || isHomeApp(state.mRealCallingUid, state.mRealCallingPackage);
if (balImproveRealCallerVisibilityCheck()) {
if (appSwitchAllowedOrFg && state.mRealCallingUidHasAnyVisibleWindow) {
return new BalVerdict(BAL_ALLOW_VISIBLE_WINDOW,