summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2009-06-01 14:39:20 -0700
committerWink Saville <wink@google.com>2009-06-01 14:39:20 -0700
commitf315238a2b07c7e84f6ade800e504f520d262e66 (patch)
treeca139c52989818f8a0adbbc28c13799c15bb5cf0 /telephony
parentff0d91479d3c8523bc290bd1b65fcd2546be1d40 (diff)
downloadframeworks_base-f315238a2b07c7e84f6ade800e504f520d262e66.zip
frameworks_base-f315238a2b07c7e84f6ade800e504f520d262e66.tar.gz
frameworks_base-f315238a2b07c7e84f6ade800e504f520d262e66.tar.bz2
TODO's from Teleca with modifications from wink.
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/com/android/internal/telephony/CommandsInterface.java5
-rw-r--r--telephony/java/com/android/internal/telephony/PhoneBase.java9
-rw-r--r--telephony/java/com/android/internal/telephony/RIL.java5
-rwxr-xr-xtelephony/java/com/android/internal/telephony/cdma/CDMAPhone.java210
-rw-r--r--telephony/java/com/android/internal/telephony/cdma/CallFailCause.java17
-rw-r--r--telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java4
-rw-r--r--telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java301
-rw-r--r--telephony/java/com/android/internal/telephony/cdma/EriInfo.java22
-rw-r--r--telephony/java/com/android/internal/telephony/cdma/EriManager.java230
-rw-r--r--telephony/java/com/android/internal/telephony/cdma/RuimRecords.java81
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java1
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java7
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/stk/StkService.java5
13 files changed, 396 insertions, 501 deletions
diff --git a/telephony/java/com/android/internal/telephony/CommandsInterface.java b/telephony/java/com/android/internal/telephony/CommandsInterface.java
index 34a57a0..c6d1a4b 100644
--- a/telephony/java/com/android/internal/telephony/CommandsInterface.java
+++ b/telephony/java/com/android/internal/telephony/CommandsInterface.java
@@ -1258,10 +1258,7 @@ public interface CommandsInterface {
* @param result
* Callback message is empty on completion
*/
- /**
- * TODO(Teleca): configValuesArray is represented as a RIL_BroadcastSMSConfig
- * so we think this should be a class with the appropriate parameters not an array?
- */
+ // TODO: Change the configValuesArray to a RIL_BroadcastSMSConfig
public void setCdmaBroadcastConfig(int[] configValuesArray, Message result);
/**
diff --git a/telephony/java/com/android/internal/telephony/PhoneBase.java b/telephony/java/com/android/internal/telephony/PhoneBase.java
index d856279..d6b2737 100644
--- a/telephony/java/com/android/internal/telephony/PhoneBase.java
+++ b/telephony/java/com/android/internal/telephony/PhoneBase.java
@@ -53,15 +53,6 @@ import java.util.Locale;
*
*/
-/**
- * TODO(Teleca): This has a multitude of methods that are CDMA specific
- * , (registerForVoicePrivacy, registerCdmaInformationRecord, registerCdmaCallWaiting,
- * setCdmaRoamingPreference, setCdmaSubscription, getCdmaEriIcon, getCdmaEriText, ...) can
- * these type of calls be more abstract. For example CallWaiting is common between the GSM/CDMA
- * it would seem that doesn't need to be cdma specific. Also, should the application be directly
- * dealing with the CdmaInformationRecord's could they be abstracted to something more generic.
- */
-
public abstract class PhoneBase implements Phone {
private static final String LOG_TAG = "PHONE";
private static final boolean LOCAL_DEBUG = true;
diff --git a/telephony/java/com/android/internal/telephony/RIL.java b/telephony/java/com/android/internal/telephony/RIL.java
index ea84b09..f206d90 100644
--- a/telephony/java/com/android/internal/telephony/RIL.java
+++ b/telephony/java/com/android/internal/telephony/RIL.java
@@ -3302,10 +3302,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
send(rr);
}
- /**
- * TODO(Teleca): configValuesArray is represented as a RIL_BroadcastSMSConfig
- * so we think this should be a class with the appropriate parameters not an array?
- */
+ // TODO: Change the configValuesArray to a RIL_BroadcastSMSConfig
public void setCdmaBroadcastConfig(int[] configValuesArray, Message response) {
RILRequest rr = RILRequest.obtain(RIL_REQUEST_CDMA_SET_BROADCAST_CONFIG, response);
diff --git a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
index c0bfe5e..7ba9951 100755
--- a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
@@ -249,7 +249,7 @@ public class CDMAPhone extends PhoneBase {
public DataActivityState getDataActivityState() {
DataActivityState ret = DataActivityState.NONE;
- if (mSST.getCurrentCdmaDataConnectionState() != ServiceState.RADIO_TECHNOLOGY_UNKNOWN) {
+ if (mSST.getCurrentCdmaDataConnectionState() == ServiceState.STATE_IN_SERVICE) {
switch (mDataConnection.getActivity()) {
case DATAIN:
@@ -384,11 +384,11 @@ public class CDMAPhone extends PhoneBase {
}
public String getLine1Number() {
- return mRuimRecords.getMdnNumber();
+ return mSST.getMdnNumber();
}
public String getCdmaMIN() {
- return mRuimRecords.getCdmaMin();
+ return mSST.getCdmaMin();
}
public void getCallWaiting(Message onComplete) {
@@ -545,8 +545,7 @@ public class CDMAPhone extends PhoneBase {
// already been called
ret = DataState.DISCONNECTED;
- } else if (mSST.getCurrentCdmaDataConnectionState()
- == ServiceState.RADIO_TECHNOLOGY_UNKNOWN) {
+ } else if (mSST.getCurrentCdmaDataConnectionState() != ServiceState.STATE_IN_SERVICE) {
// If we're out of service, open TCP sockets may still work
// but no data will flow
ret = DataState.DISCONNECTED;
@@ -1159,61 +1158,7 @@ public class CDMAPhone extends PhoneBase {
public int getCdmaEriIconIndex() {
int roamInd = getServiceState().getCdmaRoamingIndicator();
int defRoamInd = getServiceState().getCdmaDefaultRoamingIndicator();
- int ret = -1;
-
- switch (roamInd) {
- // Handling the standard roaming indicator (non-ERI)
- case EriInfo.ROAMING_INDICATOR_ON:
- case EriInfo.ROAMING_INDICATOR_OFF:
- case EriInfo.ROAMING_INDICATOR_FLASH:
- Log.d(LOG_TAG, "Using Standard Roaming Indicator (non-ERI): " + roamInd);
- ret = roamInd;
- break;
-
- // Handling the Enhanced Roaming Indicator (roamInd > 2)
- default:
- if (!mEriManager.isEriFileLoaded()) {
- /**
- * TODO(Teleca): What is going on here? Conditionals on the variable being
- * switched? Seems unreasonably confusing... Especially since the above comment
- * indicates this should always be true... If we used explicit returns, the
- * switch could be used to filter specific cases for early bail, and the rest
- * could then be dealt with outside the switch...
- */
-
- if(defRoamInd > 2) {
- Log.d(LOG_TAG, "ERI File not loaded, using: "
- + EriInfo.ROAMING_INDICATOR_FLASH);
- ret = EriInfo.ROAMING_INDICATOR_FLASH;
- } else {
- Log.d(LOG_TAG, "ERI File not loaded, using: " + defRoamInd);
- ret = defRoamInd;
- }
- } else if (mEriManager.getEriInfo(roamInd) == null) {
- if(mEriManager.getEriInfo(defRoamInd) == null) {
-/**
- * TODO(Teleca): Why the redundant code? Especially since it results in this very strange looking
- * almost-identical conditional... How about calling each version of mEriManager.getEriInfo just
- * once, and conditionalizing on the results..
- */
- Log.e(LOG_TAG, "Error: ERI entry: " + roamInd
- + " not present, defRoamInd: " + defRoamInd
- + " not defined in ERI file");
- ret = EriInfo.ROAMING_INDICATOR_ON;
- } else {
- int iconIndex = mEriManager.getEriInfo(defRoamInd).mIconIndex;
- Log.d(LOG_TAG, "ERI entry " + roamInd + " not present, using icon: "
- + iconIndex);
- ret = iconIndex;
- }
- } else {
- int iconIndex = mEriManager.getEriInfo(roamInd).mIconIndex;
- Log.d(LOG_TAG, "Using ERI icon: " + iconIndex);
- ret = iconIndex;
- }
- break;
- }
- return ret;
+ return mEriManager.getCdmaEriIconIndex(roamInd, defRoamInd);
}
/**
@@ -1225,60 +1170,7 @@ public class CDMAPhone extends PhoneBase {
public int getCdmaEriIconMode() {
int roamInd = getServiceState().getCdmaRoamingIndicator();
int defRoamInd = getServiceState().getCdmaDefaultRoamingIndicator();
- int ret = -1;
-
- switch (roamInd) {
- // Handling the standard roaming indicator (non-ERI)
- case EriInfo.ROAMING_INDICATOR_ON:
- case EriInfo.ROAMING_INDICATOR_OFF:
- Log.d(LOG_TAG, "Using Standard Roaming Indicator (non-ERI): normal");
- ret = EriInfo.ROAMING_ICON_MODE_NORMAL;
- break;
-
- case EriInfo.ROAMING_INDICATOR_FLASH:
- Log.d(LOG_TAG, "Using Standard Roaming Indicator (non-ERI): flashing");
- ret = EriInfo.ROAMING_ICON_MODE_FLASH;
- break;
-
- // Handling the Enhanced Roaming Indicator (roamInd > 2)
- default:
- if (!mEriManager.isEriFileLoaded()) {
- if(defRoamInd > 2) {
- Log.d(LOG_TAG, "ERI File not loaded, defRoamInd > 2, flashing");
- ret = EriInfo.ROAMING_ICON_MODE_FLASH;
- } else {
- switch (defRoamInd) {
- // Handling the standard roaming indicator (non-ERI)
- case EriInfo.ROAMING_INDICATOR_ON:
- case EriInfo.ROAMING_INDICATOR_OFF:
- Log.d(LOG_TAG, "ERI File not loaded, normal");
- ret = EriInfo.ROAMING_ICON_MODE_NORMAL;
- break;
-
- case EriInfo.ROAMING_INDICATOR_FLASH:
- Log.d(LOG_TAG, "ERI File not loaded, normal");
- ret = EriInfo.ROAMING_ICON_MODE_FLASH;
- break;
- }
- }
- } else if (mEriManager.getEriInfo(roamInd) == null) {
- if(mEriManager.getEriInfo(defRoamInd) == null) {
- Log.e(LOG_TAG, "Error: defRoamInd not defined in ERI file, normal");
- ret = EriInfo.ROAMING_ICON_MODE_NORMAL;
- } else {
- int mode = mEriManager.getEriInfo(defRoamInd).mIconMode;
- Log.d(LOG_TAG, "ERI entry " + roamInd + " not present, icon mode: "
- + mode);
- ret = mode;
- }
- } else {
- int mode = mEriManager.getEriInfo(roamInd).mIconMode;
- Log.d(LOG_TAG, "Using ERI icon mode: " + mode);
- ret = mode;
- }
- break;
- }
- return ret;
+ return mEriManager.getCdmaEriIconMode(roamInd, defRoamInd);
}
/**
@@ -1288,94 +1180,6 @@ public class CDMAPhone extends PhoneBase {
public String getCdmaEriText() {
int roamInd = getServiceState().getCdmaRoamingIndicator();
int defRoamInd = getServiceState().getCdmaDefaultRoamingIndicator();
- String ret = "ERI text";
-
- switch (roamInd) {
- // Handling the standard roaming indicator (non-ERI)
- case EriInfo.ROAMING_INDICATOR_ON:
- ret = EriInfo.ROAMING_TEXT_0;
- break;
- case EriInfo.ROAMING_INDICATOR_OFF:
- ret = EriInfo.ROAMING_TEXT_1;
- break;
- case EriInfo.ROAMING_INDICATOR_FLASH:
- ret = EriInfo.ROAMING_TEXT_2;
- break;
-
- // Handling the standard ERI
- case 3:
- ret = EriInfo.ROAMING_TEXT_3;
- break;
- case 4:
- ret = EriInfo.ROAMING_TEXT_4;
- break;
- case 5:
- ret = EriInfo.ROAMING_TEXT_5;
- break;
- case 6:
- ret = EriInfo.ROAMING_TEXT_6;
- break;
- case 7:
- ret = EriInfo.ROAMING_TEXT_7;
- break;
- case 8:
- ret = EriInfo.ROAMING_TEXT_8;
- break;
- case 9:
- ret = EriInfo.ROAMING_TEXT_9;
- break;
- case 10:
- ret = EriInfo.ROAMING_TEXT_10;
- break;
- case 11:
- ret = EriInfo.ROAMING_TEXT_11;
- break;
- case 12:
- ret = EriInfo.ROAMING_TEXT_12;
- break;
-
- // Handling the non standard Enhanced Roaming Indicator (roamInd > 63)
- default:
- if (!mEriManager.isEriFileLoaded()) {
- if(defRoamInd > 2) {
- Log.d(LOG_TAG, "ERI File not loaded, defRoamInd > 2, " +
- EriInfo.ROAMING_TEXT_2);
- ret = EriInfo.ROAMING_TEXT_2;
- } else {
- switch (defRoamInd) {
- // Handling the standard roaming indicator (non-ERI)
- case EriInfo.ROAMING_INDICATOR_ON:
- Log.d(LOG_TAG, "ERI File not loaded, " + EriInfo.ROAMING_TEXT_0);
- ret = EriInfo.ROAMING_TEXT_0;
- break;
- case EriInfo.ROAMING_INDICATOR_OFF:
- Log.d(LOG_TAG, "ERI File not loaded, " + EriInfo.ROAMING_TEXT_1);
- ret = EriInfo.ROAMING_TEXT_1;
- break;
- case EriInfo.ROAMING_INDICATOR_FLASH:
- Log.d(LOG_TAG, "ERI File not loaded, " + EriInfo.ROAMING_TEXT_2);
- ret = EriInfo.ROAMING_TEXT_2;
- break;
- }
- }
- } else if (mEriManager.getEriInfo(roamInd) == null) {
- if(mEriManager.getEriInfo(defRoamInd) == null) {
- Log.e(LOG_TAG, "Error: defRoamInd not defined in ERI file, "
- + EriInfo.ROAMING_TEXT_0);
- ret = EriInfo.ROAMING_TEXT_0;
- } else {
- String eriText = mEriManager.getEriInfo(defRoamInd).mEriText;
- Log.d(LOG_TAG, "ERI entry " + roamInd + " not present, eri text: "
- + eriText);
- ret = eriText;
- }
- } else {
- String eriText = mEriManager.getEriInfo(roamInd).mEriText;
- Log.d(LOG_TAG, "Using ERI text: " + eriText);
- ret = eriText;
- }
- break;
- }
- return ret;
+ return mEriManager.getCdmaEriText(roamInd, defRoamInd);
}
}
diff --git a/telephony/java/com/android/internal/telephony/cdma/CallFailCause.java b/telephony/java/com/android/internal/telephony/cdma/CallFailCause.java
index 9af245c..fb5f0fa 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CallFailCause.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CallFailCause.java
@@ -29,21 +29,12 @@ public interface CallFailCause {
// Busy Tone
static final int USER_BUSY = 17;
- // TODO(Teleca): Should we remove commented out values?
-// // No Tone
-// static final int NUMBER_CHANGED = 22;
-// static final int STATUS_ENQUIRY = 30;
static final int NORMAL_UNSPECIFIED = 31;
-//
-// // Congestion Tone
+
+ // Congestion Tone
static final int NO_CIRCUIT_AVAIL = 34;
-// static final int TEMPORARY_FAILURE = 41;
-// static final int SWITCHING_CONGESTION = 42;
-// static final int CHANNEL_NOT_AVAIL = 44;
-// static final int QOS_NOT_AVAIL = 49;
-// static final int BEARER_NOT_AVAIL = 58;
-//
-// // others
+
+ // others
static final int ACM_LIMIT_EXCEEDED = 68;
static final int CALL_BARRED = 240;
static final int FDN_BLOCKED = 241;
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
index d8a6a50..b92e9e4 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
@@ -361,9 +361,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
boolean desiredPowerState = mCdmaPhone.mSST.getDesiredPowerState();
if ((state == State.IDLE || state == State.SCANNING)
- && (psState == ServiceState.RADIO_TECHNOLOGY_1xRTT ||
- psState == ServiceState.RADIO_TECHNOLOGY_EVDO_0 ||
- psState == ServiceState.RADIO_TECHNOLOGY_EVDO_A)
+ && (psState == ServiceState.STATE_IN_SERVICE)
&& ((phone.mCM.getRadioState() == CommandsInterface.RadioState.NV_READY) ||
mCdmaPhone.mRuimRecords.getRecordsLoaded())
&& (mCdmaPhone.mSST.isConcurrentVoiceAndData() ||
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
index 8ecdecd..a9c810d 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
@@ -69,36 +69,26 @@ import java.util.TimeZone;
* {@hide}
*/
final class CdmaServiceStateTracker extends ServiceStateTracker {
+
//***** Instance Variables
CDMAPhone phone;
CdmaCellLocation cellLoc;
CdmaCellLocation newCellLoc;
/**
- * TODO(Teleca): I don't think the initialization to -1 for all of these are
- * really necessary, I don't seem them in GsmServiceStateTracker. Also,
- * all of the other initialization is unnecessary as I believe Java guarantees
- * 0, false & null, but if you think it's better than do all of them there are
- * a few that aren't initialized.
- */
-
- /**
* The access technology currently in use: DATA_ACCESS_
*/
private int networkType = 0;
private int newNetworkType = 0;
private boolean mCdmaRoaming = false;
- private int mRoamingIndicator = -1;
- private int mIsInPrl = -1;
- private int mDefaultRoamingIndicator = -1;
+ private int mRoamingIndicator;
+ private boolean mIsInPrl;
+ private int mDefaultRoamingIndicator;
- /**
- * TODO(Teleca): Maybe these should be initialized to STATE_OUT_OF_SERVICE like gprsState
- * in GsmServiceStateTracker and remove the comment.
- */
- private int cdmaDataConnectionState = -1; // Initially we assume no data connection
- private int newCdmaDataConnectionState = -1; // Initially we assume no data connection
+ // Initially we assume no data connection
+ private int cdmaDataConnectionState = ServiceState.STATE_OUT_OF_SERVICE;
+ private int newCdmaDataConnectionState = ServiceState.STATE_OUT_OF_SERVICE;
private int mRegistrationState = -1;
private RegistrantList cdmaDataConnectionAttachedRegistrants = new RegistrantList();
private RegistrantList cdmaDataConnectionDetachedRegistrants = new RegistrantList();
@@ -117,7 +107,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
// We can't register for SIM_RECORDS_LOADED immediately because the
// SIMRecords object may not be instantiated yet.
- private boolean mNeedToRegForRuimLoaded;
+ private boolean mNeedToRegForRuimLoaded = false;
// Wake lock used while setting time of day.
private PowerManager.WakeLock mWakeLock;
@@ -125,22 +115,20 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
// Keep track of SPN display rules, so we only broadcast intent if something changes.
private String curSpn = null;
- private String curEriText = null;
+ private String curPlmn = null; // it contains the name of the registered network in CDMA can
+ // be the ONS or ERI text
private int curSpnRule = 0;
- private String mMdn = null;
- private int mHomeSystemId = -1;
- private int mHomeNetworkId = -1;
- private String mMin = null;
+ private String mMdn;
+ private int mHomeSystemId;
+ private int mHomeNetworkId;
+ private String mMin;
+
private boolean isEriTextLoaded = false;
private boolean isSubscriptionFromRuim = false;
- /**
- * TODO(Teleca): Is this purely for debugging purposes, or do we expect this string to be
- * passed around (eg, to the UI)? If the latter, it would be better to pass around a
- * reasonCode, and let the UI provide its own strings.
- */
- private String mRegistrationDeniedReason = null;
+ // Registration Denied Reason, General/Authentication Failure, used only for debugging purposes
+ private String mRegistrationDeniedReason;
//***** Constants
static final String LOG_TAG = "CDMA";
@@ -243,9 +231,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
Registrant r = new Registrant(h, what, obj);
cdmaDataConnectionAttachedRegistrants.add(r);
- if (cdmaDataConnectionState == ServiceState.RADIO_TECHNOLOGY_1xRTT
- || cdmaDataConnectionState == ServiceState.RADIO_TECHNOLOGY_EVDO_0
- || cdmaDataConnectionState == ServiceState.RADIO_TECHNOLOGY_EVDO_A) {
+ if (cdmaDataConnectionState == ServiceState.STATE_IN_SERVICE) {
r.notifyRegistrant();
}
}
@@ -264,9 +250,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
Registrant r = new Registrant(h, what, obj);
cdmaDataConnectionDetachedRegistrants.add(r);
- if (cdmaDataConnectionState != ServiceState.RADIO_TECHNOLOGY_1xRTT
- && cdmaDataConnectionState != ServiceState.RADIO_TECHNOLOGY_EVDO_0
- && cdmaDataConnectionState != ServiceState.RADIO_TECHNOLOGY_EVDO_A) {
+ if (cdmaDataConnectionState != ServiceState.STATE_IN_SERVICE) {
r.notifyRegistrant();
}
}
@@ -484,30 +468,40 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
}
protected void updateSpnDisplay() {
+ String spn = "";
+ boolean showSpn = false;
+ String plmn = "";
+ boolean showPlmn = false;
+ int rule = 0;
+ if (cm.getRadioState().isRUIMReady()) {
+ // TODO RUIM SPN is not implemnted, EF_SPN has to be read and Display Condition
+ // Character Encoding, Language Indicator and SPN has to be set
+ // rule = phone.mRuimRecords.getDisplayRule(ss.getOperatorNumeric());
+ // spn = phone.mSIMRecords.getServiceProvideName();
+ plmn = ss.getOperatorAlphaLong(); // mOperatorAlphaLong contains the ONS
+ // showSpn = (rule & ...
+ showPlmn = true; // showPlmn = (rule & ...
- // TODO(Teleca): Check this method again, because it is not sure at the moment how
- // the RUIM handles the SIM stuff. Please complete this function.
-
- //int rule = phone.mRuimRecords.getDisplayRule(ss.getOperatorNumeric());
- String spn = null; //phone.mRuimRecords.getServiceProviderName();
- String eri = ss.getOperatorAlphaLong();
+ } else {
+ // In this case there is no SPN available from RUIM, we show the ERI text
+ plmn = ss.getOperatorAlphaLong(); // mOperatorAlphaLong contains the ERI text
+ showPlmn = true;
+ }
- if (!TextUtils.equals(this.curEriText, eri)) {
- //TODO (rule & SIMRecords.SPN_RULE_SHOW_SPN) == SIMRecords.SPN_RULE_SHOW_SPN;
- boolean showSpn = false;
- //TODO (rule & SIMRecords.SPN_RULE_SHOW_PLMN) == SIMRecords.SPN_RULE_SHOW_PLMN;
- boolean showEri = true;
+ if (rule != curSpnRule
+ || !TextUtils.equals(spn, curSpn)
+ || !TextUtils.equals(plmn, curPlmn)) {
Intent intent = new Intent(Intents.SPN_STRINGS_UPDATED_ACTION);
intent.putExtra(Intents.EXTRA_SHOW_SPN, showSpn);
intent.putExtra(Intents.EXTRA_SPN, spn);
- intent.putExtra(Intents.EXTRA_SHOW_PLMN, showEri);
- intent.putExtra(Intents.EXTRA_PLMN, eri);
+ intent.putExtra(Intents.EXTRA_SHOW_PLMN, showPlmn);
+ intent.putExtra(Intents.EXTRA_PLMN, plmn);
phone.getContext().sendStickyBroadcast(intent);
}
- //curSpnRule = rule;
- //curSpn = spn;
- this.curEriText = eri;
+ curSpnRule = rule;
+ curSpn = spn;
+ curPlmn = plmn;
}
/**
@@ -549,54 +543,39 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
}
} else try {
switch (what) {
- case EVENT_POLL_STATE_REGISTRATION_CDMA: // Handle RIL_REQUEST_REGISTRATION_STATE,
- // the offset is because we don't want the
- // first 3 values in the
- // responseValuesRegistrationState array.
- final int offset = 3;
+ case EVENT_POLL_STATE_REGISTRATION_CDMA: // Handle RIL_REQUEST_REGISTRATION_STATE.
states = (String[])ar.result;
- /**
- * TODO(Teleca): Change from array to a "Class" or local
- * variables so names instead of index's can be used.
- */
- int responseValuesRegistrationState[] = {
- -1, //[0] radioTechnology
- -1, //[1] baseStationId
- -1, //[2] baseStationLatitude
- -1, //[3] baseStationLongitude
- 0, //[4] cssIndicator; init with 0, because it is treated as a boolean
- -1, //[5] systemId
- -1, //[6] networkId
- -1, //[7] Roaming indicator
- -1, //[8] Indicates if current system is in PRL
- -1, //[9] Is default roaming indicator from PRL
- -1, //[10] If registration state is 3 this is reason for denial
- };
+ int registrationState = 4; //[0] registrationState
+ int radioTechnology = -1; //[3] radioTechnology
+ int baseStationId = -1; //[4] baseStationId
+ int baseStationLatitude = -1; //[5] baseStationLatitude
+ int baseStationLongitude = -1; //[6] baseStationLongitude
+ int cssIndicator = 0; //[7] init with 0, because it is treated as a boolean
+ int systemId = 0; //[8] systemId
+ int networkId = 0; //[9] networkId
+ int roamingIndicator = -1; //[10] Roaming indicator
+ int systemIsInPrl = 0; //[11] Indicates if current system is in PRL
+ int defaultRoamingIndicator = 0; //[12] Is default roaming indicator from PRL
+ int reasonForDenial = 0; //[13] Denial reason if registrationState = 3
if (states.length == 14) {
try {
- this.mRegistrationState = Integer.parseInt(states[0]);
- } catch (NumberFormatException ex) {
- Log.w(LOG_TAG, "error parsing RegistrationState: " + ex);
- }
- try {
- responseValuesRegistrationState[0] = Integer.parseInt(states[3]);
- responseValuesRegistrationState[1] = Integer.parseInt(states[4], 16);
- responseValuesRegistrationState[2] = Integer.parseInt(states[5], 16);
- responseValuesRegistrationState[3] = Integer.parseInt(states[6], 16);
- responseValuesRegistrationState[4] = Integer.parseInt(states[7]);
- responseValuesRegistrationState[5] = Integer.parseInt(states[8]);
- responseValuesRegistrationState[6] = Integer.parseInt(states[9]);
- responseValuesRegistrationState[7] = Integer.parseInt(states[10]);
- responseValuesRegistrationState[8] = Integer.parseInt(states[11]);
- responseValuesRegistrationState[9] = Integer.parseInt(states[12]);
- responseValuesRegistrationState[10] = Integer.parseInt(states[13]);
+ registrationState = Integer.parseInt(states[0]);
+ radioTechnology = Integer.parseInt(states[3]);
+ baseStationId = Integer.parseInt(states[4], 16);
+ baseStationLatitude = Integer.parseInt(states[5], 16);
+ baseStationLongitude = Integer.parseInt(states[6], 16);
+ cssIndicator = Integer.parseInt(states[7]);
+ systemId = Integer.parseInt(states[8]);
+ networkId = Integer.parseInt(states[9]);
+ roamingIndicator = Integer.parseInt(states[10]);
+ systemIsInPrl = Integer.parseInt(states[11]);
+ defaultRoamingIndicator = Integer.parseInt(states[12]);
+ reasonForDenial = Integer.parseInt(states[13]);
}
catch(NumberFormatException ex) {
- Log.w(LOG_TAG, "Warning! There is an unexpected value"
- + "returned as response from "
- + "RIL_REQUEST_REGISTRATION_STATE.");
+ Log.w(LOG_TAG, "error parsing RegistrationState: " + ex);
}
} else {
throw new RuntimeException("Warning! Wrong number of parameters returned from "
@@ -604,29 +583,28 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
+ states.length);
}
- mCdmaRoaming = regCodeIsRoaming(this.mRegistrationState);
- this.newCdmaDataConnectionState =
- radioTechnologyToServiceState(responseValuesRegistrationState[0]);
- newSS.setState (regCodeToServiceState(this.mRegistrationState));
- newSS.setRadioTechnology(responseValuesRegistrationState[0]);
- newSS.setCssIndicator(responseValuesRegistrationState[4]);
- newSS.setSystemAndNetworkId(responseValuesRegistrationState[5],
- responseValuesRegistrationState[6]);
+ mRegistrationState = registrationState;
+ mCdmaRoaming = regCodeIsRoaming(registrationState);
+ newSS.setState (regCodeToServiceState(registrationState));
+
+ this.newCdmaDataConnectionState = radioTechnologyToDataServiceState(radioTechnology);
+ newSS.setRadioTechnology(radioTechnology);
+ newNetworkType = radioTechnology;
- mRoamingIndicator = responseValuesRegistrationState[7];
- mIsInPrl = responseValuesRegistrationState[8];
- mDefaultRoamingIndicator = responseValuesRegistrationState[9];
+ newSS.setCssIndicator(cssIndicator);
+ newSS.setSystemAndNetworkId(systemId, networkId);
+ mRoamingIndicator = roamingIndicator;
+ mIsInPrl = (systemIsInPrl == 0) ? false : true;
+ mDefaultRoamingIndicator = defaultRoamingIndicator;
- newNetworkType = responseValuesRegistrationState[0];
// values are -1 if not available
- newCellLoc.setCellLocationData(responseValuesRegistrationState[1],
- responseValuesRegistrationState[2],
- responseValuesRegistrationState[3]);
+ newCellLoc.setCellLocationData(baseStationId, baseStationLatitude,
+ baseStationLongitude);
- if (responseValuesRegistrationState[10] == 0) {
+ if (reasonForDenial == 0) {
mRegistrationDeniedReason = ServiceStateTracker.REGISTRATION_DENIED_GEN;
- } else if (responseValuesRegistrationState[10] == 1) {
+ } else if (reasonForDenial == 1) {
mRegistrationDeniedReason = ServiceStateTracker.REGISTRATION_DENIED_AUTH;
} else {
mRegistrationDeniedReason = "";
@@ -641,9 +619,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
String opNames[] = (String[])ar.result;
if (opNames != null && opNames.length >= 3) {
- // TODO(Teleca): Is this necessary here and in the else clause?
- newSS.setOperatorName(opNames[0], opNames[1], opNames[2]);
- if (phone.mCM.getRadioState().isNVReady()) {
+ if (cm.getRadioState().isNVReady()) {
// In CDMA in case on NV the ss.mOperatorAlphaLong is set later with the
// ERI text, so here is ignored what is coming from the modem
newSS.setOperatorName(null, opNames[1], opNames[2]);
@@ -695,28 +671,25 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
newSS.setRoaming(mCdmaRoaming);
}
- /**
- * TODO(Teleca): This would be simpler if mIsInPrl was a "boolean" as the
- * name implies rather than tri-state. Above I've suggested that the -1's
- * might be able to be removed, if so please simplify this. Otherwise change
- * the name to mPrlState or some such. Also the logic can be simplified
- * by testing for "mIsInPrl" only once.
- */
// Setting SS CdmaRoamingIndicator and CdmaDefaultRoamingIndicator
- // TODO(Teleca): use constants for the standard roaming indicators
- if (mIsInPrl == 0 && mRegistrationState == 5) {
- // System is acquired but prl not loaded or no prl match
- newSS.setCdmaRoamingIndicator(2); //FLASHING
- } else if (!namMatch && (mIsInPrl == 1)) {
- // System is acquired, no nam match, prl match
- newSS.setCdmaRoamingIndicator(mRoamingIndicator);
- } else if (namMatch && (mIsInPrl == 1) && mRoamingIndicator <= 2) {
- // System is acquired, nam match, prl match, mRoamingIndicator <= 2
- newSS.setCdmaRoamingIndicator(1); //OFF
- } else if (namMatch && (mIsInPrl == 1) && mRoamingIndicator > 2) {
- // System is acquired, nam match, prl match, mRoamingIndicator > 2
- newSS.setCdmaRoamingIndicator(mRoamingIndicator);
- }
+ // TODO(Teleca): Validate this is correct.
+ if (mIsInPrl) {
+ if (namMatch && (mRoamingIndicator <= 2)) {
+ // System is acquired, prl match, nam match and mRoamingIndicator <= 2
+ newSS.setCdmaRoamingIndicator(EriInfo.ROAMING_INDICATOR_OFF);
+ } else {
+ // System is acquired, prl match, no nam match or mRoamingIndicator > 2
+ newSS.setCdmaRoamingIndicator(mRoamingIndicator);
+ }
+ } else {
+ if (mRegistrationState == 5) {
+ // System is acquired but prl not loaded or no prl match
+ newSS.setCdmaRoamingIndicator(EriInfo.ROAMING_INDICATOR_FLASH);
+ } else {
+ // Use the default indicator
+ }
+ }
+
newSS.setCdmaDefaultRoamingIndicator(mDefaultRoamingIndicator);
// NOTE: Some operator may require to override the mCdmaRoaming (set by the modem)
@@ -725,7 +698,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
if (DBG) {
log("Set CDMA Roaming Indicator to: " + newSS.getCdmaRoamingIndicator()
+ ". mCdmaRoaming = " + mCdmaRoaming + ", namMatch = " + namMatch
- + ", mIsInPrl= " + mIsInPrl + ", mRoamingIndicator = " + mRoamingIndicator
+ + ", mIsInPrl = " + mIsInPrl + ", mRoamingIndicator = " + mRoamingIndicator
+ ", mDefaultRoamingIndicator= " + mDefaultRoamingIndicator);
}
pollStateDone();
@@ -882,20 +855,12 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
&& newSS.getState() != ServiceState.STATE_IN_SERVICE;
boolean hasCdmaDataConnectionAttached =
- (this.cdmaDataConnectionState != ServiceState.RADIO_TECHNOLOGY_1xRTT
- && this.cdmaDataConnectionState != ServiceState.RADIO_TECHNOLOGY_EVDO_0
- && this.cdmaDataConnectionState != ServiceState.RADIO_TECHNOLOGY_EVDO_A)
- && (this.newCdmaDataConnectionState == ServiceState.RADIO_TECHNOLOGY_1xRTT
- || this.newCdmaDataConnectionState == ServiceState.RADIO_TECHNOLOGY_EVDO_0
- || this.newCdmaDataConnectionState == ServiceState.RADIO_TECHNOLOGY_EVDO_A);
+ this.cdmaDataConnectionState != ServiceState.STATE_IN_SERVICE
+ && this.newCdmaDataConnectionState == ServiceState.STATE_IN_SERVICE;
boolean hasCdmaDataConnectionDetached =
- (this.cdmaDataConnectionState == ServiceState.RADIO_TECHNOLOGY_1xRTT
- || this.cdmaDataConnectionState == ServiceState.RADIO_TECHNOLOGY_EVDO_0
- || this.cdmaDataConnectionState == ServiceState.RADIO_TECHNOLOGY_EVDO_A)
- && (this.newCdmaDataConnectionState != ServiceState.RADIO_TECHNOLOGY_1xRTT
- && this.newCdmaDataConnectionState != ServiceState.RADIO_TECHNOLOGY_EVDO_0
- && this.newCdmaDataConnectionState != ServiceState.RADIO_TECHNOLOGY_EVDO_A);
+ this.cdmaDataConnectionState == ServiceState.STATE_IN_SERVICE
+ && this.newCdmaDataConnectionState != ServiceState.STATE_IN_SERVICE;
boolean hasCdmaDataConnectionChanged =
cdmaDataConnectionState != newCdmaDataConnectionState;
@@ -938,18 +903,16 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
}
if (hasChanged) {
- if (phone.mCM.getRadioState().isNVReady()) {
+ if (cm.getRadioState().isNVReady()) {
String eriText;
// Now the CDMAPhone sees the new ServiceState so it can get the new ERI text
if (ss.getState() == ServiceState.STATE_IN_SERVICE) {
eriText = phone.getCdmaEriText();
} else {
- // Note that this is valid only for mRegistrationState 2,3,4, not 0!
- /**
- * TODO(Teleca): From the comment this apparently isn't always true
- * should there be additional logic with other strings?
- */
- eriText = EriInfo.SEARCHING_TEXT;
+ // Note that ServiceState.STATE_OUT_OF_SERVICE is valid used for
+ // mRegistrationState 0,2,3 and 4
+ eriText = phone.getContext().getText(
+ com.android.internal.R.string.roamingTextSearching).toString();
}
ss.setCdmaEriText(eriText);
}
@@ -1047,6 +1010,12 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
return guess;
}
+ /**
+ * TODO: This code is exactly the same as in GsmServiceStateTracker
+ * and has a TODO to not poll signal strength if screen is off.
+ * This code should probably be hoisted to the base class so
+ * the fix, when added, works for both.
+ */
private void
queueNextSignalStrengthPoll() {
if (dontPollSignalStrength || (cm.getRadioState().isGsm())) {
@@ -1060,7 +1029,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
msg = obtainMessage();
msg.what = EVENT_POLL_SIGNAL_STRENGTH;
- // TODO(Teleca): Don't poll signal strength if screen is off
+ // TODO Don't poll signal strength if screen is off
sendMessageDelayed(msg, POLL_PERIOD_MILLIS);
}
@@ -1108,8 +1077,8 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
}
- private int radioTechnologyToServiceState(int code) {
- int retVal = ServiceState.RADIO_TECHNOLOGY_UNKNOWN;
+ private int radioTechnologyToDataServiceState(int code) {
+ int retVal = ServiceState.STATE_OUT_OF_SERVICE;
switch(code) {
case 0:
case 1:
@@ -1118,14 +1087,10 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
case 4:
case 5:
break;
- case 6:
- retVal = ServiceState.RADIO_TECHNOLOGY_1xRTT;
- break;
- case 7:
- retVal = ServiceState.RADIO_TECHNOLOGY_EVDO_0;
- break;
- case 8:
- retVal = ServiceState.RADIO_TECHNOLOGY_EVDO_A;
+ case 6: // RADIO_TECHNOLOGY_1xRTT
+ case 7: // RADIO_TECHNOLOGY_EVDO_0
+ case 8: // RADIO_TECHNOLOGY_EVDO_A
+ retVal = ServiceState.STATE_IN_SERVICE;
break;
default:
Log.e(LOG_TAG, "Wrong radioTechnology code.");
@@ -1435,4 +1400,12 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
Log.d(LOG_TAG, "[CdmaServiceStateTracker] " + s);
}
+ public String getMdnNumber() {
+ return mMdn;
+ }
+
+ public String getCdmaMin() {
+ return mMin;
+ }
+
}
diff --git a/telephony/java/com/android/internal/telephony/cdma/EriInfo.java b/telephony/java/com/android/internal/telephony/cdma/EriInfo.java
index 40358c8..5c8e23e 100644
--- a/telephony/java/com/android/internal/telephony/cdma/EriInfo.java
+++ b/telephony/java/com/android/internal/telephony/cdma/EriInfo.java
@@ -23,28 +23,6 @@ public final class EriInfo {
public static final int ROAMING_ICON_MODE_NORMAL = 0;
public static final int ROAMING_ICON_MODE_FLASH = 1;
- /**
- * TODO(Teleca): These strings appear to be used by the UI
- * hence they must be changed to resources so they can be
- * translated to the appropriate language.
- */
- public static final String ROAMING_TEXT_0 = "Roaming Indicator On";
- public static final String ROAMING_TEXT_1 = "Roaming Indicator Off";
- public static final String ROAMING_TEXT_2 = "Roaming Indicator Flashing";
- public static final String ROAMING_TEXT_3 = "Out of Neighborhood";
- public static final String ROAMING_TEXT_4 = "Out of Building";
- public static final String ROAMING_TEXT_5 = "Roaming - Preferred System";
- public static final String ROAMING_TEXT_6 = "Roaming - Available System";
- public static final String ROAMING_TEXT_7 = "Roaming - Alliance Partner";
- public static final String ROAMING_TEXT_8 = "Roaming - Premium Partner";
- public static final String ROAMING_TEXT_9 = "Roaming - Full Service Functionality";
- public static final String ROAMING_TEXT_10 = "Roaming - Partial Service Functionality";
- public static final String ROAMING_TEXT_11 = "Roaming Banner On";
- public static final String ROAMING_TEXT_12 = "Roaming Banner Off";
-
- public static final String SEARCHING_TEXT = "Searching for Svc.";
-
-
public int mRoamingIndicator;
public int mIconIndex;
public int mIconMode;
diff --git a/telephony/java/com/android/internal/telephony/cdma/EriManager.java b/telephony/java/com/android/internal/telephony/cdma/EriManager.java
index d905e66..0997456 100644
--- a/telephony/java/com/android/internal/telephony/cdma/EriManager.java
+++ b/telephony/java/com/android/internal/telephony/cdma/EriManager.java
@@ -28,17 +28,12 @@ import com.android.internal.util.XmlUtils;
import java.util.HashMap;
/**
- * TODO(Teleca): Please as some comments on how this class is to
- * be used. We've removed Handler as a base class and instead
- * recommend that child classes add a Handler as a member if its
- * needed.
+ * EriManager loads the ERI file definitions and manages the CDMA roaming information.
+ *
*/
-
-
public final class EriManager {
class EriFile {
- public static final int MAX_ERI_ENTRIES = 30;
public int mVersionNumber; // File version number
public int mNumberOfEriEntries; // Number of entries
@@ -55,7 +50,30 @@ public final class EriManager {
this.mCallPromptId = new String[] { "", "", "" };
this.mRoamIndTable = new HashMap<Integer, EriInfo>();
}
+ }
+
+ class EriDisplayInformation {
+ public int mEriIconIndex;
+ public int mEriIconMode;
+ public String mEriIconText;
+
+ public EriDisplayInformation(int eriIconIndex, int eriIconMode, String eriIconText) {
+ mEriIconIndex = eriIconIndex;
+ mEriIconMode = eriIconMode;
+ mEriIconText = eriIconText;
+ }
+
+// public void setParameters(int eriIconIndex, int eriIconMode, String eriIconText){
+// this.mEriIconIndex = eriIconIndex;
+// this.mEriIconMode = eriIconMode;
+// this.mEriIconText = eriIconText;
+// }
+ @Override
+ public String toString() {
+ return "EriDisplayInformation: {" + " IconIndex: " + mEriIconIndex + " EriIconMode: "
+ + mEriIconMode + " EriIconText: " + mEriIconText + " }";
+ }
}
static final String LOG_TAG = "CDMA";
@@ -67,7 +85,7 @@ public final class EriManager {
private PhoneBase mPhone;
private Context mContext;
private int mEriFileSource = ERI_FROM_XML;
- private boolean isEriFileLoaded = false;
+ private boolean isEriFileLoaded;
private EriFile mEriFile;
public EriManager(PhoneBase phone, Context context, int eriFileSource) {
@@ -214,11 +232,205 @@ public final class EriManager {
* Returns the EriInfo record associated with roamingIndicator
* or null if the entry is not found
*/
- public EriInfo getEriInfo(int roamingIndicator) {
+ private EriInfo getEriInfo(int roamingIndicator) {
if (mEriFile.mRoamIndTable.containsKey(roamingIndicator)) {
return mEriFile.mRoamIndTable.get(roamingIndicator);
} else {
return null;
}
}
+
+ private EriDisplayInformation getEriDisplayInformation(int roamInd, int defRoamInd){
+ //int iconIndex = -1;
+ //int iconMode = -1;
+ //String iconText = "ERI text";
+ EriDisplayInformation ret;
+
+ switch (roamInd) {
+ // Handling the standard roaming indicator (non-ERI)
+ case EriInfo.ROAMING_INDICATOR_ON:
+ ret = new EriDisplayInformation(
+ EriInfo.ROAMING_INDICATOR_ON,
+ EriInfo.ROAMING_ICON_MODE_NORMAL,
+ mContext.getText(com.android.internal.R.string.roamingText0).toString());
+ break;
+
+ case EriInfo.ROAMING_INDICATOR_OFF:
+ ret = new EriDisplayInformation(
+ EriInfo.ROAMING_INDICATOR_OFF,
+ EriInfo.ROAMING_ICON_MODE_NORMAL,
+ mContext.getText(com.android.internal.R.string.roamingText1).toString());
+ break;
+
+ case EriInfo.ROAMING_INDICATOR_FLASH:
+ ret = new EriDisplayInformation(
+ EriInfo.ROAMING_INDICATOR_FLASH,
+ EriInfo.ROAMING_ICON_MODE_FLASH,
+ mContext.getText(com.android.internal.R.string.roamingText2).toString());
+ break;
+
+
+ // Handling the standard ERI
+ case 3:
+ ret = new EriDisplayInformation(
+ roamInd,
+ EriInfo.ROAMING_ICON_MODE_NORMAL,
+ mContext.getText(com.android.internal.R.string.roamingText3).toString());
+ break;
+
+ case 4:
+ ret = new EriDisplayInformation(
+ roamInd,
+ EriInfo.ROAMING_ICON_MODE_NORMAL,
+ mContext.getText(com.android.internal.R.string.roamingText4).toString());
+ break;
+
+ case 5:
+ ret = new EriDisplayInformation(
+ roamInd,
+ EriInfo.ROAMING_ICON_MODE_NORMAL,
+ mContext.getText(com.android.internal.R.string.roamingText5).toString());
+ break;
+
+ case 6:
+ ret = new EriDisplayInformation(
+ roamInd,
+ EriInfo.ROAMING_ICON_MODE_NORMAL,
+ mContext.getText(com.android.internal.R.string.roamingText6).toString());
+ break;
+
+ case 7:
+ ret = new EriDisplayInformation(
+ roamInd,
+ EriInfo.ROAMING_ICON_MODE_NORMAL,
+ mContext.getText(com.android.internal.R.string.roamingText7).toString());
+ break;
+
+ case 8:
+ ret = new EriDisplayInformation(
+ roamInd,
+ EriInfo.ROAMING_ICON_MODE_NORMAL,
+ mContext.getText(com.android.internal.R.string.roamingText8).toString());
+ break;
+
+ case 9:
+ ret = new EriDisplayInformation(
+ roamInd,
+ EriInfo.ROAMING_ICON_MODE_NORMAL,
+ mContext.getText(com.android.internal.R.string.roamingText9).toString());
+ break;
+
+ case 10:
+ ret = new EriDisplayInformation(
+ roamInd,
+ EriInfo.ROAMING_ICON_MODE_NORMAL,
+ mContext.getText(com.android.internal.R.string.roamingText10).toString());
+ break;
+
+ case 11:
+ ret = new EriDisplayInformation(
+ roamInd,
+ EriInfo.ROAMING_ICON_MODE_NORMAL,
+ mContext.getText(com.android.internal.R.string.roamingText11).toString());
+ break;
+
+ case 12:
+ ret = new EriDisplayInformation(
+ roamInd,
+ EriInfo.ROAMING_ICON_MODE_NORMAL,
+ mContext.getText(com.android.internal.R.string.roamingText12).toString());
+ break;
+
+ // Handling the non standard Enhanced Roaming Indicator (roamInd > 63)
+ default:
+ if (!isEriFileLoaded) {
+ // ERI file NOT loaded
+ Log.d(LOG_TAG, "ERI File not loaded");
+ if(defRoamInd > 2) {
+ Log.d(LOG_TAG, "ERI defRoamInd > 2 ...flashing");
+ ret = new EriDisplayInformation(
+ EriInfo.ROAMING_INDICATOR_FLASH,
+ EriInfo.ROAMING_ICON_MODE_FLASH,
+ mContext.getText(com.android.internal
+ .R.string.roamingText2).toString());
+ } else {
+ Log.d(LOG_TAG, "ERI defRoamInd <= 2");
+ switch (defRoamInd) {
+ case EriInfo.ROAMING_INDICATOR_ON:
+ ret = new EriDisplayInformation(
+ EriInfo.ROAMING_INDICATOR_ON,
+ EriInfo.ROAMING_ICON_MODE_NORMAL,
+ mContext.getText(com.android.internal
+ .R.string.roamingText0).toString());
+ break;
+
+ case EriInfo.ROAMING_INDICATOR_OFF:
+ ret = new EriDisplayInformation(
+ EriInfo.ROAMING_INDICATOR_OFF,
+ EriInfo.ROAMING_ICON_MODE_NORMAL,
+ mContext.getText(com.android.internal
+ .R.string.roamingText1).toString());
+ break;
+
+ case EriInfo.ROAMING_INDICATOR_FLASH:
+ ret = new EriDisplayInformation(
+ EriInfo.ROAMING_INDICATOR_FLASH,
+ EriInfo.ROAMING_ICON_MODE_FLASH,
+ mContext.getText(com.android.internal
+ .R.string.roamingText2).toString());
+ break;
+
+ default:
+ ret = new EriDisplayInformation(-1, -1, "ERI text");
+ }
+ }
+ } else {
+ // ERI file loaded
+ Log.d(LOG_TAG, "ERI File loaded");
+ EriInfo eriInfo = getEriInfo(roamInd);
+ EriInfo defEriInfo = getEriInfo(defRoamInd);
+ if (eriInfo == null) {
+ Log.d(LOG_TAG, "ERI roamInd " + roamInd
+ + " not found in ERI file ...using defRoamInd " + defRoamInd);
+ if(defEriInfo == null) {
+ Log.e(LOG_TAG, "ERI defRoamInd " + defRoamInd
+ + " not found in ERI file ...on");
+ ret = new EriDisplayInformation(
+ EriInfo.ROAMING_INDICATOR_ON,
+ EriInfo.ROAMING_ICON_MODE_NORMAL,
+ mContext.getText(com.android.internal
+ .R.string.roamingText0).toString());
+
+ } else {
+ Log.d(LOG_TAG, "ERI defRoamInd " + defRoamInd + " found in ERI file");
+ ret = new EriDisplayInformation(
+ defEriInfo.mIconIndex,
+ defEriInfo.mIconMode,
+ defEriInfo.mEriText);
+ }
+ } else {
+ Log.d(LOG_TAG, "ERI roamInd " + roamInd + " found in ERI file");
+ ret = new EriDisplayInformation(
+ eriInfo.mIconIndex,
+ eriInfo.mIconMode,
+ eriInfo.mEriText);
+ }
+ }
+ break;
+ }
+ Log.d(LOG_TAG, "Displaying ERI " + ret.toString());
+ return ret;
+ }
+
+ public int getCdmaEriIconIndex(int roamInd, int defRoamInd){
+ return getEriDisplayInformation(roamInd, defRoamInd).mEriIconIndex;
+ }
+
+ public int getCdmaEriIconMode(int roamInd, int defRoamInd){
+ return getEriDisplayInformation(roamInd, defRoamInd).mEriIconMode;
+ }
+
+ public String getCdmaEriText(int roamInd, int defRoamInd){
+ return getEriDisplayInformation(roamInd, defRoamInd).mEriIconText;
+ }
}
diff --git a/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java b/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java
index d5b8379..7edd30f 100644
--- a/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java
+++ b/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java
@@ -55,11 +55,8 @@ public final class RuimRecords extends IccRecords {
//***** Instance Variables
- private String mImsi; // TODO(Teleca): to be checked, if this should be removed!
- private String mMyMobileNumber;
- private String mSid; // TODO(Teleca): Unused should this be removed
- private String mNid; // TODO(Teleca): Unused should this be removed
- private String mMin2Min1;
+ String spn;
+ int spnDisplayCondition;
//***** Event Constants
@@ -134,19 +131,6 @@ public final class RuimRecords extends IccRecords {
recordsRequested = false;
}
- /** Returns null if RUIM is not yet ready */
- public String getIMSI_M() {
- return mImsi;
- }
-
- public String getMdnNumber() {
- return mMyMobileNumber;
- }
-
- public String getCdmaMin() {
- return mMin2Min1;
- }
-
@Override
public void setVoiceMailNumber(String alphaTag, String voiceNumber, Message onComplete){
// In CDMA this is Operator/OEM dependent
@@ -171,32 +155,6 @@ public final class RuimRecords extends IccRecords {
}
}
- /**
- * Returns the 5 or 6 digit MCC/MNC of the operator that
- * provided the RUIM card. Returns null of RUIM is not yet ready
- */
- public String getRUIMOperatorNumeric() {
- if (mImsi == null) {
- return null;
- }
-
- if (mncLength != 0) {
- // Length = length of MCC + length of MNC
- // TODO: change spec name
- // length of mcc = 3 (3GPP2 C.S0005 - Section 2.3)
- return mImsi.substring(0, 3 + mncLength);
- }
-
- // Guess the MNC length based on the MCC if we don't
- // have a valid value in ef[ad]
-
- int mcc;
-
- mcc = Integer.parseInt(mImsi.substring(0,3));
-
- return mImsi.substring(0, 3 + MccTable.smallestDigitsMccForMnc(mcc));
- }
-
@Override
public void handleMessage(Message msg) {
AsyncResult ar;
@@ -223,28 +181,35 @@ public final class RuimRecords extends IccRecords {
/* IO events */
case EVENT_GET_CDMA_SUBSCRIPTION_DONE:
+ // TODO(Moto):TODO(Teleca): This event was removed by Teleca/QCT
+ // I've left it as it's needed to complete EVENT_OTA_PROVISION_STATUS_CHANGE.
+ // But since various instance variables are removed I've commented
+ // out code that references them. I'm sure this is wrong so
+ // Moto/Teleca/QCT need to come to an agreement. Also see onRuimReady
+ // and onVnReady.
+
ar = (AsyncResult)msg.obj;
String localTemp[] = (String[])ar.result;
if (ar.exception != null) {
break;
}
if(m_ota_commited) {
- if(mMyMobileNumber != localTemp[0]) {
+ //if(mMyMobileNumber != localTemp[0]) {
Intent intent = new Intent(TelephonyIntents.ACTION_CDMA_OTA_MDN_CHANGED);
intent.putExtra("mdn", localTemp[0]);
Log.d(LOG_TAG,"Broadcasting intent MDN Change in OTA ");
ActivityManagerNative.broadcastStickyIntent(intent, null);
- }
+ //}
m_ota_commited=false;
}
- mMyMobileNumber = localTemp[0];
- mSid = localTemp[1];
- mNid = localTemp[2];
- if (localTemp.length >= 3) { // TODO(Moto): remove when new ril always returns min2_min1
- mMin2Min1 = localTemp[3];
- }
+ //mMyMobileNumber = localTemp[0];
+ //mSid = localTemp[1];
+ //mNid = localTemp[2];
+ //if (localTemp.length >= 3) { // TODO(Moto): remove when new ril always returns min2_min1
+ // mMin2Min1 = localTemp[3];
+ //}
- Log.d(LOG_TAG, "MDN: " + mMyMobileNumber + " MIN: " + mMin2Min1);
+ //Log.d(LOG_TAG, "MDN: " + mMyMobileNumber + " MIN: " + mMin2Min1);
break;
@@ -350,14 +315,14 @@ public final class RuimRecords extends IccRecords {
RuimCard.INTENT_VALUE_ICC_READY, null);
fetchRuimRecords();
-
- phone.mCM.getCDMASubscription(obtainMessage(EVENT_GET_CDMA_SUBSCRIPTION_DONE));
-
+
+ // TODO(Moto): TODO(Teleca): Work out how to do CDMA subscription
+ // phone.mCM.getCDMASubscription(obtainMessage(EVENT_GET_CDMA_SUBSCRIPTION_DONE));
}
private void onNvReady() {
- phone.mCM.getCDMASubscription(obtainMessage(EVENT_GET_CDMA_SUBSCRIPTION_DONE));
-
+ // TODO(Moto): TODO(Teleca): Work out how to do CDMA subscription
+ // phone.mCM.getCDMASubscription(obtainMessage(EVENT_GET_CDMA_SUBSCRIPTION_DONE));
}
private void fetchRuimRecords() {
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
index 1d918a3..6e4a495 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
@@ -151,7 +151,6 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
private static final int POLL_PDP_MILLIS = 5 * 1000;
- //WINK:TODO: Teleca, is this really gsm specific, what about CDMA?
private static final String INTENT_RECONNECT_ALARM = "com.android.internal.telephony.gprs-reconnect";
private static final String INTENT_RECONNECT_ALARM_EXTRA_REASON = "reason";
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
index 7a4ea64..63b6a5e 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
@@ -75,13 +75,6 @@ import java.util.TimeZone;
*/
final class GsmServiceStateTracker extends ServiceStateTracker {
- /**
- * TODO(Teleca): John Huang asks: Will you be adding handling of
- * "reason for registration denied in EVENT_POLL_STATE_REGISTRATION?
- * I see some handling of this in CdmaServiceStateTracker, but as I
- * understand it this field was added at the request of a GSM carrier.
- */
-
//***** Instance Variables
GSMPhone phone;
GsmCellLocation cellLoc;
diff --git a/telephony/java/com/android/internal/telephony/gsm/stk/StkService.java b/telephony/java/com/android/internal/telephony/gsm/stk/StkService.java
index 3de14f0..8f0addc 100644
--- a/telephony/java/com/android/internal/telephony/gsm/stk/StkService.java
+++ b/telephony/java/com/android/internal/telephony/gsm/stk/StkService.java
@@ -184,9 +184,6 @@ public class StkService extends Handler implements AppInterface {
mCmdIf.unSetOnStkCallSetUp(this);
this.removeCallbacksAndMessages(null);
-
- //removing instance
- sInstance = null;
}
protected void finalize() {
@@ -450,7 +447,7 @@ public class StkService extends Handler implements AppInterface {
}
/**
- * Used for instantiating the Service from the GsmPhone constructor.
+ * Used for instantiating/updating the Service from the GsmPhone constructor.
*
* @param ci CommandsInterface object
* @param sr SIMRecords object