Move calc of EriIconIndex/Mode to whenever basis changes

We need this info in the ServiceState, but rather than calcing it every time
a ServiceState is requested, we can update the values whenever the constituents
change.

bug: 2182568
This commit is contained in:
Robert Greenwalt
2009-10-15 15:11:05 -07:00
parent 3f9faf4737
commit cc5c1ad53c
2 changed files with 8 additions and 16 deletions

View File

@@ -257,12 +257,6 @@ public class CDMAPhone extends PhoneBase {
}
public ServiceState getServiceState() {
int roamInd = mSST.ss.getCdmaRoamingIndicator();
int defRoamInd = mSST.ss.getCdmaDefaultRoamingIndicator();
mSST.ss.setCdmaEriIconIndex(mEriManager.getCdmaEriIconIndex(roamInd, defRoamInd));
mSST.ss.setCdmaEriIconMode(mEriManager.getCdmaEriIconMode(roamInd, defRoamInd));
return mSST.ss;
}
@@ -804,10 +798,6 @@ public class CDMAPhone extends PhoneBase {
}
void notifyServiceStateChanged(ServiceState ss) {
// TODO this seems really inefficient. Can't we calc this when the fundamentals change and store in the
// service state?
ss.setCdmaEriIconIndex(this.getCdmaEriIconIndex());
ss.setCdmaEriIconMode(this.getCdmaEriIconMode());
super.notifyServiceStateChangedP(ss);
}
@@ -1330,9 +1320,7 @@ public class CDMAPhone extends PhoneBase {
@Override
public int getCdmaEriIconIndex() {
int roamInd = getServiceState().getCdmaRoamingIndicator();
int defRoamInd = getServiceState().getCdmaDefaultRoamingIndicator();
return mEriManager.getCdmaEriIconIndex(roamInd, defRoamInd);
return getServiceState().getCdmaEriIconIndex();
}
/**
@@ -1342,9 +1330,7 @@ public class CDMAPhone extends PhoneBase {
*/
@Override
public int getCdmaEriIconMode() {
int roamInd = getServiceState().getCdmaRoamingIndicator();
int defRoamInd = getServiceState().getCdmaDefaultRoamingIndicator();
return mEriManager.getCdmaEriIconMode(roamInd, defRoamInd);
return getServiceState().getCdmaEriIconMode();
}
/**

View File

@@ -782,6 +782,12 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
}
}
int roamingIndicator = newSS.getCdmaRoamingIndicator();
newSS.setCdmaEriIconIndex(phone.mEriManager.getCdmaEriIconIndex(roamingIndicator,
mDefaultRoamingIndicator));
newSS.setCdmaEriIconMode(phone.mEriManager.getCdmaEriIconMode(roamingIndicator,
mDefaultRoamingIndicator));
// NOTE: Some operator may require overriding mCdmaRoaming
// (set by the modem), depending on the mRoamingIndicator.