summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorRobert Greenwalt <robdroid@android.com>2011-06-10 14:08:28 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-06-10 14:08:28 -0700
commit1ea549e8990d2d73ccd9e92db1e7312423ee423e (patch)
tree25a0492e44b371130a995e9a5a51c6b10c72d6f6 /telephony
parent5624b793cb791621a586931d9f02eefdf6cfc7c8 (diff)
parent3fc9055c7f3bc25948f17bc29582abae72fe7de1 (diff)
downloadframeworks_base-1ea549e8990d2d73ccd9e92db1e7312423ee423e.zip
frameworks_base-1ea549e8990d2d73ccd9e92db1e7312423ee423e.tar.gz
frameworks_base-1ea549e8990d2d73ccd9e92db1e7312423ee423e.tar.bz2
Merge "CDMALTE: Get roaming status based on SID/NID" into honeycomb-LTE
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java35
-rwxr-xr-xtelephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java6
2 files changed, 36 insertions, 5 deletions
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java
index 318cf37..abd87b8 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java
@@ -125,8 +125,6 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
}
}
- // Not sure if this is needed in CDMALTE phone.
- // mDataRoaming = regCodeIsRoaming(regState);
mLteSS.setRadioTechnology(type);
mLteSS.setState(regCodeToServiceState(regState));
} else {
@@ -212,6 +210,12 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
if (DBG) log("pollStateDone: oldSS=[" + ss + "] newSS=[" + newSS + "]");
+ if (cm.getSimState().isSIMReady()) {
+ // If CSIM is used, check roaming status according to SID/NID
+ // on EFcdmahome record.
+ newSS.setRoaming(!isInHomeSidNid(newSS.getSystemId(), newSS.getNetworkId()));
+ }
+
boolean hasRegistered = ss.getState() != ServiceState.STATE_IN_SERVICE
&& newSS.getState() == ServiceState.STATE_IN_SERVICE;
@@ -464,6 +468,33 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
return provisioningState;
}
+ /**
+ * Check whether the specified SID and NID pair appears in the HOME SID/NID list
+ * read from NV or SIM.
+ *
+ * @return true if provided sid/nid pair belongs to operator's home network.
+ */
+ private boolean isInHomeSidNid(int sid, int nid) {
+ // if SID/NID is not available, do not declare roaming.
+ if (isSidsAllZeros()) return true;
+
+ // length of SID/NID shold be same
+ if (mHomeSystemId.length != mHomeNetworkId.length) return true;
+
+ if (sid == 0) return true;
+
+ for (int i = 0; i < mHomeSystemId.length; i++) {
+ // Use SID only if NID is a reserved value.
+ // SID 0 and NID 0 and 65535 are reserved. (C.0005 2.6.5.2)
+ if ((mHomeSystemId[i] == sid) &&
+ ((mHomeNetworkId[i] == 0) || (mHomeNetworkId[i] == 65535) ||
+ (nid == 0) || (nid == 65535) || (mHomeNetworkId[i] == nid))) {
+ return true;
+ }
+ }
+ return false;
+ }
+
@Override
protected void log(String s) {
Log.d(LOG_TAG, "[CdmaLteSST] " + s);
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
index 5ebdd22..e41985e 100755
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
@@ -130,8 +130,8 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
private String curPlmn = null;
protected String mMdn;
- private int mHomeSystemId[] = null;
- private int mHomeNetworkId[] = null;
+ protected int mHomeSystemId[] = null;
+ protected int mHomeNetworkId[] = null;
protected String mMin;
protected String mPrlVersion;
protected boolean mIsMinInfoReady = false;
@@ -1481,7 +1481,7 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
}
}
- private boolean isSidsAllZeros() {
+ protected boolean isSidsAllZeros() {
if (mHomeSystemId != null) {
for (int i=0; i < mHomeSystemId.length; i++) {
if (mHomeSystemId[i] != 0) {