mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-25 15:56:01 +00:00
fix(session): remove the keep-top guard from other displays (#2937)
* 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
This commit is contained in:
1 parent
acb2cba970
commit
d0022a35f9
11 files changed
+149
-380
No files matched your search
@@ -66,6 +66,15 @@ class DumpParsingTest(unittest.TestCase):
|
||||
def test_the_bottom_home_is_the_visible_home_on_another_display(self):
|
||||
self.assertEqual((2, "rip.moth.cocoonshell"), ab.bottom_home(ACTIVITIES, 0))
|
||||
|
||||
def test_android_13_activity_records_are_counted(self):
|
||||
self.assertEqual(1, ab.session_count(
|
||||
" * Hist #1: ActivityRecord{e1ec207 u0 com.droiddeck.launcher/.SessionActivity} t14519}\n"))
|
||||
|
||||
def test_the_visible_app_stands_in_when_no_home_is_on_the_other_display(self):
|
||||
dump = ("Display #4 (activities from top to bottom):\n"
|
||||
" * Task{21f60d6 #14493 type=standard A=10113:com.discord U=0 visible=true visibleRequested=true mode=fullscreen}\n")
|
||||
self.assertEqual((4, "com.discord"), ab.bottom_home(dump, 0))
|
||||
|
||||
def test_no_bottom_home_without_another_display(self):
|
||||
self.assertIsNone(ab.bottom_home(ACTIVITIES.split("\n\n")[1], 0))
|
||||
|
||||
@@ -80,6 +89,25 @@ class DumpParsingTest(unittest.TestCase):
|
||||
self.assertIsNone(ab.logical_size(DISPLAYS, 5))
|
||||
|
||||
|
||||
class HogScriptTest(unittest.TestCase):
|
||||
def test_both_modes_start_the_fill_counter(self):
|
||||
script = ab.HOG.splitlines()
|
||||
counter = next(n for n, line in enumerate(script) if line.startswith("i=0"))
|
||||
self.assertLess(counter, script.index('if [ "$mode" = burst ]; then'))
|
||||
self.assertLess(counter, next(n for n, line in enumerate(script) if line.startswith("while [ $i -lt 512 ]")))
|
||||
|
||||
|
||||
def test_a_failed_write_never_reports_released(self):
|
||||
script = ab.HOG.splitlines()
|
||||
check = script.index('[ "$failed" = 0 ] || { echo "write failed"; cleanup; exit 1; }')
|
||||
self.assertLess(check, script.index("echo released"))
|
||||
self.assertIn("failed=1", ab.HOG.split("echo released")[0])
|
||||
|
||||
def test_a_burst_takes_the_remainder_below_one_chunk(self):
|
||||
self.assertIn("rest=$((take % 256))", ab.HOG)
|
||||
self.assertIn('echo "nothing to take"', ab.HOG)
|
||||
|
||||
|
||||
class SummaryTest(unittest.TestCase):
|
||||
def test_max_adj_skips_samples_after_death(self):
|
||||
self.assertEqual(50, ab.max_adj(["0", "50", "DEAD", ""]))
|
||||
|
||||
Reference in new issue
Block a user