Loading core/java/android/net/CaptivePortalTracker.java +6 −10 Original line number Diff line number Diff line Loading @@ -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) { Loading @@ -208,6 +204,7 @@ public class CaptivePortalTracker extends StateMachine { private class NoActiveNetworkState extends State { @Override public void enter() { setNotificationOff(); mNetworkInfo = null; } Loading Loading @@ -236,11 +233,6 @@ public class CaptivePortalTracker extends StateMachine { } private class ActiveNetworkState extends State { @Override public void enter() { setNotificationOff(); } @Override public boolean processMessage(Message message) { NetworkInfo info; Loading Loading @@ -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); Loading Loading @@ -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); } Loading services/java/com/android/server/ConnectivityService.java +9 −7 Original line number Diff line number Diff line Loading @@ -3987,8 +3987,8 @@ public class ConnectivityService extends IConnectivityManager.Stub { return timeOutMs; } // Start off with notification off setProvNotificationVisible(false, ConnectivityManager.TYPE_NONE, null, null); // Start off with mobile notification off setProvNotificationVisible(false, ConnectivityManager.TYPE_MOBILE_HIPRI, null, null); CheckMp checkMp = new CheckMp(mContext, this); CheckMp.CallBack cb = new CheckMp.CallBack() { Loading @@ -4013,7 +4013,8 @@ public class ConnectivityService extends IConnectivityManager.Stub { } if (TextUtils.isEmpty(url) == false) { if (DBG) log("CheckMp.onComplete: warm (redirected), url=" + url); setProvNotificationVisible(true, ni.getType(), ni.getExtraInfo(), setProvNotificationVisible(true, ConnectivityManager.TYPE_MOBILE_HIPRI, ni.getExtraInfo(), url); } else { if (DBG) log("CheckMp.onComplete: warm (redirected), no url"); Loading @@ -4024,7 +4025,8 @@ public class ConnectivityService extends IConnectivityManager.Stub { String url = getMobileProvisioningUrl(); if (TextUtils.isEmpty(url) == false) { if (DBG) log("CheckMp.onComplete: warm (no dns/tcp), url=" + url); setProvNotificationVisible(true, ni.getType(), ni.getExtraInfo(), setProvNotificationVisible(true, ConnectivityManager.TYPE_MOBILE_HIPRI, ni.getExtraInfo(), url); } else { if (DBG) log("CheckMp.onComplete: warm (no dns/tcp), no url"); Loading Loading @@ -4426,7 +4428,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { private void handleMobileProvisioningAction(String url) { // Notication mark notification as not visible setProvNotificationVisible(false, ConnectivityManager.TYPE_NONE, null, null); setProvNotificationVisible(false, ConnectivityManager.TYPE_MOBILE_HIPRI, null, null); // If provisioning network handle as a special case, // otherwise launch browser with the intent directly. Loading Loading @@ -4512,14 +4514,14 @@ public class ConnectivityService extends IConnectivityManager.Stub { notification.setLatestEventInfo(mContext, title, details, notification.contentIntent); try { notificationManager.notify(NOTIFICATION_ID, 1, notification); notificationManager.notify(NOTIFICATION_ID, networkType, notification); } catch (NullPointerException npe) { loge("setNotificaitionVisible: visible notificationManager npe=" + npe); npe.printStackTrace(); } } else { try { notificationManager.cancel(NOTIFICATION_ID, 1); notificationManager.cancel(NOTIFICATION_ID, networkType); } catch (NullPointerException npe) { loge("setNotificaitionVisible: cancel notificationManager npe=" + npe); npe.printStackTrace(); Loading Loading
core/java/android/net/CaptivePortalTracker.java +6 −10 Original line number Diff line number Diff line Loading @@ -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) { Loading @@ -208,6 +204,7 @@ public class CaptivePortalTracker extends StateMachine { private class NoActiveNetworkState extends State { @Override public void enter() { setNotificationOff(); mNetworkInfo = null; } Loading Loading @@ -236,11 +233,6 @@ public class CaptivePortalTracker extends StateMachine { } private class ActiveNetworkState extends State { @Override public void enter() { setNotificationOff(); } @Override public boolean processMessage(Message message) { NetworkInfo info; Loading Loading @@ -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); Loading Loading @@ -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); } Loading
services/java/com/android/server/ConnectivityService.java +9 −7 Original line number Diff line number Diff line Loading @@ -3987,8 +3987,8 @@ public class ConnectivityService extends IConnectivityManager.Stub { return timeOutMs; } // Start off with notification off setProvNotificationVisible(false, ConnectivityManager.TYPE_NONE, null, null); // Start off with mobile notification off setProvNotificationVisible(false, ConnectivityManager.TYPE_MOBILE_HIPRI, null, null); CheckMp checkMp = new CheckMp(mContext, this); CheckMp.CallBack cb = new CheckMp.CallBack() { Loading @@ -4013,7 +4013,8 @@ public class ConnectivityService extends IConnectivityManager.Stub { } if (TextUtils.isEmpty(url) == false) { if (DBG) log("CheckMp.onComplete: warm (redirected), url=" + url); setProvNotificationVisible(true, ni.getType(), ni.getExtraInfo(), setProvNotificationVisible(true, ConnectivityManager.TYPE_MOBILE_HIPRI, ni.getExtraInfo(), url); } else { if (DBG) log("CheckMp.onComplete: warm (redirected), no url"); Loading @@ -4024,7 +4025,8 @@ public class ConnectivityService extends IConnectivityManager.Stub { String url = getMobileProvisioningUrl(); if (TextUtils.isEmpty(url) == false) { if (DBG) log("CheckMp.onComplete: warm (no dns/tcp), url=" + url); setProvNotificationVisible(true, ni.getType(), ni.getExtraInfo(), setProvNotificationVisible(true, ConnectivityManager.TYPE_MOBILE_HIPRI, ni.getExtraInfo(), url); } else { if (DBG) log("CheckMp.onComplete: warm (no dns/tcp), no url"); Loading Loading @@ -4426,7 +4428,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { private void handleMobileProvisioningAction(String url) { // Notication mark notification as not visible setProvNotificationVisible(false, ConnectivityManager.TYPE_NONE, null, null); setProvNotificationVisible(false, ConnectivityManager.TYPE_MOBILE_HIPRI, null, null); // If provisioning network handle as a special case, // otherwise launch browser with the intent directly. Loading Loading @@ -4512,14 +4514,14 @@ public class ConnectivityService extends IConnectivityManager.Stub { notification.setLatestEventInfo(mContext, title, details, notification.contentIntent); try { notificationManager.notify(NOTIFICATION_ID, 1, notification); notificationManager.notify(NOTIFICATION_ID, networkType, notification); } catch (NullPointerException npe) { loge("setNotificaitionVisible: visible notificationManager npe=" + npe); npe.printStackTrace(); } } else { try { notificationManager.cancel(NOTIFICATION_ID, 1); notificationManager.cancel(NOTIFICATION_ID, networkType); } catch (NullPointerException npe) { loge("setNotificaitionVisible: cancel notificationManager npe=" + npe); npe.printStackTrace(); Loading