@@ -4,7 +4,6 @@ import android.os.Build
44import android.os.Bundle
55import android.os.Handler
66import android.os.Looper
7- import android.view.MotionEvent
87import android.view.WindowManager
98import eu.darken.bluemusic.common.ui.Activity2
109
@@ -25,6 +24,10 @@ class ScreenWakeActivity : Activity2() {
2524 // launched (typically the music app) before system display timeout fires.
2625 // FLAG_KEEP_SCREEN_ON is dropped automatically when the activity finishes.
2726 window.addFlags(WindowManager .LayoutParams .FLAG_KEEP_SCREEN_ON )
27+ // This activity is visually transparent, so it must not consume the first
28+ // tap or swipe after wake. Let touches pass through to the lockscreen or
29+ // launched app underneath while the timer controls our own lifetime.
30+ window.addFlags(WindowManager .LayoutParams .FLAG_NOT_TOUCHABLE )
2831 }
2932
3033 override fun onResume () {
@@ -37,13 +40,6 @@ class ScreenWakeActivity : Activity2() {
3740 Handler (Looper .getMainLooper()).postDelayed(::finish, HOLD_DURATION_MS )
3841 }
3942
40- override fun dispatchTouchEvent (ev : MotionEvent ): Boolean {
41- // The user is interacting now — get out of their way immediately. The host app
42- // they tapped will keep the screen on naturally from here.
43- finish()
44- return true
45- }
46-
4743 companion object {
4844 // Long enough to read the screen and tap a launched music app; short enough
4945 // not to drain battery on a forgotten connection. Single tunable constant.
0 commit comments