* fix(session): remove the keep-top guard from other displays
#2763 put a transparent KeepTopActivity on every other display while a
session was on top, so lmkd killing that display's home could not move focus
off the session. A/B on a 12 GB AYN Thor (Android 13) and a Retroid Pocket
Duo (Android 16) found no case where it kept a session alive: with steady
pressure the bottom home (stock launcher or Cocoon) was killed up to 400
times per run without taking focus, and a burst big enough to matter makes
lmkd kill the session at adj 0 with or without the guard.
Its side effects were real:
- Android's ActivityRecordInputSink made the bottom screen ignore touch
(worked around in #2910 by stepping aside on touch).
- Cocoon tracks each display's top activity, so it could not suspend or
resume DroidDeck cleanly.
- The Thor's Game Assistant gives every app with an activity on top of the
bottom display that display's volume, so DroidDeck's audio followed the
bottom screen's volume slider.
Removes KeepTopActivity, the focus bounce and light pause, the memory
pressure trigger and their tests. onPause runs its departure cleanup every
time again.
tools/memory_guard_ab.py gains a burst mode, reads oom_score_adj without
su (lmkd kills the root manager app and su can then open its request screen
over the game), handles Android 13 dumps, a hung stop and a session that
does not start. docs/development/memory-guard-ab.md has the Thor results.
* test(session): the guard A/B fill mode starts its counter again, and a pressure run with no completed run fails
* test(session): the burst seed is rebuilt unless it is exactly 256 MiB
* test(session): the guard A/B burst takes its last partial chunk, and only a hog run that finished counts
* fix(session): the bottom screen takes touch again while a game runs
Since #2763, a transparent KeepTopActivity covers every other display while a
session is on top. Its window is NOT_TOUCHABLE, but Android gives a
translucent activity alone in its task an ActivityRecordInputSink that eats
every touch on that display (ENABLE_TOUCH_OPAQUE_ACTIVITIES, on for this
target SDK). With the dual-screen panel closed, the bottom screen's launcher,
Cocoon or any other app could not be touched until the session ended, and
the guard stayed over it after Home/PiP as well.
- The guard now takes touches itself: a touch removes it from that display.
- It comes back when the session is top-resumed again, or after 5 s if the
session kept the top spot (the user touched the bottom screen once and
stayed in the game).
- Stopping or entering PiP removes the guards; PiP keeps the session at adj
50 with or without them, so they protected nothing there.
A/B on a Retroid Pocket Duo (Android 16, Cocoon as bottom home): the guard
is on top in every state it was on top on main, except the 5 s after a
bottom touch and PiP. Under lmkd pressure (kills down to adj 50, bottom
home killed 14-31 times per run) neither build lost the top spot.
* test(session): A/B tool for the keep-top guard on rooted dual screens, with Duo findings
* test(session): the guard A/B tool stops on a failed session start and cleans up an interrupted pressure run