am 8ab9cbd3: am 208b626e: am 350bee04: Use heads-up notifications when selecting networks with no Internet
* commit '8ab9cbd3ce1d3643f450801e991aafcea6e1946f': Use heads-up notifications when selecting networks with no Internet
This commit is contained in:
@@ -2006,7 +2006,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
NascentState.NOT_JUST_VALIDATED);
|
NascentState.NOT_JUST_VALIDATED);
|
||||||
}
|
}
|
||||||
if (!visible) {
|
if (!visible) {
|
||||||
setProvNotificationVisibleIntent(false, netId, null, 0, null, null);
|
setProvNotificationVisibleIntent(false, netId, null, 0, null, null, false);
|
||||||
} else {
|
} else {
|
||||||
if (nai == null) {
|
if (nai == null) {
|
||||||
loge("EVENT_PROVISIONING_NOTIFICATION from unknown NetworkMonitor");
|
loge("EVENT_PROVISIONING_NOTIFICATION from unknown NetworkMonitor");
|
||||||
@@ -2014,7 +2014,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
}
|
}
|
||||||
setProvNotificationVisibleIntent(true, netId, NotificationType.SIGN_IN,
|
setProvNotificationVisibleIntent(true, netId, NotificationType.SIGN_IN,
|
||||||
nai.networkInfo.getType(), nai.networkInfo.getExtraInfo(),
|
nai.networkInfo.getType(), nai.networkInfo.getExtraInfo(),
|
||||||
(PendingIntent)msg.obj);
|
(PendingIntent)msg.obj, nai.networkMisc.explicitlySelected);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -2447,7 +2447,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
PendingIntent pendingIntent = PendingIntent.getActivityAsUser(
|
PendingIntent pendingIntent = PendingIntent.getActivityAsUser(
|
||||||
mContext, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT, null, UserHandle.CURRENT);
|
mContext, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT, null, UserHandle.CURRENT);
|
||||||
setProvNotificationVisibleIntent(true, nai.network.netId, NotificationType.NO_INTERNET,
|
setProvNotificationVisibleIntent(true, nai.network.netId, NotificationType.NO_INTERNET,
|
||||||
nai.networkInfo.getType(), nai.networkInfo.getExtraInfo(), pendingIntent);
|
nai.networkInfo.getType(), nai.networkInfo.getExtraInfo(), pendingIntent, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class InternalHandler extends Handler {
|
private class InternalHandler extends Handler {
|
||||||
@@ -3240,7 +3240,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
// Concatenate the range of types onto the range of NetIDs.
|
// Concatenate the range of types onto the range of NetIDs.
|
||||||
int id = MAX_NET_ID + 1 + (networkType - ConnectivityManager.TYPE_NONE);
|
int id = MAX_NET_ID + 1 + (networkType - ConnectivityManager.TYPE_NONE);
|
||||||
setProvNotificationVisibleIntent(visible, id, NotificationType.SIGN_IN,
|
setProvNotificationVisibleIntent(visible, id, NotificationType.SIGN_IN,
|
||||||
networkType, null, pendingIntent);
|
networkType, null, pendingIntent, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -3259,11 +3259,12 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
* we concatenate the range of types with the range of NetIDs.
|
* we concatenate the range of types with the range of NetIDs.
|
||||||
*/
|
*/
|
||||||
private void setProvNotificationVisibleIntent(boolean visible, int id,
|
private void setProvNotificationVisibleIntent(boolean visible, int id,
|
||||||
NotificationType notifyType, int networkType, String extraInfo, PendingIntent intent) {
|
NotificationType notifyType, int networkType, String extraInfo, PendingIntent intent,
|
||||||
|
boolean highPriority) {
|
||||||
if (DBG) {
|
if (DBG) {
|
||||||
log("setProvNotificationVisibleIntent " + notifyType + " visible=" + visible
|
log("setProvNotificationVisibleIntent " + notifyType + " visible=" + visible
|
||||||
+ " networkType=" + getNetworkTypeName(networkType)
|
+ " networkType=" + getNetworkTypeName(networkType)
|
||||||
+ " extraInfo=" + extraInfo);
|
+ " extraInfo=" + extraInfo + " highPriority=" + highPriority);
|
||||||
}
|
}
|
||||||
|
|
||||||
Resources r = Resources.getSystem();
|
Resources r = Resources.getSystem();
|
||||||
@@ -3318,6 +3319,12 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
.setContentTitle(title)
|
.setContentTitle(title)
|
||||||
.setContentText(details)
|
.setContentText(details)
|
||||||
.setContentIntent(intent)
|
.setContentIntent(intent)
|
||||||
|
.setLocalOnly(true)
|
||||||
|
.setPriority(highPriority ?
|
||||||
|
Notification.PRIORITY_HIGH :
|
||||||
|
Notification.PRIORITY_DEFAULT)
|
||||||
|
.setDefaults(Notification.DEFAULT_ALL)
|
||||||
|
.setOnlyAlertOnce(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user