Update to 8.1.2 (2432)

This commit is contained in:
xaxtix 2021-09-27 19:38:27 +03:00
parent 58aded63e9
commit 09f95ec069
15 changed files with 94 additions and 51 deletions

View file

@ -130,8 +130,6 @@ public class NotificationsController extends BaseController {
private int notificationId;
private String notificationGroup;
private int lastInternalNotificationId;
static {
if (Build.VERSION.SDK_INT >= 26 && ApplicationLoader.applicationContext != null) {
notificationManager = NotificationManagerCompat.from(ApplicationLoader.applicationContext);
@ -158,8 +156,6 @@ public class NotificationsController extends BaseController {
public NotificationsController(int instance) {
super(instance);
lastInternalNotificationId = instance * 1000000 + 5000;
notificationId = currentAccount + 1;
notificationGroup = "messages" + (currentAccount == 0 ? "" : currentAccount);
SharedPreferences preferences = getAccountInstance().getNotificationsSettings();
@ -3892,7 +3888,10 @@ public class NotificationsController extends BaseController {
arrayList.add(messageObject);
}
LongSparseArray<Integer> oldIdsWear = wearNotificationsIds.clone();
LongSparseArray<Integer> oldIdsWear = new LongSparseArray<>();
for (int i = 0; i < wearNotificationsIds.size(); i++) {
oldIdsWear.put(wearNotificationsIds.keyAt(i), wearNotificationsIds.valueAt(i));
}
wearNotificationsIds.clear();
class NotificationHolder {
@ -3914,7 +3913,7 @@ public class NotificationsController extends BaseController {
void call() {
if (BuildVars.LOGS_ENABLED) {
FileLog.w("show dialog notification with id " + id);
FileLog.w("show dialog notification with id " + id + " " + dialogId + " user=" + user + " chat=" + chat);
}
try {
notificationManager.notify(id, notification.build());
@ -3947,7 +3946,7 @@ public class NotificationsController extends BaseController {
Integer internalId = oldIdsWear.get(dialogId);
if (internalId == null) {
internalId = lastInternalNotificationId++;
internalId = (int) dialogId + (int) (dialogId >> 32);
} else {
oldIdsWear.remove(dialogId);
}