summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--proto/src/system_messages.proto12
-rw-r--r--services/core/java/com/android/server/connectivity/NetworkNotificationManager.java11
2 files changed, 18 insertions, 5 deletions
diff --git a/proto/src/system_messages.proto b/proto/src/system_messages.proto
index 97099df0829a..6b917b5298de 100644
--- a/proto/src/system_messages.proto
+++ b/proto/src/system_messages.proto
@@ -157,6 +157,18 @@ message SystemMessage {
// Legacy IDs with arbitrary values appear below
// Legacy IDs existed as stable non-conflicting constants prior to the O release
+ // Network status notes, previously decleared in metrics_constants with these values
+ // Package: android
+ //
+ // A captive portal was detected during network validation
+ NOTE_NETWORK_SIGN_IN = 740;
+ // An unvalidated network without Internet was selected by the user
+ NOTE_NETWORK_NO_INTERNET = 741;
+ // A validated network failed revalidation and lost Internet access
+ NOTE_NETWORK_LOST_INTERNET = 742;
+ // The system default network switched to a different network
+ NOTE_NETWORK_SWITCH = 743;
+
// Notify the user that their work profile has been deleted
// Package: android
NOTE_PROFILE_WIPED = 1001;
diff --git a/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java b/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java
index 83751a9c15df..4315aaaa443a 100644
--- a/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java
+++ b/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java
@@ -31,7 +31,7 @@ import android.util.SparseIntArray;
import android.widget.Toast;
import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+import com.android.internal.messages.nano.SystemMessageProto.SystemMessage;
import com.android.internal.notification.SystemNotificationChannels;
import static android.net.NetworkCapabilities.NET_CAPABILITY_INTERNET;
@@ -40,11 +40,12 @@ import static android.net.NetworkCapabilities.TRANSPORT_WIFI;
public class NetworkNotificationManager {
+
public static enum NotificationType {
- LOST_INTERNET(MetricsEvent.NOTIFICATION_NETWORK_LOST_INTERNET),
- NETWORK_SWITCH(MetricsEvent.NOTIFICATION_NETWORK_SWITCH),
- NO_INTERNET(MetricsEvent.NOTIFICATION_NETWORK_NO_INTERNET),
- SIGN_IN(MetricsEvent.NOTIFICATION_NETWORK_SIGN_IN);
+ LOST_INTERNET(SystemMessage.NOTE_NETWORK_LOST_INTERNET),
+ NETWORK_SWITCH(SystemMessage.NOTE_NETWORK_SWITCH),
+ NO_INTERNET(SystemMessage.NOTE_NETWORK_NO_INTERNET),
+ SIGN_IN(SystemMessage.NOTE_NETWORK_SIGN_IN);
public final int eventId;