diff options
author | 2019-06-06 04:19:44 -0700 | |
---|---|---|
committer | 2019-06-06 04:19:44 -0700 | |
commit | cda472e6af4d09111a9486ae07269a5576c613ee (patch) | |
tree | 1b4244608bf1af4d9e6db7c124fb169cd974952c | |
parent | 6901feb8774c3725b1dd06c7bf695710fd0e6269 (diff) | |
parent | 71feb6467f0694a85b366924c61395f194ae6cd4 (diff) |
Merge "Don't use a high-priority notification on auto-join." into qt-dev am: 831831c76c
am: 71feb6467f
Change-Id: I9798141003ab3489af55892d76533f3edac575f7
-rw-r--r-- | services/core/java/com/android/server/ConnectivityService.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index 3f010f1c7c37..a1e1bbbdc67a 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -3597,21 +3597,31 @@ public class ConnectivityService extends IConnectivityManager.Stub private void showNetworkNotification(NetworkAgentInfo nai, NotificationType type) { final String action; + final boolean highPriority; switch (type) { case LOGGED_IN: action = Settings.ACTION_WIFI_SETTINGS; mHandler.removeMessages(EVENT_TIMEOUT_NOTIFICATION); mHandler.sendMessageDelayed(mHandler.obtainMessage(EVENT_TIMEOUT_NOTIFICATION, nai.network.netId, 0), TIMEOUT_NOTIFICATION_DELAY_MS); + // High priority because it is a direct result of the user logging in to a portal. + highPriority = true; break; case NO_INTERNET: action = ConnectivityManager.ACTION_PROMPT_UNVALIDATED; + // High priority because it is only displayed for explicitly selected networks. + highPriority = true; break; case LOST_INTERNET: action = ConnectivityManager.ACTION_PROMPT_LOST_VALIDATION; + // High priority because it could help the user avoid unexpected data usage. + highPriority = true; break; case PARTIAL_CONNECTIVITY: action = ConnectivityManager.ACTION_PROMPT_PARTIAL_CONNECTIVITY; + // Don't bother the user with a high-priority notification if the network was not + // explicitly selected by the user. + highPriority = nai.networkMisc.explicitlySelected; break; default: Slog.wtf(TAG, "Unknown notification type " + type); @@ -3628,7 +3638,8 @@ public class ConnectivityService extends IConnectivityManager.Stub PendingIntent pendingIntent = PendingIntent.getActivityAsUser( mContext, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT, null, UserHandle.CURRENT); - mNotifier.showNotification(nai.network.netId, type, nai, null, pendingIntent, true); + + mNotifier.showNotification(nai.network.netId, type, nai, null, pendingIntent, highPriority); } private boolean shouldPromptUnvalidated(NetworkAgentInfo nai) { |