Use local defined constants for notification channels
ConnectivityService mainline module cannot call the members
inside SystemNotificationChannels.java. So use the local defined
constants instead.
Bug: 172040168
Test: atest FrameworksNetTests
Test: Manual test NO_INTERNET, SIGN_IN, PARTIAL_CONNECTIVITY,
VPN_ALWAYS_ON notifications.
Change-Id: I223b207c4346e8239dee78e50dd2b0532a3e55b0
diff --git a/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java b/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java
index 3d22d6d..26eca19 100644
--- a/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java
+++ b/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java
@@ -41,7 +41,6 @@
import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.messages.nano.SystemMessageProto.SystemMessage;
-import com.android.internal.notification.SystemNotificationChannels;
public class NetworkNotificationManager {
@@ -72,7 +71,12 @@
private static final String TAG = NetworkNotificationManager.class.getSimpleName();
private static final boolean DBG = true;
- private static final boolean VDBG = false;
+
+ // 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";
// The context is for the current user (system server)
private final Context mContext;
@@ -255,8 +259,7 @@
// the tag.
final boolean hasPreviousNotification = previousNotifyType != null;
final String channelId = (highPriority && !hasPreviousNotification)
- ? SystemNotificationChannels.NETWORK_ALERTS
- : SystemNotificationChannels.NETWORK_STATUS;
+ ? NOTIFICATION_NETWORK_ALERTS : NOTIFICATION_NETWORK_STATUS;
Notification.Builder builder = new Notification.Builder(mContext, channelId)
.setWhen(System.currentTimeMillis())
.setShowWhen(notifyType == NotificationType.NETWORK_SWITCH)