Merge "Report data status from ApnContext even if data is detached" into honeycomb-LTE
This commit is contained in:
@@ -65,32 +65,12 @@ public class CDMALTEPhone extends CDMAPhone {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataState getDataConnectionState(String apnType) {
|
public DataState getDataConnectionState(String apnType) {
|
||||||
// TODO: Remove instanceof if possible.
|
|
||||||
boolean isCdmaDataConnectionTracker = false;
|
|
||||||
if (mDataConnectionTracker instanceof CdmaDataConnectionTracker) {
|
|
||||||
log("getDataConnectionState isCdmaDataConnectionTracker");
|
|
||||||
isCdmaDataConnectionTracker = true;
|
|
||||||
} else {
|
|
||||||
log("getDataConnectionState NOT CdmaDataConnectionTracker");
|
|
||||||
}
|
|
||||||
DataState ret = DataState.DISCONNECTED;
|
DataState ret = DataState.DISCONNECTED;
|
||||||
|
|
||||||
if (!isCdmaDataConnectionTracker && (SystemProperties.get("adb.connected", "").length()
|
if (mSST == null) {
|
||||||
> 0)) {
|
|
||||||
// We're connected to an ADB host and we have USB networking
|
|
||||||
// turned on. No matter what the radio state is,
|
|
||||||
// we report data connected
|
|
||||||
|
|
||||||
ret = DataState.CONNECTED;
|
|
||||||
} else if (mSST == null) {
|
|
||||||
// Radio Technology Change is ongoning, dispose() and
|
// Radio Technology Change is ongoning, dispose() and
|
||||||
// removeReferences() have
|
// removeReferences() have already been called
|
||||||
// already been called
|
|
||||||
|
|
||||||
ret = DataState.DISCONNECTED;
|
|
||||||
} else if (mSST.getCurrentDataConnectionState() != ServiceState.STATE_IN_SERVICE) {
|
|
||||||
// If we're out of service, open TCP sockets may still work
|
|
||||||
// but no data will flow
|
|
||||||
ret = DataState.DISCONNECTED;
|
ret = DataState.DISCONNECTED;
|
||||||
} else if (mDataConnectionTracker.isApnTypeEnabled(apnType) == false) {
|
} else if (mDataConnectionTracker.isApnTypeEnabled(apnType) == false) {
|
||||||
ret = DataState.DISCONNECTED;
|
ret = DataState.DISCONNECTED;
|
||||||
|
|||||||
@@ -301,6 +301,9 @@ public class GSMPhone extends PhoneBase {
|
|||||||
ret = DataState.DISCONNECTED;
|
ret = DataState.DISCONNECTED;
|
||||||
} else if (mDataConnectionTracker.isApnTypeEnabled(apnType) == false ||
|
} else if (mDataConnectionTracker.isApnTypeEnabled(apnType) == false ||
|
||||||
mDataConnectionTracker.isApnTypeActive(apnType) == false) {
|
mDataConnectionTracker.isApnTypeActive(apnType) == false) {
|
||||||
|
//TODO: isApnTypeActive() is just checking whether ApnContext holds
|
||||||
|
// Dataconnection or not. Checking each ApnState below should
|
||||||
|
// provide the same state. Calling isApnTypeActive() can be removed.
|
||||||
ret = DataState.DISCONNECTED;
|
ret = DataState.DISCONNECTED;
|
||||||
} else { /* mSST.gprsState == ServiceState.STATE_IN_SERVICE */
|
} else { /* mSST.gprsState == ServiceState.STATE_IN_SERVICE */
|
||||||
switch (mDataConnectionTracker.getState(apnType)) {
|
switch (mDataConnectionTracker.getState(apnType)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user