am 2a7b5ab1: Merge "Be careful sharing connections when dun is in play" into ics-mr1
* commit '2a7b5ab16af697f386ad7ae346e1bf9229086fa8': Be careful sharing connections when dun is in play
This commit is contained in:
@@ -189,4 +189,11 @@ public class ApnSetting {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO - if we have this function we should also have hashCode.
|
||||||
|
// Also should handle changes in type order and perhaps case-insensitivity
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (o instanceof ApnSetting == false) return false;
|
||||||
|
return (this.toString().equals(o.toString()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1720,11 +1720,25 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
private DataConnection checkForConnectionForApnContext(ApnContext apnContext) {
|
private DataConnection checkForConnectionForApnContext(ApnContext apnContext) {
|
||||||
// Loop through all apnContexts looking for one with a conn that satisfies this apnType
|
// Loop through all apnContexts looking for one with a conn that satisfies this apnType
|
||||||
String apnType = apnContext.getApnType();
|
String apnType = apnContext.getApnType();
|
||||||
|
ApnSetting dunSetting = null;
|
||||||
|
|
||||||
|
if (Phone.APN_TYPE_DUN.equals(apnType)) {
|
||||||
|
dunSetting = fetchDunApn();
|
||||||
|
}
|
||||||
|
|
||||||
for (ApnContext c : mApnContexts.values()) {
|
for (ApnContext c : mApnContexts.values()) {
|
||||||
DataConnection conn = c.getDataConnection();
|
DataConnection conn = c.getDataConnection();
|
||||||
if (conn != null) {
|
if (conn != null) {
|
||||||
ApnSetting apnSetting = c.getApnSetting();
|
ApnSetting apnSetting = c.getApnSetting();
|
||||||
if (apnSetting != null && apnSetting.canHandleType(apnType)) {
|
if (dunSetting != null) {
|
||||||
|
if (dunSetting.equals(apnSetting)) {
|
||||||
|
if (DBG) {
|
||||||
|
log("checkForConnectionForApnContext: apnContext=" + apnContext +
|
||||||
|
" found conn=" + conn);
|
||||||
|
}
|
||||||
|
return conn;
|
||||||
|
}
|
||||||
|
} else if (apnSetting != null && apnSetting.canHandleType(apnType)) {
|
||||||
if (DBG) {
|
if (DBG) {
|
||||||
log("checkForConnectionForApnContext: apnContext=" + apnContext +
|
log("checkForConnectionForApnContext: apnContext=" + apnContext +
|
||||||
" found conn=" + conn);
|
" found conn=" + conn);
|
||||||
|
|||||||
Reference in New Issue
Block a user