am fe587dba: am a48ccdd6: Merge "Use networkType to display wifi and mobile notification separately." into klp-dev

* commit 'fe587dba3a70c658140eac1b13996b7d8e6eeda2':
  Use networkType to display  wifi and mobile notification separately.
This commit is contained in:
Wink Saville
2013-10-03 21:30:29 -07:00
committed by Android Git Automerger

View File

@@ -3987,8 +3987,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
return timeOutMs; return timeOutMs;
} }
// Start off with notification off // Start off with mobile notification off
setProvNotificationVisible(false, ConnectivityManager.TYPE_NONE, null, null); setProvNotificationVisible(false, ConnectivityManager.TYPE_MOBILE_HIPRI, null, null);
CheckMp checkMp = new CheckMp(mContext, this); CheckMp checkMp = new CheckMp(mContext, this);
CheckMp.CallBack cb = new CheckMp.CallBack() { CheckMp.CallBack cb = new CheckMp.CallBack() {
@@ -4013,7 +4013,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
} }
if (TextUtils.isEmpty(url) == false) { if (TextUtils.isEmpty(url) == false) {
if (DBG) log("CheckMp.onComplete: warm (redirected), url=" + url); if (DBG) log("CheckMp.onComplete: warm (redirected), url=" + url);
setProvNotificationVisible(true, ni.getType(), ni.getExtraInfo(), setProvNotificationVisible(true,
ConnectivityManager.TYPE_MOBILE_HIPRI, ni.getExtraInfo(),
url); url);
} else { } else {
if (DBG) log("CheckMp.onComplete: warm (redirected), no url"); if (DBG) log("CheckMp.onComplete: warm (redirected), no url");
@@ -4024,7 +4025,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
String url = getMobileProvisioningUrl(); String url = getMobileProvisioningUrl();
if (TextUtils.isEmpty(url) == false) { if (TextUtils.isEmpty(url) == false) {
if (DBG) log("CheckMp.onComplete: warm (no dns/tcp), url=" + url); 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); url);
} else { } else {
if (DBG) log("CheckMp.onComplete: warm (no dns/tcp), no url"); if (DBG) log("CheckMp.onComplete: warm (no dns/tcp), no url");
@@ -4426,7 +4428,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
private void handleMobileProvisioningAction(String url) { private void handleMobileProvisioningAction(String url) {
// Notication mark notification as not visible // 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, // If provisioning network handle as a special case,
// otherwise launch browser with the intent directly. // otherwise launch browser with the intent directly.
@@ -4512,14 +4514,14 @@ public class ConnectivityService extends IConnectivityManager.Stub {
notification.setLatestEventInfo(mContext, title, details, notification.contentIntent); notification.setLatestEventInfo(mContext, title, details, notification.contentIntent);
try { try {
notificationManager.notify(NOTIFICATION_ID, 1, notification); notificationManager.notify(NOTIFICATION_ID, networkType, notification);
} catch (NullPointerException npe) { } catch (NullPointerException npe) {
loge("setNotificaitionVisible: visible notificationManager npe=" + npe); loge("setNotificaitionVisible: visible notificationManager npe=" + npe);
npe.printStackTrace(); npe.printStackTrace();
} }
} else { } else {
try { try {
notificationManager.cancel(NOTIFICATION_ID, 1); notificationManager.cancel(NOTIFICATION_ID, networkType);
} catch (NullPointerException npe) { } catch (NullPointerException npe) {
loge("setNotificaitionVisible: cancel notificationManager npe=" + npe); loge("setNotificaitionVisible: cancel notificationManager npe=" + npe);
npe.printStackTrace(); npe.printStackTrace();