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 mGroupTitle;
|
||||||
private String mLocalIdentity;
|
private String mLocalIdentity;
|
||||||
private String mMyself;
|
private String mMyself;
|
||||||
|
private int iconId;
|
||||||
|
private int textId;
|
||||||
|
|
||||||
public Notifiable(int id) {
|
public Notifiable(int id) {
|
||||||
mNotificationId = id;
|
mNotificationId = id;
|
||||||
mMessages = new ArrayList<>();
|
mMessages = new ArrayList<>();
|
||||||
mIsGroup = false;
|
mIsGroup = false;
|
||||||
|
iconId = 0;
|
||||||
|
textId = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getNotificationId() {
|
public int getNotificationId() {
|
||||||
|
@ -83,4 +87,20 @@ public class Notifiable {
|
||||||
public void setLocalIdentity(String localIdentity) {
|
public void setLocalIdentity(String localIdentity) {
|
||||||
mLocalIdentity = 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;
|
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);
|
LinphoneContact contact = ContactsManager.getInstance().findContactFromAddress(address);
|
||||||
Uri pictureUri = contact != null ? contact.getPhotoUri() : null;
|
Uri pictureUri = contact != null ? contact.getPhotoUri() : null;
|
||||||
Bitmap bm = ImageUtils.getRoundBitmapFromUri(mContext, pictureUri);
|
Bitmap bm = ImageUtils.getRoundBitmapFromUri(mContext, pictureUri);
|
||||||
|
|
Loading…
Reference in a new issue