Skip to content

Commit 84a000b

Browse files
author
alex-hermes-agent
committed
feat(v1.23): re-blackout on onPause instant gate-shove (closes 150-300ms exposure per spam-press) + poll release fuse for HOME-from-gate
1 parent 0b476a2 commit 84a000b

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ android {
1515
applicationId = "com.alexk.tvlock"
1616
minSdk = 21
1717
targetSdk = 34
18-
versionCode = 23
19-
versionName = "1.22"
18+
versionCode = 24
19+
versionName = "1.23"
2020
}
2121

2222
if (!releaseKeystore.isNullOrBlank()) {

app/src/main/java/com/alexk/tvlock/LockPollService.kt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ class LockPollService : Service() {
105105
GateOverlay.hide()
106106
}
107107

108+
// Release fuse for the onPause re-blackout: if the gate is down, an
109+
// overlay is up, and NEITHER the gate nor a blocked app is on top
110+
// (parent pressed HOME from the gate → launcher), nothing is being
111+
// guarded — let the screen live again right away.
112+
if (!gateUp && GateOverlay.isShown && t != packageName && t !in blocked) {
113+
FileLogger.log("overlay release: top=$t, no gate, nothing blocked")
114+
GateOverlay.hide()
115+
}
116+
108117
// watchdog: a gate we raised must actually be on screen
109118
if (gateUp) {
110119
if (t == packageName) {
@@ -268,7 +277,13 @@ class LockPollService : Service() {
268277
fun onGateDismissed() {
269278
gateUp = false
270279
blackoutHold = false
271-
GateOverlay.hide() // never trap a black screen over a non-blocked screen
280+
// The gate was shoved aside (a dedicated-button relaunch lands on top
281+
// of it). onPause fires the same instant the shove happens — far ahead
282+
// of any poll detection — so re-blackout RIGHT NOW instead of exposing
283+
// the app for the 150-300 ms until the next DETECT. show() is a no-op
284+
// when the overlay is already up; the re-raise of the gate then hides
285+
// it again the moment the PIN is confirmed on top.
286+
GateOverlay.show(applicationContext, System.currentTimeMillis())
272287
}
273288

274289
/** Self-heal if the ROM kills the FGS: re-arm every 5 min via AlarmManager. */

0 commit comments

Comments
 (0)