注射screen_on事件,使传感器工作时,屏幕关闭 [英] Injecting screen_on event to make sensors work when screen is off

查看:114
本文介绍了注射screen_on事件,使传感器工作时,屏幕关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使传感器工作时,屏幕关闭。这是众所周知的bug。而且也没有对所有手机的任何soution这一点。我有,我可以可以欺骗内核,如果我送(注入)screen_on事件,而实际上该屏幕将被关闭的假设。你有什么想法如何查看我的假说,并注入这样的活动吗?

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?

推荐答案

你为什么不开始的后台服务

,然后发送/使用回您的应用程序的活动的结果。 您的活动将仍然暂停时,屏幕熄灭,但你会继续读取传感器数据。

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...

这对我的伟大工程。

这篇关于注射screen_on事件,使传感器工作时,屏幕关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆