PhoneStateListener.onSignalStrengthsChanged\ 在待机的时候不工作

山娃马小三儿 2011-04-14 08:09:21
写了一个服务监控基站变化,用一个activity调用一个service,在service的oncreate事件里生命了一个PhoneStateListener,然后重写他的onCellLocationChanged和onSignalStrengthsChanged事件,程序可以正常运行,但是一旦手机关掉屏幕,就不工作了,打开屏幕后,继续工作,已经wakelock了PowerManager.PARTIAL_WAKE_LOCK,其他功能还能正常运行,不如接收wifi的扫描结果,这个结果还是不停变化的,说明手机并没有进入sleep模式,但是怎么使PhoneStateListener正常工作
...全文
352 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
山娃马小三儿 2011-07-22
  • 打赏
  • 举报
回复
好久不来,有办法了没
说谎的匹诺曹 2011-04-20
  • 打赏
  • 举报
回复
2.2之前的版本是可以的哦,我在真机上测试过的
山娃马小三儿 2011-04-20
  • 打赏
  • 举报
回复
我的2.1也不行
说谎的匹诺曹 2011-04-19
  • 打赏
  • 举报
回复
好像没人知道啊
山娃马小三儿 2011-04-19
  • 打赏
  • 举报
回复
/* Indicates the current state of the screen. When the screen is off, the
* RIL should notify the baseband to suppress certain notifications (eg,
* signal strength and changes in LAC or CID) in an effort to conserve power.
* These notifications should resume when the screen is on.
山娃马小三儿 2011-04-19
  • 打赏
  • 举报
回复
这个解决不了,google已经说了,在待机的时候,确实不更新cellid和signalstrength等,另想其他方法吧,或者更改RIL
说谎的匹诺曹 2011-04-18
  • 打赏
  • 举报
回复
遇到类似的问题了 PhoneStateListener\ 在待机的时候不工作

求高手指点啊

80,351

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧