Merge "CDMALTE: Evaluate data network type in pollStateDone()" into honeycomb-LTE
This commit is contained in:
@@ -44,22 +44,14 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
|
|||||||
|
|
||||||
CDMALTEPhone mCdmaLtePhone;
|
CDMALTEPhone mCdmaLtePhone;
|
||||||
|
|
||||||
private int gprsState = ServiceState.STATE_OUT_OF_SERVICE;
|
private ServiceState mLteSS; // The last LTE state from Voice Registration
|
||||||
|
|
||||||
private int newGPRSState = ServiceState.STATE_OUT_OF_SERVICE;
|
|
||||||
|
|
||||||
public CdmaLteServiceStateTracker(CDMALTEPhone phone) {
|
public CdmaLteServiceStateTracker(CDMALTEPhone phone) {
|
||||||
super(phone);
|
super(phone);
|
||||||
mCdmaLtePhone = phone;
|
mCdmaLtePhone = phone;
|
||||||
if (DBG) log("CdmaLteServiceStateTracker Constructors");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
mLteSS = new ServiceState();
|
||||||
* @return The current GPRS state. IN_SERVICE is the same as "attached" and
|
if (DBG) log("CdmaLteServiceStateTracker Constructors");
|
||||||
* OUT_OF_SERVICE is the same as detached.
|
|
||||||
*/
|
|
||||||
public int getCurrentDataConnectionState() {
|
|
||||||
return gprsState;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -77,11 +69,13 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The LTE data connection state, only return true here
|
* Set the cdmaSS for EVENT_POLL_STATE_REGISTRATION_CDMA
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected boolean checkAdditionalDataAvaiable() {
|
protected void setCdmaTechnology(int radioTechnology) {
|
||||||
return newGPRSState != ServiceState.STATE_IN_SERVICE;
|
// Called on voice registration state response.
|
||||||
|
// Just record new CDMA radio technology
|
||||||
|
newSS.setRadioTechnology(radioTechnology);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -109,14 +103,10 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
newGPRSState = regCodeToServiceState(regState);
|
|
||||||
// Not sure if this is needed in CDMALTE phone.
|
// Not sure if this is needed in CDMALTE phone.
|
||||||
// mDataRoaming = regCodeIsRoaming(regState);
|
// mDataRoaming = regCodeIsRoaming(regState);
|
||||||
if (newGPRSState == ServiceState.STATE_IN_SERVICE) {
|
mLteSS.setRadioTechnology(type);
|
||||||
this.newCdmaDataConnectionState = newGPRSState;
|
mLteSS.setState(regCodeToServiceState(regState));
|
||||||
newNetworkType = type;
|
|
||||||
newSS.setRadioTechnology(type);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
super.handlePollStateResultMessage(what, ar);
|
super.handlePollStateResultMessage(what, ar);
|
||||||
}
|
}
|
||||||
@@ -216,6 +206,21 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void pollStateDone() {
|
protected void pollStateDone() {
|
||||||
|
// determine data NetworkType from both LET and CDMA SS
|
||||||
|
if (mLteSS.getState() == ServiceState.STATE_IN_SERVICE) {
|
||||||
|
//in LTE service
|
||||||
|
newNetworkType = mLteSS.getRadioTechnology();
|
||||||
|
mNewDataConnectionState = mLteSS.getState();
|
||||||
|
newSS.setRadioTechnology(newNetworkType);
|
||||||
|
log("pollStateDone LTE/eHRPD STATE_IN_SERVICE newNetworkType = " + newNetworkType);
|
||||||
|
} else {
|
||||||
|
// LTE out of service, get CDMA Service State
|
||||||
|
newNetworkType = newSS.getRadioTechnology();
|
||||||
|
mNewDataConnectionState = radioTechnologyToDataServiceState(newNetworkType);
|
||||||
|
log("pollStateDone CDMA STATE_IN_SERVICE newNetworkType = " + newNetworkType +
|
||||||
|
" mNewDataConnectionState = " + mNewDataConnectionState);
|
||||||
|
}
|
||||||
|
|
||||||
if (DBG) log("pollStateDone: oldSS=[" + ss + "] newSS=[" + newSS + "]");
|
if (DBG) log("pollStateDone: oldSS=[" + ss + "] newSS=[" + newSS + "]");
|
||||||
|
|
||||||
boolean hasRegistered = ss.getState() != ServiceState.STATE_IN_SERVICE
|
boolean hasRegistered = ss.getState() != ServiceState.STATE_IN_SERVICE
|
||||||
@@ -225,15 +230,15 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
|
|||||||
&& newSS.getState() != ServiceState.STATE_IN_SERVICE;
|
&& newSS.getState() != ServiceState.STATE_IN_SERVICE;
|
||||||
|
|
||||||
boolean hasCdmaDataConnectionAttached =
|
boolean hasCdmaDataConnectionAttached =
|
||||||
this.cdmaDataConnectionState != ServiceState.STATE_IN_SERVICE
|
mDataConnectionState != ServiceState.STATE_IN_SERVICE
|
||||||
&& this.newCdmaDataConnectionState == ServiceState.STATE_IN_SERVICE;
|
&& mNewDataConnectionState == ServiceState.STATE_IN_SERVICE;
|
||||||
|
|
||||||
boolean hasCdmaDataConnectionDetached =
|
boolean hasCdmaDataConnectionDetached =
|
||||||
this.cdmaDataConnectionState == ServiceState.STATE_IN_SERVICE
|
mDataConnectionState == ServiceState.STATE_IN_SERVICE
|
||||||
&& this.newCdmaDataConnectionState != ServiceState.STATE_IN_SERVICE;
|
&& mNewDataConnectionState != ServiceState.STATE_IN_SERVICE;
|
||||||
|
|
||||||
boolean hasCdmaDataConnectionChanged =
|
boolean hasCdmaDataConnectionChanged =
|
||||||
cdmaDataConnectionState != newCdmaDataConnectionState;
|
mDataConnectionState != mNewDataConnectionState;
|
||||||
|
|
||||||
boolean hasNetworkTypeChanged = networkType != newNetworkType;
|
boolean hasNetworkTypeChanged = networkType != newNetworkType;
|
||||||
|
|
||||||
@@ -272,9 +277,9 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
|
|||||||
}
|
}
|
||||||
// Add an event log when connection state changes
|
// Add an event log when connection state changes
|
||||||
if (ss.getState() != newSS.getState()
|
if (ss.getState() != newSS.getState()
|
||||||
|| cdmaDataConnectionState != newCdmaDataConnectionState) {
|
|| mDataConnectionState != mNewDataConnectionState) {
|
||||||
EventLog.writeEvent(EventLogTags.CDMA_SERVICE_STATE_CHANGE, ss.getState(),
|
EventLog.writeEvent(EventLogTags.CDMA_SERVICE_STATE_CHANGE, ss.getState(),
|
||||||
cdmaDataConnectionState, newSS.getState(), newCdmaDataConnectionState);
|
mDataConnectionState, newSS.getState(), mNewDataConnectionState);
|
||||||
}
|
}
|
||||||
|
|
||||||
ServiceState tss;
|
ServiceState tss;
|
||||||
@@ -283,6 +288,7 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
|
|||||||
newSS = tss;
|
newSS = tss;
|
||||||
// clean slate for next time
|
// clean slate for next time
|
||||||
newSS.setStateOutOfService();
|
newSS.setStateOutOfService();
|
||||||
|
mLteSS.setStateOutOfService();
|
||||||
|
|
||||||
// TODO: 4G Tech Handoff
|
// TODO: 4G Tech Handoff
|
||||||
// if (has4gHandoff) {
|
// if (has4gHandoff) {
|
||||||
@@ -309,11 +315,9 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
|
|||||||
cellLoc = newCellLoc;
|
cellLoc = newCellLoc;
|
||||||
newCellLoc = tcl;
|
newCellLoc = tcl;
|
||||||
|
|
||||||
cdmaDataConnectionState = newCdmaDataConnectionState;
|
mDataConnectionState = mNewDataConnectionState;
|
||||||
networkType = newNetworkType;
|
networkType = newNetworkType;
|
||||||
|
|
||||||
gprsState = newCdmaDataConnectionState;
|
|
||||||
|
|
||||||
newSS.setStateOutOfService(); // clean slate for next time
|
newSS.setStateOutOfService(); // clean slate for next time
|
||||||
|
|
||||||
if (hasNetworkTypeChanged) {
|
if (hasNetworkTypeChanged) {
|
||||||
|
|||||||
@@ -97,8 +97,8 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
/**
|
/**
|
||||||
* Initially assume no data connection.
|
* Initially assume no data connection.
|
||||||
*/
|
*/
|
||||||
protected int cdmaDataConnectionState = ServiceState.STATE_OUT_OF_SERVICE;
|
protected int mDataConnectionState = ServiceState.STATE_OUT_OF_SERVICE;
|
||||||
protected int newCdmaDataConnectionState = ServiceState.STATE_OUT_OF_SERVICE;
|
protected int mNewDataConnectionState = ServiceState.STATE_OUT_OF_SERVICE;
|
||||||
protected int mRegistrationState = -1;
|
protected int mRegistrationState = -1;
|
||||||
protected RegistrantList cdmaForSubscriptionInfoReadyRegistrants = new RegistrantList();
|
protected RegistrantList cdmaForSubscriptionInfoReadyRegistrants = new RegistrantList();
|
||||||
|
|
||||||
@@ -217,8 +217,8 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
phone.mRuimRecords.unregisterForRecordsLoaded(this);
|
phone.mRuimRecords.unregisterForRecordsLoaded(this);
|
||||||
cm.unSetOnSignalStrengthUpdate(this);
|
cm.unSetOnSignalStrengthUpdate(this);
|
||||||
cm.unSetOnNITZTime(this);
|
cm.unSetOnNITZTime(this);
|
||||||
cr.unregisterContentObserver(this.mAutoTimeObserver);
|
cr.unregisterContentObserver(mAutoTimeObserver);
|
||||||
cr.unregisterContentObserver(this.mAutoTimeZoneObserver);
|
cr.unregisterContentObserver(mAutoTimeZoneObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -548,10 +548,12 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The LTE data connection state, only return true here
|
* Determine data network type based on radio technology.
|
||||||
*/
|
*/
|
||||||
protected boolean checkAdditionalDataAvaiable(){
|
protected void setCdmaTechnology(int radioTechnology){
|
||||||
return true;
|
mNewDataConnectionState = radioTechnologyToDataServiceState(radioTechnology);
|
||||||
|
newSS.setRadioTechnology(radioTechnology);
|
||||||
|
newNetworkType = radioTechnology;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -639,12 +641,7 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
regCodeIsRoaming(registrationState) && !isRoamIndForHomeSystem(states[10]);
|
regCodeIsRoaming(registrationState) && !isRoamIndForHomeSystem(states[10]);
|
||||||
newSS.setState (regCodeToServiceState(registrationState));
|
newSS.setState (regCodeToServiceState(registrationState));
|
||||||
|
|
||||||
if(checkAdditionalDataAvaiable()) {
|
setCdmaTechnology(radioTechnology);
|
||||||
this.newCdmaDataConnectionState =
|
|
||||||
radioTechnologyToDataServiceState(radioTechnology);
|
|
||||||
newSS.setRadioTechnology(radioTechnology);
|
|
||||||
newNetworkType = radioTechnology;
|
|
||||||
}
|
|
||||||
|
|
||||||
newSS.setCssIndicator(cssIndicator);
|
newSS.setCssIndicator(cssIndicator);
|
||||||
newSS.setSystemAndNetworkId(systemId, networkId);
|
newSS.setSystemAndNetworkId(systemId, networkId);
|
||||||
@@ -953,15 +950,15 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
&& newSS.getState() != ServiceState.STATE_IN_SERVICE;
|
&& newSS.getState() != ServiceState.STATE_IN_SERVICE;
|
||||||
|
|
||||||
boolean hasCdmaDataConnectionAttached =
|
boolean hasCdmaDataConnectionAttached =
|
||||||
this.cdmaDataConnectionState != ServiceState.STATE_IN_SERVICE
|
mDataConnectionState != ServiceState.STATE_IN_SERVICE
|
||||||
&& this.newCdmaDataConnectionState == ServiceState.STATE_IN_SERVICE;
|
&& mNewDataConnectionState == ServiceState.STATE_IN_SERVICE;
|
||||||
|
|
||||||
boolean hasCdmaDataConnectionDetached =
|
boolean hasCdmaDataConnectionDetached =
|
||||||
this.cdmaDataConnectionState == ServiceState.STATE_IN_SERVICE
|
mDataConnectionState == ServiceState.STATE_IN_SERVICE
|
||||||
&& this.newCdmaDataConnectionState != ServiceState.STATE_IN_SERVICE;
|
&& mNewDataConnectionState != ServiceState.STATE_IN_SERVICE;
|
||||||
|
|
||||||
boolean hasCdmaDataConnectionChanged =
|
boolean hasCdmaDataConnectionChanged =
|
||||||
cdmaDataConnectionState != newCdmaDataConnectionState;
|
mDataConnectionState != mNewDataConnectionState;
|
||||||
|
|
||||||
boolean hasNetworkTypeChanged = networkType != newNetworkType;
|
boolean hasNetworkTypeChanged = networkType != newNetworkType;
|
||||||
|
|
||||||
@@ -975,10 +972,10 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
|
|
||||||
// Add an event log when connection state changes
|
// Add an event log when connection state changes
|
||||||
if (ss.getState() != newSS.getState() ||
|
if (ss.getState() != newSS.getState() ||
|
||||||
cdmaDataConnectionState != newCdmaDataConnectionState) {
|
mDataConnectionState != mNewDataConnectionState) {
|
||||||
EventLog.writeEvent(EventLogTags.CDMA_SERVICE_STATE_CHANGE,
|
EventLog.writeEvent(EventLogTags.CDMA_SERVICE_STATE_CHANGE,
|
||||||
ss.getState(), cdmaDataConnectionState,
|
ss.getState(), mDataConnectionState,
|
||||||
newSS.getState(), newCdmaDataConnectionState);
|
newSS.getState(), mNewDataConnectionState);
|
||||||
}
|
}
|
||||||
|
|
||||||
ServiceState tss;
|
ServiceState tss;
|
||||||
@@ -992,7 +989,7 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
cellLoc = newCellLoc;
|
cellLoc = newCellLoc;
|
||||||
newCellLoc = tcl;
|
newCellLoc = tcl;
|
||||||
|
|
||||||
cdmaDataConnectionState = newCdmaDataConnectionState;
|
mDataConnectionState = mNewDataConnectionState;
|
||||||
networkType = newNetworkType;
|
networkType = newNetworkType;
|
||||||
// this new state has been applied - forget it until we get a new new state
|
// this new state has been applied - forget it until we get a new new state
|
||||||
newNetworkType = 0;
|
newNetworkType = 0;
|
||||||
@@ -1175,7 +1172,7 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private int radioTechnologyToDataServiceState(int code) {
|
protected int radioTechnologyToDataServiceState(int code) {
|
||||||
int retVal = ServiceState.STATE_OUT_OF_SERVICE;
|
int retVal = ServiceState.STATE_OUT_OF_SERVICE;
|
||||||
switch(code) {
|
switch(code) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -1226,14 +1223,14 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
* ServiceState.RADIO_TECHNOLOGY_UNKNOWN is the same as detached.
|
* ServiceState.RADIO_TECHNOLOGY_UNKNOWN is the same as detached.
|
||||||
*/
|
*/
|
||||||
/*package*/ int getCurrentCdmaDataConnectionState() {
|
/*package*/ int getCurrentCdmaDataConnectionState() {
|
||||||
return cdmaDataConnectionState;
|
return mDataConnectionState;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: In the future, we need remove getCurrentCdmaDataConnectionState
|
* TODO: In the future, we need remove getCurrentCdmaDataConnectionState
|
||||||
*/
|
*/
|
||||||
public int getCurrentDataConnectionState() {
|
public int getCurrentDataConnectionState() {
|
||||||
return cdmaDataConnectionState;
|
return mDataConnectionState;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user