Injecting screen_on event to make sensors work whe

2020-06-25 04:27发布

I am trying to make sensors work when screen is off. It is well known bug. And there is no any soution for this on all phones. I have the hypothesis that i can can cheat kernel if I send(inject) screen_on event while actually the screen will be turned off. Do you have any ideas how can i check my hypothesis and inject such event?

1条回答
干净又极端
2楼-- · 2020-06-25 05:02

Why don't you start a background service that monitors the sensors?

And then send/use the results back to your application's activities. Your activity will still pause when screen goes off, but you will continue to read the sensor data.

Also a good idea to do the heavy processing the background service as well...

This works great for me.

查看更多
登录 后发表回答