I want the Android device to wake up from sleep or, nevertheless, a state in which the phone gets a certain amount of inactivity when the screen goes dark by detecting a touch on the screen, rather than pressing any button.
In the documentation, the only thing I found was the FLAG_TOUCHABLE_WHEN_WAKING flag in WindowManager.LayoutParams, and it says:
Window check box: if set, if the device is sleeping when the touch screen is pressed, you will receive this first-touch event. Usually, the first touch event is consumed by the system since the user cannot see what they are clicking.
I thought that means that if the deviceβs screen is turned off and this flag is set to Activity, it will wake up to the touch (this is exactly what I want to do). Do I really not understand the purpose of this flag? Are there any additional implementation details that I ignore? Is there another way?
source share