Is it possible to get a device to wake up from sleep (screen dark) by detecting a touch to the screen?

后端 未结 1 638
有刺的猬
有刺的猬 2021-02-09 17:45

I want to get an android device to wake up from sleep or however the state in which the phone gets after a certain amount of inactivity when the screen goes dark, by detecting a

1条回答
  •  说谎
    说谎 (楼主)
    2021-02-09 18:20

    Am I misunderstanding the purpose of this flag?

    AFAIK, yes. There is a slice of time between when the screen turns off and when the device falls asleep. During this time, if the user touches the screen someplace where the window has this flag, the screen turns on again and the inactivity timer is reset.

    I can find no other use of this flag in the Android source code.

    Is there some other way?

    No. If the device is asleep, touch screen events are not registered.

    0 讨论(0)
提交回复
热议问题