try to fix bad notification bug (Christian Schneppe)
This commit is contained in:
parent
5df0e38e42
commit
d87c6df2d8
6 changed files with 9 additions and 8 deletions
BIN
playstore/release/monocles chat-1.5.2null-playstore-release.aab
Normal file
BIN
playstore/release/monocles chat-1.5.2null-playstore-release.aab
Normal file
Binary file not shown.
|
@ -111,6 +111,7 @@ public class NotificationService {
|
|||
public static final int MISSED_CALL_NOTIFICATION_ID = NOTIFICATION_ID_MULTIPLIER * 14;
|
||||
public static final int IMPORT_BACKUP_NOTIFICATION_ID = NOTIFICATION_ID_MULTIPLIER * 16;
|
||||
public static final int EXPORT_BACKUP_NOTIFICATION_ID = NOTIFICATION_ID_MULTIPLIER * 18;
|
||||
public static final int UPDATE_NOTIFICATION_ID = NOTIFICATION_ID_MULTIPLIER * 20;
|
||||
private final XmppConnectionService mXmppConnectionService;
|
||||
private final LinkedHashMap<String, ArrayList<Message>> notifications = new LinkedHashMap<>();
|
||||
private final LinkedHashMap<Conversational, MissedCallsInfo> mMissedCalls = new LinkedHashMap<>();
|
||||
|
@ -1772,7 +1773,7 @@ public class NotificationService {
|
|||
}
|
||||
|
||||
public void AppUpdateServiceNotification(Notification notification) {
|
||||
notify(FOREGROUND_NOTIFICATION_ID, notification);
|
||||
notify(UPDATE_NOTIFICATION_ID, notification);
|
||||
}
|
||||
|
||||
private void notify(String tag, int id, Notification notification) {
|
||||
|
|
|
@ -2591,7 +2591,7 @@ public class XmppConnectionService extends Service {
|
|||
getNotificationService().clear(conversation);
|
||||
conversation.setStatus(Conversation.STATUS_ARCHIVED);
|
||||
conversation.setNextMessage(null);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
if (Compatibility.runsTwentySix()) {
|
||||
try {
|
||||
mNotificationService.cleanNotificationChannels(this, conversation.getUuid());
|
||||
} catch (Exception e) {
|
||||
|
@ -2779,7 +2779,7 @@ public class XmppConnectionService extends Service {
|
|||
for (final Conversation conversation : conversations) {
|
||||
if (conversation.getAccount() == account) {
|
||||
if (conversation.getMode() == Conversation.MODE_MULTI) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
if (Compatibility.runsTwentySix()) {
|
||||
try {
|
||||
mNotificationService.cleanNotificationChannels(this, conversation.getUuid());
|
||||
} catch (Exception e) {
|
||||
|
@ -3448,7 +3448,7 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
|
||||
private void leaveMuc(Conversation conversation, boolean now) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
if (Compatibility.runsTwentySix()) {
|
||||
try {
|
||||
mNotificationService.cleanNotificationChannels(this, conversation.getUuid());
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -47,10 +47,6 @@ public class Compatibility {
|
|||
return Build.VERSION.SDK_INT < Build.VERSION_CODES.M || (ContextCompat.checkSelfPermission(context, android.Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED && ContextCompat.checkSelfPermission(context, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED);
|
||||
}
|
||||
|
||||
public static boolean runsTwentySix() {
|
||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
|
||||
}
|
||||
|
||||
public static boolean runsTwentyThree() {
|
||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;
|
||||
}
|
||||
|
@ -59,6 +55,10 @@ public class Compatibility {
|
|||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.N;
|
||||
}
|
||||
|
||||
public static boolean runsTwentySix() {
|
||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
|
||||
}
|
||||
|
||||
public static boolean runsTwentyEight() {
|
||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.P;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue