summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Greenwalt <robdroid@android.com>2009-10-15 15:11:05 -0700
committerRobert Greenwalt <robdroid@android.com>2009-10-21 15:02:39 -0700
commitcc5c1ad53ce4541f17842daba29e7ccba221c079 (patch)
treef6fc7f3ebbeddf5e1bd79610082d9315632e2fb4
parent3f9faf473712be7d6471913b921bf8a63ab3205d (diff)
downloadframeworks_base-cc5c1ad53ce4541f17842daba29e7ccba221c079.zip
frameworks_base-cc5c1ad53ce4541f17842daba29e7ccba221c079.tar.gz
frameworks_base-cc5c1ad53ce4541f17842daba29e7ccba221c079.tar.bz2
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
-rwxr-xr-xtelephony/java/com/android/internal/telephony/cdma/CDMAPhone.java18
-rw-r--r--telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java6
2 files changed, 8 insertions, 16 deletions
diff --git a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
index 5c537de..a5d3b22 100755
--- a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
@@ -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();
}
/**
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
index a410f0e..ec30f5a 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
@@ -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.