From 22ae9d5ca0e6adc4d946dda0826334861506d893 Mon Sep 17 00:00:00 2001 From: Glen Kuhne Date: Tue, 28 Nov 2017 14:06:25 -0800 Subject: [PATCH 1/3] Carrier Network Available Notification setting Adds a setting allowing user to toggle Carrier Network Available Notification on and off. Bug: 69310016 Test: Verified manually Change-Id: I209cd216dd5fd5c790aca8f74707a7ef831edd6a --- core/java/android/provider/Settings.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index baa90e75d589b..1ea4861879356 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -9154,6 +9154,22 @@ public final class Settings { private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR = BOOLEAN_VALIDATOR; + /** + * Whether to notify the user of carrier networks. + *

+ * If not connected and the scan results have a carrier network, we will + * put this notification up. If we attempt to connect to a network or + * the carrier network(s) disappear, we remove the notification. When we + * show the notification, we will not show it again for + * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time. + * @hide + */ + public static final String WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON = + "wifi_carrier_networks_available_notification_on"; + + private static final Validator WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR = + BOOLEAN_VALIDATOR; + /** * {@hide} */ @@ -11261,6 +11277,7 @@ public final class Settings { NETWORK_RECOMMENDATIONS_ENABLED, WIFI_WAKEUP_ENABLED, WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, + WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON, USE_OPEN_WIFI_PACKAGE, WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, EMERGENCY_TONE, @@ -11307,6 +11324,8 @@ public final class Settings { VALIDATORS.put(PRIVATE_DNS_MODE, PRIVATE_DNS_MODE_VALIDATOR); VALIDATORS.put(PRIVATE_DNS_SPECIFIER, PRIVATE_DNS_SPECIFIER_VALIDATOR); VALIDATORS.put(SOFT_AP_TIMEOUT_ENABLED, SOFT_AP_TIMEOUT_ENABLED_VALIDATOR); + VALIDATORS.put(WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON, + WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR); } /** From f4d7fbd0ab88dc85f5dcb8f5e435c3284d740ff9 Mon Sep 17 00:00:00 2001 From: Glen Kuhne Date: Tue, 28 Nov 2017 16:01:02 -0800 Subject: [PATCH 2/3] Carrier Network Notification strings Added a title string for carrier network notifications. Bug: 69310016 Test: builds Change-Id: Ie00d84f209899783e459d3b36b34fec87c52872a --- core/res/res/values/strings.xml | 2 ++ core/res/res/values/symbols.xml | 1 + 2 files changed, 3 insertions(+) diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 71e963a5bf9e3..61397f49e4c84 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -3027,6 +3027,8 @@ Connect to open Wi\u2011Fi network + + Connect to carrier Wi\u2011Fi network Connecting to open Wi\u2011Fi network diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index ee208734a49db..7938f1658dc4f 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1912,6 +1912,7 @@ + From f5a44fafbeaa91ad59ba8ee0d27fe5b6f0f3d017 Mon Sep 17 00:00:00 2001 From: Mehdi Alizadeh Date: Thu, 18 Jan 2018 19:34:15 -0800 Subject: [PATCH 3/3] Adds SystemMessage for CarrierNetworkNotification Adds a separate field in SystemMessage class for Carrier Network Notification, to be able to differentiate between Carrier and Open network notifications in case we have both notifications at the same time. Bug: 69310016 Test: Builds successfully Change-Id: I5c4f40640a924e39cf4c6a33825afcc1a5c9d4f9 --- proto/src/system_messages.proto | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/proto/src/system_messages.proto b/proto/src/system_messages.proto index 7c6019e764166..db70184e9e9fa 100644 --- a/proto/src/system_messages.proto +++ b/proto/src/system_messages.proto @@ -196,6 +196,10 @@ message SystemMessage { // Inform the user that unexpectedly rapid network usage is happening NOTE_NET_RAPID = 45; + // Notify the user that carrier Wi-Fi networks are available. + // Package: android + NOTE_CARRIER_NETWORK_AVAILABLE = 46; + // ADD_NEW_IDS_ABOVE_THIS_LINE // Legacy IDs with arbitrary values appear below // Legacy IDs existed as stable non-conflicting constants prior to the O release