变化与QUOT;脉冲通知灯"在Android /轨迹球光设置(Nexus One的唯一?)脉冲、化与、通知、轨迹球

2023-09-06 17:45:45 作者:乐观而坚强

在Nexus One的(至少在2.1 UPDATE1,我认为在2.1),有声音和放大器下的设置;显示:脉通知指示灯。但这似乎不是在2.1与谷歌API的仿真图像present。我还没有检查任何其它设备。

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.

我要将此编程方式,而无需用户交互,以使一个区域设置的插件,因此该器件能抓住我的注意,当我醒了我的办公桌上,而无需其泛光照明的房间时,有人在凌晨4点修建垃圾我。这是相当光明的。

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.

我没有看到它在 android.provider.Settings.System 其中,在此屏幕上许多其他的事情生活,所以我不得不在平台源看看。有在NotificationManagerService一些相关部分,在 enqueueNotificationWithTag 和 updateLightsLocked 。那熄灭成 HardwareService 这似乎早已过关心用户设置的点。我不知道在哪里这个设置实施或如何我可能会影响它。

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.

我完全相信,答案是没有API的这个(或许与此相关的是Nexus One的具体的),那最好的,我能做的就是安排(使用区域设置或别的东西)的意向< A HREF =htt​​p://developer.android.com/reference/android/provider/Settings.html#ACTION_DISPLAY_SETTINGS相对=nofollow> ACTION_DISPLAY_SETTINGS 提醒我要手动设置框,它会吸。我希望,我已经错过了一些东西,或者一个Google员工在读这并能告诉我,这是计划除了API?

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?

推荐答案

我知道我会痛苦死的利用未公开的API(或者更确切地说,无证系统设置名称),但这里是魔线:

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:

android.provider.Settings.System.putInt(context.getContentResolver(),
        "notification_light_pulse", on ? 1 : 0);

使用找到 sqlite3的在我自己的设备。

下面是该解决方案的一个方便的区域设置插件: http://chris.boyle.name/projects/ ptlp

Here is this solution in a convenient Locale plugin: http://chris.boyle.name/projects/ptlp

 
精彩推荐