Rename PhoneBase's DataConnectionTracker member.

Was called mDataConnection, but this is more confusing now that we have multiple
DataConnections.  Changed it to the more correct mDataConnectionTracker.

Change-Id: I3cdc4f2897d60e5b0885891744aa6ff2db27af37
This commit is contained in:
Robert Greenwalt
2011-04-08 10:17:39 -07:00
parent 5203a5bc28
commit 63edf6c4f5
8 changed files with 52 additions and 52 deletions

View File

@@ -112,7 +112,7 @@ public abstract class PhoneBase extends Handler implements Phone {
public CommandsInterface mCM; public CommandsInterface mCM;
protected IccFileHandler mIccFileHandler; protected IccFileHandler mIccFileHandler;
boolean mDnsCheckDisabled = false; boolean mDnsCheckDisabled = false;
public DataConnectionTracker mDataConnection; public DataConnectionTracker mDataConnectionTracker;
boolean mDoesRilSendMultipleCallRing; boolean mDoesRilSendMultipleCallRing;
int mCallRingContinueToken = 0; int mCallRingContinueToken = 0;
int mCallRingDelay; int mCallRingDelay;
@@ -243,7 +243,7 @@ public abstract class PhoneBase extends Handler implements Phone {
synchronized(PhoneProxy.lockForRadioTechnologyChange) { synchronized(PhoneProxy.lockForRadioTechnologyChange) {
mCM.unSetOnCallRing(this); mCM.unSetOnCallRing(this);
// Must cleanup all connectionS and needs to use sendMessage! // Must cleanup all connectionS and needs to use sendMessage!
mDataConnection.cleanUpAllConnections(null); mDataConnectionTracker.cleanUpAllConnections(null);
mIsTheCurrentActivePhone = false; mIsTheCurrentActivePhone = false;
} }
} }
@@ -974,31 +974,31 @@ public abstract class PhoneBase extends Handler implements Phone {
} }
public String[] getActiveApnTypes() { public String[] getActiveApnTypes() {
return mDataConnection.getActiveApnTypes(); return mDataConnectionTracker.getActiveApnTypes();
} }
public String getActiveApnHost() { public String getActiveApnHost() {
return mDataConnection.getActiveApnString(); return mDataConnectionTracker.getActiveApnString();
} }
public LinkProperties getLinkProperties(String apnType) { public LinkProperties getLinkProperties(String apnType) {
return mDataConnection.getLinkProperties(apnType); return mDataConnectionTracker.getLinkProperties(apnType);
} }
public LinkCapabilities getLinkCapabilities(String apnType) { public LinkCapabilities getLinkCapabilities(String apnType) {
return mDataConnection.getLinkCapabilities(apnType); return mDataConnectionTracker.getLinkCapabilities(apnType);
} }
public int enableApnType(String type) { public int enableApnType(String type) {
return mDataConnection.enableApnType(type); return mDataConnectionTracker.enableApnType(type);
} }
public int disableApnType(String type) { public int disableApnType(String type) {
return mDataConnection.disableApnType(type); return mDataConnectionTracker.disableApnType(type);
} }
public boolean isDataConnectivityPossible() { public boolean isDataConnectivityPossible() {
return ((mDataConnection != null) && (mDataConnection.isDataPossible())); return ((mDataConnectionTracker != null) && (mDataConnectionTracker.isDataPossible()));
} }
/** /**
@@ -1028,7 +1028,7 @@ public abstract class PhoneBase extends Handler implements Phone {
break; break;
} }
mDataConnection.setState(dcState); mDataConnectionTracker.setState(dcState);
notifyDataConnection(null, Phone.APN_TYPE_DEFAULT); notifyDataConnection(null, Phone.APN_TYPE_DEFAULT);
} }

View File

@@ -96,7 +96,7 @@ public class CDMALTEPhone extends CDMAPhone {
@Override @Override
public DataState getDataConnectionState(String apnType) { public DataState getDataConnectionState(String apnType) {
boolean isCdmaDataConnectionTracker = false; boolean isCdmaDataConnectionTracker = false;
if (mDataConnection instanceof CdmaDataConnectionTracker) { if (mDataConnectionTracker instanceof CdmaDataConnectionTracker) {
isCdmaDataConnectionTracker = true; isCdmaDataConnectionTracker = true;
} }
log("getDataConnectionState"); log("getDataConnectionState");
@@ -119,10 +119,10 @@ public class CDMALTEPhone extends CDMAPhone {
// If we're out of service, open TCP sockets may still work // If we're out of service, open TCP sockets may still work
// but no data will flow // but no data will flow
ret = DataState.DISCONNECTED; ret = DataState.DISCONNECTED;
} else if (mDataConnection.isApnTypeEnabled(apnType) == false) { } else if (mDataConnectionTracker.isApnTypeEnabled(apnType) == false) {
ret = DataState.DISCONNECTED; ret = DataState.DISCONNECTED;
} else { } else {
switch (mDataConnection.getState(apnType)) { switch (mDataConnectionTracker.getState(apnType)) {
case FAILED: case FAILED:
case IDLE: case IDLE:
ret = DataState.DISCONNECTED; ret = DataState.DISCONNECTED;
@@ -164,10 +164,10 @@ public class CDMALTEPhone extends CDMAPhone {
} }
public String getActiveApn(String apnType) { public String getActiveApn(String apnType) {
if (mDataConnection instanceof CdmaDataConnectionTracker) if (mDataConnectionTracker instanceof CdmaDataConnectionTracker)
return mDataConnection.getActiveApnString(); return mDataConnectionTracker.getActiveApnString();
return ((GsmDataConnectionTracker)mDataConnection).getActiveApnString(apnType); return ((GsmDataConnectionTracker)mDataConnectionTracker).getActiveApnString(apnType);
} }
protected void log(String s) { protected void log(String s) {

View File

@@ -163,7 +163,7 @@ public class CDMAPhone extends PhoneBase {
mSMS = new CdmaSMSDispatcher(this); mSMS = new CdmaSMSDispatcher(this);
mIccFileHandler = new RuimFileHandler(this); mIccFileHandler = new RuimFileHandler(this);
mRuimRecords = new RuimRecords(this); mRuimRecords = new RuimRecords(this);
mDataConnection = new CdmaDataConnectionTracker (this); mDataConnectionTracker = new CdmaDataConnectionTracker (this);
mRuimCard = new RuimCard(this); mRuimCard = new RuimCard(this);
mRuimPhoneBookInterfaceManager = new RuimPhoneBookInterfaceManager(this); mRuimPhoneBookInterfaceManager = new RuimPhoneBookInterfaceManager(this);
mRuimSmsInterfaceManager = new RuimSmsInterfaceManager(this, mSMS); mRuimSmsInterfaceManager = new RuimSmsInterfaceManager(this, mSMS);
@@ -237,7 +237,7 @@ public class CDMAPhone extends PhoneBase {
//Force all referenced classes to unregister their former registered events //Force all referenced classes to unregister their former registered events
mCT.dispose(); mCT.dispose();
mDataConnection.dispose(); mDataConnectionTracker.dispose();
mSST.dispose(); mSST.dispose();
mSMS.dispose(); mSMS.dispose();
mIccFileHandler.dispose(); // instance of RuimFileHandler mIccFileHandler.dispose(); // instance of RuimFileHandler
@@ -259,7 +259,7 @@ public class CDMAPhone extends PhoneBase {
this.mRuimRecords = null; this.mRuimRecords = null;
this.mIccFileHandler = null; this.mIccFileHandler = null;
this.mRuimCard = null; this.mRuimCard = null;
this.mDataConnection = null; this.mDataConnectionTracker = null;
this.mCT = null; this.mCT = null;
this.mSST = null; this.mSST = null;
this.mEriManager = null; this.mEriManager = null;
@@ -338,7 +338,7 @@ public class CDMAPhone extends PhoneBase {
if (mSST.getCurrentCdmaDataConnectionState() == ServiceState.STATE_IN_SERVICE) { if (mSST.getCurrentCdmaDataConnectionState() == ServiceState.STATE_IN_SERVICE) {
switch (mDataConnection.getActivity()) { switch (mDataConnectionTracker.getActivity()) {
case DATAIN: case DATAIN:
ret = DataActivityState.DATAIN; ret = DataActivityState.DATAIN;
break; break;
@@ -564,7 +564,7 @@ public class CDMAPhone extends PhoneBase {
} }
public void setDataRoamingEnabled(boolean enable) { public void setDataRoamingEnabled(boolean enable) {
mDataConnection.setDataOnRoamingEnabled(enable); mDataConnectionTracker.setDataOnRoamingEnabled(enable);
} }
public void registerForCdmaOtaStatusChange(Handler h, int what, Object obj) { public void registerForCdmaOtaStatusChange(Handler h, int what, Object obj) {
@@ -629,11 +629,11 @@ public class CDMAPhone extends PhoneBase {
// If we're out of service, open TCP sockets may still work // If we're out of service, open TCP sockets may still work
// but no data will flow // but no data will flow
ret = DataState.DISCONNECTED; ret = DataState.DISCONNECTED;
} else if (mDataConnection.isApnTypeEnabled(apnType) == false || } else if (mDataConnectionTracker.isApnTypeEnabled(apnType) == false ||
mDataConnection.isApnTypeActive(apnType) == false) { mDataConnectionTracker.isApnTypeActive(apnType) == false) {
ret = DataState.DISCONNECTED; ret = DataState.DISCONNECTED;
} else { } else {
switch (mDataConnection.getState(apnType)) { switch (mDataConnectionTracker.getState(apnType)) {
case FAILED: case FAILED:
case IDLE: case IDLE:
ret = DataState.DISCONNECTED; ret = DataState.DISCONNECTED;
@@ -724,11 +724,11 @@ public class CDMAPhone extends PhoneBase {
} }
public boolean getDataRoamingEnabled() { public boolean getDataRoamingEnabled() {
return mDataConnection.getDataOnRoamingEnabled(); return mDataConnectionTracker.getDataOnRoamingEnabled();
} }
public List<DataConnection> getCurrentDataConnectionList () { public List<DataConnection> getCurrentDataConnectionList () {
return mDataConnection.getAllDataConnections(); return mDataConnectionTracker.getAllDataConnections();
} }
public void setVoiceMailNumber(String alphaTag, public void setVoiceMailNumber(String alphaTag,
@@ -929,7 +929,7 @@ public class CDMAPhone extends PhoneBase {
// send an Intent // send an Intent
sendEmergencyCallbackModeChange(); sendEmergencyCallbackModeChange();
// Re-initiate data connection // Re-initiate data connection
mDataConnection.setInternalDataEnabled(true); mDataConnectionTracker.setInternalDataEnabled(true);
} }
} }

View File

@@ -1062,7 +1062,7 @@ public final class CdmaCallTracker extends CallTracker {
if (PhoneNumberUtils.isEmergencyNumber(dialString)) { if (PhoneNumberUtils.isEmergencyNumber(dialString)) {
if (Phone.DEBUG_PHONE) log("disableDataCallInEmergencyCall"); if (Phone.DEBUG_PHONE) log("disableDataCallInEmergencyCall");
mIsInEmergencyCall = true; mIsInEmergencyCall = true;
phone.mDataConnection.setInternalDataEnabled(false); phone.mDataConnectionTracker.setInternalDataEnabled(false);
} }
} }
@@ -1079,7 +1079,7 @@ public final class CdmaCallTracker extends CallTracker {
} }
if (inEcm.compareTo("false") == 0) { if (inEcm.compareTo("false") == 0) {
// Re-initiate data connection // Re-initiate data connection
phone.mDataConnection.setInternalDataEnabled(true); phone.mDataConnectionTracker.setInternalDataEnabled(true);
} }
} }
} }

View File

@@ -286,23 +286,23 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
// TODO: 4G Tech Handoff // TODO: 4G Tech Handoff
// if (has4gHandoff) { // if (has4gHandoff) {
// Message msg = phone.mDataConnection.obtainMessage( // Message msg = phone.mDataConnectionTracker.obtainMessage(
// DataConnectionTracker.EVENT_4G_TECHNOLOGY_CHANGE); // DataConnectionTracker.EVENT_4G_TECHNOLOGY_CHANGE);
// phone.mDataConnection.sendMessage(msg); // phone.mDataConnectionTracker.sendMessage(msg);
// } // }
if ((hasMultiApnSupport) if ((hasMultiApnSupport)
&& (phone.mDataConnection instanceof CdmaDataConnectionTracker)) { && (phone.mDataConnectionTracker instanceof CdmaDataConnectionTracker)) {
if (DBG) log("pollStateDone: dispose of current DCT create new GsmDCT"); if (DBG) log("GsmDataConnectionTracker Created");
phone.mDataConnection.dispose(); phone.mDataConnectionTracker.dispose();
phone.mDataConnection = new GsmDataConnectionTracker(mCdmaLtePhone); phone.mDataConnectionTracker = new GsmDataConnectionTracker(mCdmaLtePhone);
} }
if ((hasLostMultiApnSupport) if ((hasLostMultiApnSupport)
&& (phone.mDataConnection instanceof GsmDataConnectionTracker)) { && (phone.mDataConnectionTracker instanceof GsmDataConnectionTracker)) {
if (DBG) log("pollStateDone: dispose of current DCT create new CdmaDCT"); if (DBG)log("GsmDataConnectionTracker disposed");
phone.mDataConnection.dispose(); phone.mDataConnectionTracker.dispose();
phone.mDataConnection = new CdmaDataConnectionTracker((CDMAPhone)phone); phone.mDataConnectionTracker = new CdmaDataConnectionTracker((CDMAPhone)phone);
} }
CdmaCellLocation tcl = cellLoc; CdmaCellLocation tcl = cellLoc;
@@ -387,7 +387,7 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
} }
if ((hasCdmaDataConnectionChanged || hasNetworkTypeChanged) if ((hasCdmaDataConnectionChanged || hasNetworkTypeChanged)
&& (phone.mDataConnection instanceof CdmaDataConnectionTracker)) { && (phone.mDataConnectionTracker instanceof CdmaDataConnectionTracker)) {
phone.notifyDataConnection(); phone.notifyDataConnection();
} }

View File

@@ -502,7 +502,7 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
&& cm.getRadioState() == CommandsInterface.RadioState.RADIO_OFF) { && cm.getRadioState() == CommandsInterface.RadioState.RADIO_OFF) {
cm.setRadioPower(true, null); cm.setRadioPower(true, null);
} else if (!mDesiredPowerState && cm.getRadioState().isOn()) { } else if (!mDesiredPowerState && cm.getRadioState().isOn()) {
DataConnectionTracker dcTracker = phone.mDataConnection; DataConnectionTracker dcTracker = phone.mDataConnectionTracker;
// If it's on and available and we want it off gracefully // If it's on and available and we want it off gracefully
powerOffRadioSafely(dcTracker); powerOffRadioSafely(dcTracker);

View File

@@ -143,7 +143,7 @@ public class GSMPhone extends PhoneBase {
mSMS = new GsmSMSDispatcher(this); mSMS = new GsmSMSDispatcher(this);
mIccFileHandler = new SIMFileHandler(this); mIccFileHandler = new SIMFileHandler(this);
mSIMRecords = new SIMRecords(this); mSIMRecords = new SIMRecords(this);
mDataConnection = new GsmDataConnectionTracker (this); mDataConnectionTracker = new GsmDataConnectionTracker (this);
mSimCard = new SimCard(this); mSimCard = new SimCard(this);
if (!unitTestMode) { if (!unitTestMode) {
mSimPhoneBookIntManager = new SimPhoneBookInterfaceManager(this); mSimPhoneBookIntManager = new SimPhoneBookInterfaceManager(this);
@@ -218,7 +218,7 @@ public class GSMPhone extends PhoneBase {
//Force all referenced classes to unregister their former registered events //Force all referenced classes to unregister their former registered events
mStkService.dispose(); mStkService.dispose();
mCT.dispose(); mCT.dispose();
mDataConnection.dispose(); mDataConnectionTracker.dispose();
mSST.dispose(); mSST.dispose();
mIccFileHandler.dispose(); // instance of SimFileHandler mIccFileHandler.dispose(); // instance of SimFileHandler
mSIMRecords.dispose(); mSIMRecords.dispose();
@@ -239,7 +239,7 @@ public class GSMPhone extends PhoneBase {
this.mSIMRecords = null; this.mSIMRecords = null;
this.mIccFileHandler = null; this.mIccFileHandler = null;
this.mSimCard = null; this.mSimCard = null;
this.mDataConnection = null; this.mDataConnectionTracker = null;
this.mCT = null; this.mCT = null;
this.mSST = null; this.mSST = null;
} }
@@ -308,11 +308,11 @@ public class GSMPhone extends PhoneBase {
// If we're out of service, open TCP sockets may still work // If we're out of service, open TCP sockets may still work
// but no data will flow // but no data will flow
ret = DataState.DISCONNECTED; ret = DataState.DISCONNECTED;
} else if (mDataConnection.isApnTypeEnabled(apnType) == false || } else if (mDataConnectionTracker.isApnTypeEnabled(apnType) == false ||
mDataConnection.isApnTypeActive(apnType) == false) { mDataConnectionTracker.isApnTypeActive(apnType) == false) {
ret = DataState.DISCONNECTED; ret = DataState.DISCONNECTED;
} else { /* mSST.gprsState == ServiceState.STATE_IN_SERVICE */ } else { /* mSST.gprsState == ServiceState.STATE_IN_SERVICE */
switch (mDataConnection.getState(apnType)) { switch (mDataConnectionTracker.getState(apnType)) {
case FAILED: case FAILED:
case IDLE: case IDLE:
ret = DataState.DISCONNECTED; ret = DataState.DISCONNECTED;
@@ -343,7 +343,7 @@ public class GSMPhone extends PhoneBase {
DataActivityState ret = DataActivityState.NONE; DataActivityState ret = DataActivityState.NONE;
if (mSST.getCurrentGprsState() == ServiceState.STATE_IN_SERVICE) { if (mSST.getCurrentGprsState() == ServiceState.STATE_IN_SERVICE) {
switch (mDataConnection.getActivity()) { switch (mDataConnectionTracker.getActivity()) {
case DATAIN: case DATAIN:
ret = DataActivityState.DATAIN; ret = DataActivityState.DATAIN;
break; break;
@@ -1070,7 +1070,7 @@ public class GSMPhone extends PhoneBase {
} }
public List<DataConnection> getCurrentDataConnectionList () { public List<DataConnection> getCurrentDataConnectionList () {
return mDataConnection.getAllDataConnections(); return mDataConnectionTracker.getAllDataConnections();
} }
public void updateServiceLocation() { public void updateServiceLocation() {
@@ -1086,11 +1086,11 @@ public class GSMPhone extends PhoneBase {
} }
public boolean getDataRoamingEnabled() { public boolean getDataRoamingEnabled() {
return mDataConnection.getDataOnRoamingEnabled(); return mDataConnectionTracker.getDataOnRoamingEnabled();
} }
public void setDataRoamingEnabled(boolean enable) { public void setDataRoamingEnabled(boolean enable) {
mDataConnection.setDataOnRoamingEnabled(enable); mDataConnectionTracker.setDataOnRoamingEnabled(enable);
} }
/** /**

View File

@@ -469,7 +469,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
cm.setRadioPower(true, null); cm.setRadioPower(true, null);
} else if (!mDesiredPowerState && cm.getRadioState().isOn()) { } else if (!mDesiredPowerState && cm.getRadioState().isOn()) {
// If it's on and available and we want it off gracefully // If it's on and available and we want it off gracefully
DataConnectionTracker dcTracker = phone.mDataConnection; DataConnectionTracker dcTracker = phone.mDataConnectionTracker;
powerOffRadioSafely(dcTracker); powerOffRadioSafely(dcTracker);
} // Otherwise, we're in the desired state } // Otherwise, we're in the desired state
} }