Skip to content

Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.

docs: the HyperOS 3 power key and the 2 s force-stop after a screen-off (#2869)

xbsheng672195d00c46
diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md
index 4662ac79a..c59413355 100644
--- a/docs/TROUBLESHOOTING.md
+++ b/docs/TROUBLESHOOTING.md
@@ -1553,6 +1553,57 @@ count on reaching Settings by hand. `examples/xiaomi-mitv-aesp0` is the one list
package (its second set, in daily use since 21 Oct 2026); carrying that line to a set whose settings app
is Xiaomi's takes Settings with it.
+## Xiaomi HyperOS 3: the power key does nothing, and music stops when the screen goes off
+
+Two faults with one cause on a Xiaomi set running HyperOS 3: a short press of the remote's power button
+is not the framework's, and a screen that goes off force-stops every app the owner installed two seconds
+later. Both were read out of `services.jar` (baksmali) and logcat on a MiTV-MFFU0 (Xiaomi TV S Pro 100,
+`finch`, Android 14 / HyperOS 3, `OS3.0.115.0.UFFMATV`, MediaTek mt5877), and reported with the logcat
+lines in [issue #2869](https://github.com/Gathin23/cleanyourtv/issues/2869).
+
+The power key emits a plain `KEYCODE_POWER` and the framework's short-press policy is
+`SHORT_PRESS_POWER_GO_XIAOAI_MODE`: `KEYCODE_SLEEP` has no effect on it and `mWakefulness` stays awake.
+What turns the screen off is the stock launcher (PatchWall, `com.mitv.tvhome`) together with the two
+screensaver packages, `com.xiaomi.mitv.aod.screensaver` and `com.xiaomi.mitv.hyper.screensaver`, which
+render the off screen. Disable PatchWall - which the launcher install in
+[`examples/xiaomi-mitv-mffu0`](../examples/xiaomi-mitv-mffu0/debloat.txt) needs - and the power button no
+longer turns the TV off; disable either screensaver package and nothing renders the off screen. The same
+build also needs `aod_current_pattern_id` at 107 (music CD) or 108 (music tape): at 110 (lyrics) the
+receiver logs its way to "nothing to do" and the panel never turns off. `mitv.short.power.action`
+(`Settings.System`) chooses 0 screen off (the default, instant wake), 1 standby (deep, and it cuts
+audio) or 2 shutdown, so raising it to 1 to "fix" a screen that will not go off turns screen-off into a
+set that looks powered off.
+
+Screen off also takes the owner's apps with it, unless Xiaomi's cloud rule file says otherwise:
+
+```sh
+tools/tv.py 'logcat -d | grep killAllThirdApp'
+# MitvActivityManagerService: PowerManagerService killAllThirdApp forcestop packageName:com.lxmusic.tv
+```
+
+`MitvPowerManagerService.gotoSleepStayAliveProcess` runs from the screen-off broadcast and asks
+`MitvConfigParser` for bit `0x8000` in `/data/system/mitv_security_center.xml`: a foreground app that
+file names is kept, anything else gets the launcher brought to the front and a thread that sleeps two
+seconds and calls `killAllThirdApp`. The file is pushed by cloud control and cannot be written from the
+shell, and the apps it names are the stock ones (QQ Music TV among them), so a third-party player loses
+its audio about two seconds after the screen goes off.
+
+The firmware carries an off switch for that path: with `Settings.Global disable_back_home_whitelist` set
+to `disable`, the sleep routine returns before any of it runs.
+
+```sh
+tools/tv.py 'settings put global disable_back_home_whitelist disable'
+tools/tv.py 'logcat -d | grep gotoSleepStayAliveProcess' # expect: ... feature disable
+```
+
+It is a stock settings key, so it survives a reboot, and `settings delete global
+disable_back_home_whitelist` puts the behaviour back. The system then stops forcing the launcher to the
+front on screen-off too, which a third-party home screen wants anyway and a set still on its stock home
+screen would notice.
+
+Both faults are this one build: another Xiaomi firmware may handle screen-off somewhere else and answer
+neither, and no second unit has been reported.
+
## Settings freezes, then closes, in Accessibility
The highlight passes over Accessibility > Text-to-speech output and Settings stops responding; a few seconds
diff --git a/examples/xiaomi-mitv-mffu0/debloat.txt b/examples/xiaomi-mitv-mffu0/debloat.txt
index 8c34e8b61..67db01269 100644
--- a/examples/xiaomi-mitv-mffu0/debloat.txt
+++ b/examples/xiaomi-mitv-mffu0/debloat.txt
@@ -48,6 +48,11 @@
# (com.xiaomi.miplay, com.xiaomi.mitv.smartshare, com.xiaomi.mi_connect_service,
# com.xiaomi.hyper_connect.tv), Mi Home (com.xiaomi.smarthome.tv), firmware updates
# (com.xiaomi.mitv.upgrade), the Hyper screensaver (com.xiaomi.mitv.hyper.screensaver, com.xiaomi.tweather).
+# - com.mitv.tvhome takes the short-press power key on this build, and the two screensaver packages
+# (com.xiaomi.mitv.aod.screensaver, com.xiaomi.mitv.hyper.screensaver) draw the off screen: with the stock
+# launcher disabled as the Home section below does, the power button stops turning the TV off. The chain,
+# and the 2 s force-stop of every installed app that follows a screen-off with the settings key that
+# stops it: docs/TROUBLESHOOTING.md#xiaomi-hyperos-3-the-power-key-does-nothing-and-music-stops-when-the-screen-goes-off
# - A black screen right after a reboot with an HDMI-CEC set-top box plugged in is the box's CEC
# "active source" switching the TV to its port (HdmiCecLocalDeviceTv), not this list. Home brings
# the TV back; turning HDMI device control (CEC) off in the input settings stops it.