diff options
| author | 2020-11-17 08:11:57 +0000 | |
|---|---|---|
| committer | 2020-11-17 08:11:57 +0000 | |
| commit | 25ee58aa4d42bfd2b395f059f60cded2913afb08 (patch) | |
| tree | 26fbf9d864a7c6d90e263b5b1a419e7bde15e295 | |
| parent | a0740b9727618f1640f8efc0b49cebab6511a087 (diff) | |
| parent | 3a37cb6552172e0c3c16f89a735c7f66cf2dfa48 (diff) | |
Merge "Fix the comments left on aosp/1481197" am: 464bc344a5 am: 3a37cb6552
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1494036
Change-Id: Iea77eb0ed2ca0b5603d1257496bd1e8a14ed0d77
3 files changed, 10 insertions, 9 deletions
diff --git a/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java b/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java index 0563fcd1bf50..7f4fb4039d4e 100644 --- a/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java +++ b/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java @@ -75,10 +75,11 @@ public class NetworkNotificationManager { private static final boolean DBG = true; // Notification channels used by ConnectivityService mainline module, it should be aligned with - // SystemNotificationChannels. - public static final String NOTIFICATION_NETWORK_STATUS = "NETWORK_STATUS"; - public static final String NOTIFICATION_NETWORK_ALERTS = "NETWORK_ALERTS"; - public static final String NOTIFICATION_VPN = "VPN"; + // SystemNotificationChannels so the channels are the same as the ones used as the system + // server. + public static final String NOTIFICATION_CHANNEL_NETWORK_STATUS = "NETWORK_STATUS"; + public static final String NOTIFICATION_CHANNEL_NETWORK_ALERTS = "NETWORK_ALERTS"; + public static final String NOTIFICATION_CHANNEL_VPN = "VPN"; // The context is for the current user (system server) private final Context mContext; @@ -263,7 +264,7 @@ public class NetworkNotificationManager { // the tag. final boolean hasPreviousNotification = previousNotifyType != null; final String channelId = (highPriority && !hasPreviousNotification) - ? NOTIFICATION_NETWORK_ALERTS : NOTIFICATION_NETWORK_STATUS; + ? NOTIFICATION_CHANNEL_NETWORK_ALERTS : NOTIFICATION_CHANNEL_NETWORK_STATUS; Notification.Builder builder = new Notification.Builder(mContext, channelId) .setWhen(System.currentTimeMillis()) .setShowWhen(notifyType == NotificationType.NETWORK_SWITCH) diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java index 411828c63fcc..0a71ecbe15d3 100644 --- a/services/core/java/com/android/server/connectivity/Vpn.java +++ b/services/core/java/com/android/server/connectivity/Vpn.java @@ -27,7 +27,7 @@ import static android.net.RouteInfo.RTN_UNREACHABLE; import static com.android.internal.util.Preconditions.checkArgument; import static com.android.internal.util.Preconditions.checkNotNull; -import static com.android.server.connectivity.NetworkNotificationManager.NOTIFICATION_VPN; +import static com.android.server.connectivity.NetworkNotificationManager.NOTIFICATION_CHANNEL_VPN; import android.Manifest; import android.annotation.NonNull; @@ -1945,7 +1945,7 @@ public class Vpn { final PendingIntent configIntent = mSystemServices.pendingIntentGetActivityAsUser( intent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT, user); final Notification.Builder builder = - new Notification.Builder(mContext, NOTIFICATION_VPN) + new Notification.Builder(mContext, NOTIFICATION_CHANNEL_VPN) .setSmallIcon(R.drawable.vpn_connected) .setContentTitle(mContext.getString(R.string.vpn_lockdown_disconnected)) .setContentText(mContext.getString(R.string.vpn_lockdown_config)) diff --git a/services/core/java/com/android/server/net/LockdownVpnTracker.java b/services/core/java/com/android/server/net/LockdownVpnTracker.java index 661d38df12ae..0b774df3fe2f 100644 --- a/services/core/java/com/android/server/net/LockdownVpnTracker.java +++ b/services/core/java/com/android/server/net/LockdownVpnTracker.java @@ -18,7 +18,7 @@ package com.android.server.net; import static android.provider.Settings.ACTION_VPN_SETTINGS; -import static com.android.server.connectivity.NetworkNotificationManager.NOTIFICATION_VPN; +import static com.android.server.connectivity.NetworkNotificationManager.NOTIFICATION_CHANNEL_VPN; import android.annotation.NonNull; import android.annotation.Nullable; @@ -257,7 +257,7 @@ public class LockdownVpnTracker { private void showNotification(int titleRes, int iconRes) { final Notification.Builder builder = - new Notification.Builder(mContext, NOTIFICATION_VPN) + new Notification.Builder(mContext, NOTIFICATION_CHANNEL_VPN) .setWhen(0) .setSmallIcon(iconRes) .setContentTitle(mContext.getString(titleRes)) |