diff options
| author | Wink Saville <wink@google.com> | 2013-10-03 08:34:46 -0700 |
|---|---|---|
| committer | Wink Saville <wink@google.com> | 2013-10-03 08:34:46 -0700 |
| commit | 3ec8e7fb79f2e662c2b06cfec118a0eeaefd9370 (patch) | |
| tree | 09a2c63a021e5bcbcd8db183c1cadc8c8cbba05b /core/java | |
| parent | 09be37b2d3e66b7d718b0fd0ea9e73ad15493acb (diff) | |
Use networkType to display wifi and mobile notification separately.
There are two bugs one is I was clearing the notification in
CaptivePortalTracker when entering the ActivateState. (double check
according to bug 5021626 we should be calling enter)
Second is we could have the need to display both icons but can't
because we only allow one.
The solution I'm proposing here is to allow two notifications and
have then controlled separately.
Bug: 10886908
Change-Id: I30e7130bc542535492d175640a4990c592f32806
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/net/CaptivePortalTracker.java | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/core/java/android/net/CaptivePortalTracker.java b/core/java/android/net/CaptivePortalTracker.java index 01977cde07b8..d678f1e99b80 100644 --- a/core/java/android/net/CaptivePortalTracker.java +++ b/core/java/android/net/CaptivePortalTracker.java @@ -179,10 +179,6 @@ public class CaptivePortalTracker extends StateMachine { } private class DefaultState extends State { - @Override - public void enter() { - setNotificationOff(); - } @Override public boolean processMessage(Message message) { @@ -208,6 +204,7 @@ public class CaptivePortalTracker extends StateMachine { private class NoActiveNetworkState extends State { @Override public void enter() { + setNotificationOff(); mNetworkInfo = null; } @@ -237,11 +234,6 @@ public class CaptivePortalTracker extends StateMachine { private class ActiveNetworkState extends State { @Override - public void enter() { - setNotificationOff(); - } - - @Override public boolean processMessage(Message message) { NetworkInfo info; switch (message.what) { @@ -284,6 +276,8 @@ public class CaptivePortalTracker extends StateMachine { if (DBG) log(getName() + message.toString()); switch (message.what) { case CMD_DELAYED_CAPTIVE_CHECK: + setNotificationOff(); + if (message.arg1 == mDelayedCheckToken) { InetAddress server = lookupHost(mServer); boolean captive = server != null && isCaptivePortal(server); @@ -362,8 +356,10 @@ public class CaptivePortalTracker extends StateMachine { private void setNotificationOff() { try { - mConnService.setProvisioningNotificationVisible(false, ConnectivityManager.TYPE_NONE, + if (mNetworkInfo != null) { + mConnService.setProvisioningNotificationVisible(false, mNetworkInfo.getType(), null, null); + } } catch (RemoteException e) { log("setNotificationOff: " + e); } |
