Invert if statement to bail early.
This commit is contained in:
parent
7329dc5d8d
commit
d2ef357403
@ -189,30 +189,33 @@ class NotificationHelper {
|
|||||||
notificationManager.cancel(entry.getUniqueKey(), NOTIFY_ID_INSTALLED);
|
notificationManager.cancel(entry.getUniqueKey(), NOTIFY_ID_INSTALLED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (notificationManager.areNotificationsEnabled()) {
|
|
||||||
Notification notification;
|
if (!notificationManager.areNotificationsEnabled()) {
|
||||||
if (entry.status == AppUpdateStatusManager.Status.Installed) {
|
return;
|
||||||
if (useStackedNotifications()) {
|
}
|
||||||
notification = createInstalledNotification(entry);
|
|
||||||
notificationManager.cancel(entry.getUniqueKey(), NOTIFY_ID_UPDATES);
|
Notification notification;
|
||||||
notificationManager.notify(entry.getUniqueKey(), NOTIFY_ID_INSTALLED, notification);
|
if (entry.status == AppUpdateStatusManager.Status.Installed) {
|
||||||
} else if (installed.size() == 1) {
|
if (useStackedNotifications()) {
|
||||||
notification = createInstalledNotification(entry);
|
notification = createInstalledNotification(entry);
|
||||||
notificationManager.cancel(entry.getUniqueKey(), NOTIFY_ID_UPDATES);
|
notificationManager.cancel(entry.getUniqueKey(), NOTIFY_ID_UPDATES);
|
||||||
notificationManager.cancel(entry.getUniqueKey(), NOTIFY_ID_INSTALLED);
|
notificationManager.notify(entry.getUniqueKey(), NOTIFY_ID_INSTALLED, notification);
|
||||||
notificationManager.notify(GROUP_INSTALLED, NOTIFY_ID_INSTALLED, notification);
|
} else if (installed.size() == 1) {
|
||||||
}
|
notification = createInstalledNotification(entry);
|
||||||
} else {
|
notificationManager.cancel(entry.getUniqueKey(), NOTIFY_ID_UPDATES);
|
||||||
if (useStackedNotifications()) {
|
notificationManager.cancel(entry.getUniqueKey(), NOTIFY_ID_INSTALLED);
|
||||||
notification = createUpdateNotification(entry);
|
notificationManager.notify(GROUP_INSTALLED, NOTIFY_ID_INSTALLED, notification);
|
||||||
notificationManager.cancel(entry.getUniqueKey(), NOTIFY_ID_INSTALLED);
|
}
|
||||||
notificationManager.notify(entry.getUniqueKey(), NOTIFY_ID_UPDATES, notification);
|
} else {
|
||||||
} else if (updates.size() == 1) {
|
if (useStackedNotifications()) {
|
||||||
notification = createUpdateNotification(entry);
|
notification = createUpdateNotification(entry);
|
||||||
notificationManager.cancel(entry.getUniqueKey(), NOTIFY_ID_UPDATES);
|
notificationManager.cancel(entry.getUniqueKey(), NOTIFY_ID_INSTALLED);
|
||||||
notificationManager.cancel(entry.getUniqueKey(), NOTIFY_ID_INSTALLED);
|
notificationManager.notify(entry.getUniqueKey(), NOTIFY_ID_UPDATES, notification);
|
||||||
notificationManager.notify(GROUP_UPDATES, NOTIFY_ID_UPDATES, notification);
|
} else if (updates.size() == 1) {
|
||||||
}
|
notification = createUpdateNotification(entry);
|
||||||
|
notificationManager.cancel(entry.getUniqueKey(), NOTIFY_ID_UPDATES);
|
||||||
|
notificationManager.cancel(entry.getUniqueKey(), NOTIFY_ID_INSTALLED);
|
||||||
|
notificationManager.notify(GROUP_UPDATES, NOTIFY_ID_UPDATES, notification);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user