forked from mirror/monocles_chat_clean
fix in call notification being shown twice
(cherry picked from commit bfccfba00e724953adf51018c692f923a59bbd00)
This commit is contained in:
parent
0cd01bcaed
commit
fa691e68a3
1 changed files with 6 additions and 3 deletions
|
@ -1516,17 +1516,20 @@ public class XmppConnectionService extends Service {
|
|||
final OngoingCall ongoing = ongoingCall.get();
|
||||
if (force || mForceDuringOnCreate.get() || mForceForegroundService.get() || ongoing != null || (Compatibility.keepForegroundService(this) && hasEnabledAccounts())) {
|
||||
final Notification notification;
|
||||
final int id;
|
||||
if (ongoing != null) {
|
||||
notification = this.mNotificationService.getOngoingCallNotification(ongoing.id, ongoing.media);
|
||||
startForeground(NotificationService.ONGOING_CALL_NOTIFICATION_ID, notification);
|
||||
id = NotificationService.ONGOING_CALL_NOTIFICATION_ID;
|
||||
startForeground(id, notification);
|
||||
mNotificationService.cancel(NotificationService.FOREGROUND_NOTIFICATION_ID);
|
||||
} else {
|
||||
notification = this.mNotificationService.createForegroundNotification();
|
||||
startForeground(NotificationService.FOREGROUND_NOTIFICATION_ID, notification);
|
||||
id = NotificationService.FOREGROUND_NOTIFICATION_ID;
|
||||
startForeground(id, notification);
|
||||
}
|
||||
|
||||
if (!mForceForegroundService.get()) {
|
||||
mNotificationService.notify(NotificationService.FOREGROUND_NOTIFICATION_ID, notification);
|
||||
mNotificationService.notify(id, notification);
|
||||
}
|
||||
status = true;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue