diff options
author | Robert Greenwalt <robdroid@android.com> | 2011-06-10 14:13:25 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-06-10 14:13:25 -0700 |
commit | 75612e9c3f92364ba1f0a7fce46f1df11b0a14ca (patch) | |
tree | e74813c031c86120a13d125dd5e13bca3d95d567 /telephony | |
parent | 0a63ccc63b833e8034cc941bf55a6e2003037309 (diff) | |
parent | 1ea549e8990d2d73ccd9e92db1e7312423ee423e (diff) | |
download | frameworks_base-75612e9c3f92364ba1f0a7fce46f1df11b0a14ca.zip frameworks_base-75612e9c3f92364ba1f0a7fce46f1df11b0a14ca.tar.gz frameworks_base-75612e9c3f92364ba1f0a7fce46f1df11b0a14ca.tar.bz2 |
am 1ea549e8: Merge "CDMALTE: Get roaming status based on SID/NID" into honeycomb-LTE
* commit '1ea549e8990d2d73ccd9e92db1e7312423ee423e':
CDMALTE: Get roaming status based on SID/NID
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java | 35 | ||||
-rwxr-xr-x | telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java | 6 |
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) { |