Merge "Slightly simplify mTryCell and requestUpstreamMobileConnection() usage"
This commit is contained in:
@@ -1008,10 +1008,9 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean requestUpstreamMobileConnection() {
|
protected void requestUpstreamMobileConnection() {
|
||||||
mUpstreamNetworkMonitor.updateMobileRequiresDun(mConfig.isDunRequired);
|
mUpstreamNetworkMonitor.updateMobileRequiresDun(mConfig.isDunRequired);
|
||||||
mUpstreamNetworkMonitor.registerMobileNetworkRequest();
|
mUpstreamNetworkMonitor.registerMobileNetworkRequest();
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void unrequestUpstreamMobileConnection() {
|
protected void unrequestUpstreamMobileConnection() {
|
||||||
@@ -1100,7 +1099,8 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering
|
|||||||
requestUpstreamMobileConnection();
|
requestUpstreamMobileConnection();
|
||||||
break;
|
break;
|
||||||
case ConnectivityManager.TYPE_NONE:
|
case ConnectivityManager.TYPE_NONE:
|
||||||
if (tryCell && requestUpstreamMobileConnection()) {
|
if (tryCell) {
|
||||||
|
requestUpstreamMobileConnection();
|
||||||
// We think mobile should be coming up; don't set a retry.
|
// We think mobile should be coming up; don't set a retry.
|
||||||
} else {
|
} else {
|
||||||
sendMessageDelayed(CMD_RETRY_UPSTREAM, UPSTREAM_SETTLE_TIME_MS);
|
sendMessageDelayed(CMD_RETRY_UPSTREAM, UPSTREAM_SETTLE_TIME_MS);
|
||||||
@@ -1359,9 +1359,9 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering
|
|||||||
simChange.startListening();
|
simChange.startListening();
|
||||||
mUpstreamNetworkMonitor.start();
|
mUpstreamNetworkMonitor.start();
|
||||||
|
|
||||||
mTryCell = true; // better try something first pass or crazy tests cases will fail
|
// Better try something first pass or crazy tests cases will fail.
|
||||||
chooseUpstreamType(mTryCell);
|
chooseUpstreamType(true);
|
||||||
mTryCell = !mTryCell;
|
mTryCell = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1412,10 +1412,9 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CMD_UPSTREAM_CHANGED:
|
case CMD_UPSTREAM_CHANGED:
|
||||||
// need to try DUN immediately if Wifi goes down
|
// Need to try DUN immediately if Wi-Fi goes down.
|
||||||
mTryCell = true;
|
chooseUpstreamType(true);
|
||||||
chooseUpstreamType(mTryCell);
|
mTryCell = false;
|
||||||
mTryCell = !mTryCell;
|
|
||||||
break;
|
break;
|
||||||
case CMD_RETRY_UPSTREAM:
|
case CMD_RETRY_UPSTREAM:
|
||||||
chooseUpstreamType(mTryCell);
|
chooseUpstreamType(mTryCell);
|
||||||
|
|||||||
Reference in New Issue
Block a user