将“脉冲通知灯”更改为/ Android 上的轨迹球灯设置(仅限 Nexus One?)
在 Nexus One 上(至少在 2.1-update1 中,我认为在 2.1 中),“声音和声音”下有一个设置。显示:“脉冲通知灯”。这似乎并不存在于“2.1 with Google APIs”模拟器映像中。我还没有检查过任何其他设备。
脉冲通知灯:重复脉冲轨迹球灯以获取新通知http://chris.boyle.name/images/20100206-pulse-trackball.png
我想以编程方式设置此功能而无需用户交互,以便制作一个区域设置插件,所以当我醒在办公桌前时,该设备可以吸引我的注意力,而不会在凌晨 4 点有人向我发送垃圾邮件时让它照亮整个房间。非常明亮。
我没有在 android.provider.Settings.System 这个屏幕上还有很多其他东西,所以我查看了平台源代码。在NotificationManagerService中有一些相关部分,位于enqueueNotificationWithTag 和 updateLightsLocked。这进入 HardwareService 似乎远远超出了关心用户设置的范围。我不知道这个设置是在哪里实现的,也不知道我会如何影响它。
我完全希望答案是“没有这方面的 API”(可能与 Nexus One 特定有关),并且我能做的最好的事情就是安排(使用区域设置或其他方式)ACTION_DISPLAY_SETTINGS 提醒我手动设置该框,这很糟糕。我希望我错过了一些东西,或者 a Google 员工正在阅读这篇文章,可以告诉我这是计划添加到 API 中的吗?
On the Nexus One (at least in 2.1-update1, and I think in 2.1), there is a setting under Sound & Display: "Pulse notification light". This doesn't seem to be present on the "2.1 with Google APIs" emulator image. I've not yet checked any other devices.
I want to set this programmatically without user interaction, in order to make a Locale plugin, so the device can grab my attention when I'm awake at my desk, without having it floodlighting the room when someone spams me at 4am. It's quite bright.
I didn't see it in android.provider.Settings.System where many other things on this screen live, so I had a look in the platform source. There are some relevant parts in NotificationManagerService, in enqueueNotificationWithTag and updateLightsLocked. That goes off into HardwareService which seems well past the point of caring about user settings. I've no idea where this setting is implemented or how I might influence it.
I fully expect the answer to be "there is no API for this" (perhaps related to it being Nexus One specific), and that the best I can do is to schedule (using Locale or something else) an Intent of ACTION_DISPLAY_SETTINGS to remind me to set the box manually, which would suck. I'm hoping that I've missed something, or that a Googler is reading this and can tell me that this is planned for addition to the API?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道我会因为使用未记录的 API(或者更确切地说,未记录的系统设置名称)而痛苦地死去,但这里有一条神奇的线:
在我自己的设备上使用
sqlite3
找到的。这是一个方便的区域设置插件中的解决方案: http://chris.boyle.name/projects/ptlp< /a>
I know I'm going to die painfully for using an undocumented API (or rather, undocumented system setting name), but here is the magic line:
Found using
sqlite3
on my own device.Here is this solution in a convenient Locale plugin: http://chris.boyle.name/projects/ptlp