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

Skip to content
Commit eea8d3eb authored by Alan Stokes's avatar Alan Stokes
Browse files

Tighten rules for blocking activity starts.

This means we now block various cases where we failed to before,
including where an app launches an activity shortly after the home
button has been pressed, e.g. from within onPause() - either
immediately or after some blocking call.

Details:
- We no longer use process state at all, since a process may remain
  top for a time after the user has switched away and its
  windows have ceased to be visible.
- We no longer allow a start if callerApp.hasForegroundActivities(),
  because we are checking for windows visible to the user and an
  activity may be considered foreground even when it doesn't have such
  windows.
- Windows are only considered visible if isNowVisible() is true,
  rather than isVisible().

Bug: 128688247
Test: atest BackgroundActivityLaunchTest RootWindowContainerTests \
 WmTests:ActivityStarterTests \
 CtsActivityManagerDeviceTestCases:ActivityStarterTests
Test: Manual verification with self-restarting test app
Change-Id: I9863d8637661f15828ced435ff23812a4beef78d
parent bb8b7e57
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment