Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56aac804 authored by Chiachang Wang's avatar Chiachang Wang Committed by android-build-merger
Browse files

Merge "Replace limited connectivity notification after detecting it" am: b6482348 am: 7cfc1d4e

am: a5c68348

Change-Id: I155464b3467f32fcf98053b47787783c3988ef6d
parents 7588a056 a5c68348
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -237,9 +237,15 @@ public class NetworkNotificationManager {
                    + getTransportName(transportType));
            return;
        }

        final String channelId = highPriority ? SystemNotificationChannels.NETWORK_ALERTS :
                SystemNotificationChannels.NETWORK_STATUS;
        // When replacing an existing notification for a given network, don't alert, just silently
        // update the existing notification. Note that setOnlyAlertOnce() will only work for the
        // same id, and the id used here is the NotificationType which is different in every type of
        // notification. This is required because the notification metrics only track the ID but not
        // the tag.
        final boolean hasPreviousNotification = previousNotifyType != null;
        final String channelId = (highPriority && !hasPreviousNotification)
                ? SystemNotificationChannels.NETWORK_ALERTS
                : SystemNotificationChannels.NETWORK_STATUS;
        Notification.Builder builder = new Notification.Builder(mContext, channelId)
                .setWhen(System.currentTimeMillis())
                .setShowWhen(notifyType == NotificationType.NETWORK_SWITCH)