Prevent call notifications from blinking
This commit is contained in:
parent
0cda463087
commit
d6a417171a
2 changed files with 28 additions and 0 deletions
|
@ -29,11 +29,15 @@ public class Notifiable {
|
|||
private String mGroupTitle;
|
||||
private String mLocalIdentity;
|
||||
private String mMyself;
|
||||
private int iconId;
|
||||
private int textId;
|
||||
|
||||
public Notifiable(int id) {
|
||||
mNotificationId = id;
|
||||
mMessages = new ArrayList<>();
|
||||
mIsGroup = false;
|
||||
iconId = 0;
|
||||
textId = 0;
|
||||
}
|
||||
|
||||
public int getNotificationId() {
|
||||
|
@ -83,4 +87,20 @@ public class Notifiable {
|
|||
public void setLocalIdentity(String localIdentity) {
|
||||
mLocalIdentity = localIdentity;
|
||||
}
|
||||
|
||||
public int getIconResourceId() {
|
||||
return iconId;
|
||||
}
|
||||
|
||||
public void setIconResourceId(int id) {
|
||||
iconId = id;
|
||||
}
|
||||
|
||||
public int getTextResourceId() {
|
||||
return textId;
|
||||
}
|
||||
|
||||
public void setTextResourceId(int id) {
|
||||
textId = id;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -341,6 +341,14 @@ public class NotificationsManager {
|
|||
break;
|
||||
}
|
||||
|
||||
if (notif.getIconResourceId() == iconId
|
||||
&& notif.getTextResourceId() == notificationTextId) {
|
||||
// Notification hasn't changed, do not "update" it to avoid blinking
|
||||
return;
|
||||
}
|
||||
notif.setIconResourceId(iconId);
|
||||
notif.setTextResourceId(notificationTextId);
|
||||
|
||||
LinphoneContact contact = ContactsManager.getInstance().findContactFromAddress(address);
|
||||
Uri pictureUri = contact != null ? contact.getPhotoUri() : null;
|
||||
Bitmap bm = ImageUtils.getRoundBitmapFromUri(mContext, pictureUri);
|
||||
|
|
Loading…
Reference in a new issue