在Android应用程序之间的LED通知优先 [英] LED Notification priority between applications in Android

查看:197
本文介绍了在Android应用程序之间的LED通知优先的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能确定优先为我这种方式的LED通知我的应用程序将取代已经存在这是由另一个应用程序设置LED通知? 例如,当收到邮件的Gmail客户端将设置白色闪烁LED通知,所以,当我的应用程序试图建立另一个通知,例如绿持久的系统忽略,直到第一个走了。是否有可能改变系统的行为,以显示我排在首位LED通知?我知道,在16 API中引入优先标志,但看起来不会改变通知的订单......

Is it possible to define priority for my LED notification in such way that my application will replace already existed LED notification which was set by another application? For example when email is received Gmail client will set white-blink LED notification, so when my app trying to set another notification, for example green-persistent the system is ignoring it until first is gone. Is it possible to change system's behavior to show my LED notification in first place? I know that in API 16 was introduced a "priority" flag, but looks like it doesn't change the order of notifications....

推荐答案

没有,优先级不会影响LED。也许它应该,但今天的LED如下算法:

No, the priority doesn't affect the LED. Maybe it should, but today the LED follows this algorithm:

  1. 在通知N1进来想要设置的LED(与FLAG_SHOW_LIGHTS):

  1. When a notification N1 comes in that wants to set the LED (with FLAG_SHOW_LIGHTS):

a)如果没有其他活动的通知,要求一个LED时,LED连接到N1 N1之前取消(或更新删除其LED标志)。

a) If there are no other active notifications requesting an LED, the LED is attached to N1 until N1 is canceled (or updated to remove its LED flags).

b)若该LED已被另一个通知使用,N1进入到灯队列的前面(!)。

b) If the LED is already in use by another notification, N1 goes to the front (!) of the lights queue.

当使用该LED的通知被取消时,所述通知在所述灯队列前面给出的控制的LED,直到它被取消(或更新以除去其LED标志)。

When a notification using the LED is canceled, the notification at the front of the lights queue is given control of the LED until it is canceled (or updated to remove its LED flags).

所以这是后进先出,但黏性(即无论有LED保持它,直到它消失了)。

So it's last-in-first-out, but sticky (i.e. whatever has the LED keeps it until it's gone).

这篇关于在Android应用程序之间的LED通知优先的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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