Merge change 2761 into donut
* changes: TODO's from Teleca with modifications from wink.
This commit is contained in:
BIN
core/res/res/drawable/stat_sys_vp_phone_call_bluetooth.png
Normal file
BIN
core/res/res/drawable/stat_sys_vp_phone_call_bluetooth.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 815 B |
@@ -148,6 +148,24 @@
|
|||||||
<!-- Meaning: unknown. Example: Service was enabled for: Voice, PAD -->
|
<!-- Meaning: unknown. Example: Service was enabled for: Voice, PAD -->
|
||||||
<string name="serviceClassPAD">PAD</string>
|
<string name="serviceClassPAD">PAD</string>
|
||||||
|
|
||||||
|
<!-- CDMA Roaming Indicator Strings (non ERI)--> <skip />
|
||||||
|
<!-- Default roaming indicator text -->
|
||||||
|
<string name="roamingText0">Roaming Indicator On</string>
|
||||||
|
<string name="roamingText1">Roaming Indicator Off</string>
|
||||||
|
<string name="roamingText2">Roaming Indicator Flashing</string>
|
||||||
|
<string name="roamingText3">Out of Neighborhood</string>
|
||||||
|
<string name="roamingText4">Out of Building</string>
|
||||||
|
<string name="roamingText5">Roaming - Preferred System</string>
|
||||||
|
<string name="roamingText6">Roaming - Available System</string>
|
||||||
|
<string name="roamingText7">Roaming - Alliance Partner</string>
|
||||||
|
<string name="roamingText8">Roaming - Premium Partner</string>
|
||||||
|
<string name="roamingText9">Roaming - Full Service Functionality</string>
|
||||||
|
<string name="roamingText10">Roaming - Partial Service Functionality</string>
|
||||||
|
<string name="roamingText11">Roaming Banner On</string>
|
||||||
|
<string name="roamingText12">Roaming Banner Off</string>
|
||||||
|
<string name="roamingTextSearching">Searching for Service</string>
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
{0} is one of "bearerServiceCode*"
|
{0} is one of "bearerServiceCode*"
|
||||||
{1} is dialing number
|
{1} is dialing number
|
||||||
|
|||||||
@@ -840,30 +840,10 @@ public class StatusBarPolicy {
|
|||||||
updateDataIcon();
|
updateDataIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(Teleca): I've add isCdma() to reduce some code duplication and simplify.
|
|
||||||
// Please validate the correctness of these changes
|
|
||||||
private boolean isCdma() {
|
private boolean isCdma() {
|
||||||
// Is this equivalent, if so it seems simpler?
|
return ((mPhone != null) && (mPhone.getPhoneType() == TelephonyManager.PHONE_TYPE_CDMA));
|
||||||
// return ((mPhone != null) && (mPhone.getPhoneType() == TelephonyManager.PHONE_TYPE_CDMA));
|
|
||||||
|
|
||||||
if (mServiceState != null) {
|
|
||||||
switch(mServiceState.getRadioTechnology()) {
|
|
||||||
case ServiceState.RADIO_TECHNOLOGY_1xRTT:
|
|
||||||
case ServiceState.RADIO_TECHNOLOGY_EVDO_0:
|
|
||||||
case ServiceState.RADIO_TECHNOLOGY_EVDO_A:
|
|
||||||
case ServiceState.RADIO_TECHNOLOGY_IS95A:
|
|
||||||
case ServiceState.RADIO_TECHNOLOGY_IS95B:
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(Teleca): I've add hasService() to reduce some code duplication and simplify.
|
|
||||||
// Please validate the correctness of these changes.
|
|
||||||
private boolean hasService() {
|
private boolean hasService() {
|
||||||
if (mServiceState != null) {
|
if (mServiceState != null) {
|
||||||
switch (mServiceState.getState()) {
|
switch (mServiceState.getState()) {
|
||||||
@@ -1223,10 +1203,12 @@ public class StatusBarPolicy {
|
|||||||
private final void updateCdmaRoamingIcon() {
|
private final void updateCdmaRoamingIcon() {
|
||||||
if (!hasService()) {
|
if (!hasService()) {
|
||||||
mService.setIconVisibility(mCdmaRoamingIndicatorIcon, false);
|
mService.setIconVisibility(mCdmaRoamingIndicatorIcon, false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isCdma()) {
|
if (!isCdma()) {
|
||||||
mService.setIconVisibility(mCdmaRoamingIndicatorIcon, false);
|
mService.setIconVisibility(mCdmaRoamingIndicatorIcon, false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int[] iconList = sRoamingIndicatorImages_cdma;
|
int[] iconList = sRoamingIndicatorImages_cdma;
|
||||||
@@ -1256,8 +1238,10 @@ public class StatusBarPolicy {
|
|||||||
mService.setIconVisibility(mCdmaRoamingIndicatorIcon, true);
|
mService.setIconVisibility(mCdmaRoamingIndicatorIcon, true);
|
||||||
break;
|
break;
|
||||||
case EriInfo.ROAMING_ICON_MODE_FLASH:
|
case EriInfo.ROAMING_ICON_MODE_FLASH:
|
||||||
mCdmaRoamingIndicatorIconData.iconId = com.android.internal.R.drawable.stat_sys_roaming_cdma_flash;
|
mCdmaRoamingIndicatorIconData.iconId =
|
||||||
|
com.android.internal.R.drawable.stat_sys_roaming_cdma_flash;
|
||||||
mService.updateIcon(mCdmaRoamingIndicatorIcon, mCdmaRoamingIndicatorIconData, null);
|
mService.updateIcon(mCdmaRoamingIndicatorIcon, mCdmaRoamingIndicatorIconData, null);
|
||||||
|
mService.setIconVisibility(mCdmaRoamingIndicatorIcon, true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1258,10 +1258,7 @@ public interface CommandsInterface {
|
|||||||
* @param result
|
* @param result
|
||||||
* Callback message is empty on completion
|
* Callback message is empty on completion
|
||||||
*/
|
*/
|
||||||
/**
|
// TODO: Change the configValuesArray to a RIL_BroadcastSMSConfig
|
||||||
* TODO(Teleca): configValuesArray is represented as a RIL_BroadcastSMSConfig
|
|
||||||
* so we think this should be a class with the appropriate parameters not an array?
|
|
||||||
*/
|
|
||||||
public void setCdmaBroadcastConfig(int[] configValuesArray, Message result);
|
public void setCdmaBroadcastConfig(int[] configValuesArray, Message result);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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 {
|
public abstract class PhoneBase implements Phone {
|
||||||
private static final String LOG_TAG = "PHONE";
|
private static final String LOG_TAG = "PHONE";
|
||||||
private static final boolean LOCAL_DEBUG = true;
|
private static final boolean LOCAL_DEBUG = true;
|
||||||
|
|||||||
@@ -3302,10 +3302,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
|
|||||||
send(rr);
|
send(rr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// TODO: Change the configValuesArray to a RIL_BroadcastSMSConfig
|
||||||
* TODO(Teleca): configValuesArray is represented as a RIL_BroadcastSMSConfig
|
|
||||||
* so we think this should be a class with the appropriate parameters not an array?
|
|
||||||
*/
|
|
||||||
public void setCdmaBroadcastConfig(int[] configValuesArray, Message response) {
|
public void setCdmaBroadcastConfig(int[] configValuesArray, Message response) {
|
||||||
RILRequest rr = RILRequest.obtain(RIL_REQUEST_CDMA_SET_BROADCAST_CONFIG, response);
|
RILRequest rr = RILRequest.obtain(RIL_REQUEST_CDMA_SET_BROADCAST_CONFIG, response);
|
||||||
|
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ public class CDMAPhone extends PhoneBase {
|
|||||||
public DataActivityState getDataActivityState() {
|
public DataActivityState getDataActivityState() {
|
||||||
DataActivityState ret = DataActivityState.NONE;
|
DataActivityState ret = DataActivityState.NONE;
|
||||||
|
|
||||||
if (mSST.getCurrentCdmaDataConnectionState() != ServiceState.RADIO_TECHNOLOGY_UNKNOWN) {
|
if (mSST.getCurrentCdmaDataConnectionState() == ServiceState.STATE_IN_SERVICE) {
|
||||||
|
|
||||||
switch (mDataConnection.getActivity()) {
|
switch (mDataConnection.getActivity()) {
|
||||||
case DATAIN:
|
case DATAIN:
|
||||||
@@ -384,11 +384,11 @@ public class CDMAPhone extends PhoneBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getLine1Number() {
|
public String getLine1Number() {
|
||||||
return mRuimRecords.getMdnNumber();
|
return mSST.getMdnNumber();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCdmaMIN() {
|
public String getCdmaMIN() {
|
||||||
return mRuimRecords.getCdmaMin();
|
return mSST.getCdmaMin();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getCallWaiting(Message onComplete) {
|
public void getCallWaiting(Message onComplete) {
|
||||||
@@ -545,8 +545,7 @@ public class CDMAPhone extends PhoneBase {
|
|||||||
// already been called
|
// already been called
|
||||||
|
|
||||||
ret = DataState.DISCONNECTED;
|
ret = DataState.DISCONNECTED;
|
||||||
} else if (mSST.getCurrentCdmaDataConnectionState()
|
} else if (mSST.getCurrentCdmaDataConnectionState() != ServiceState.STATE_IN_SERVICE) {
|
||||||
== ServiceState.RADIO_TECHNOLOGY_UNKNOWN) {
|
|
||||||
// If we're out of service, open TCP sockets may still work
|
// If we're out of service, open TCP sockets may still work
|
||||||
// but no data will flow
|
// but no data will flow
|
||||||
ret = DataState.DISCONNECTED;
|
ret = DataState.DISCONNECTED;
|
||||||
@@ -1159,61 +1158,7 @@ public class CDMAPhone extends PhoneBase {
|
|||||||
public int getCdmaEriIconIndex() {
|
public int getCdmaEriIconIndex() {
|
||||||
int roamInd = getServiceState().getCdmaRoamingIndicator();
|
int roamInd = getServiceState().getCdmaRoamingIndicator();
|
||||||
int defRoamInd = getServiceState().getCdmaDefaultRoamingIndicator();
|
int defRoamInd = getServiceState().getCdmaDefaultRoamingIndicator();
|
||||||
int ret = -1;
|
return mEriManager.getCdmaEriIconIndex(roamInd, defRoamInd);
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1225,60 +1170,7 @@ public class CDMAPhone extends PhoneBase {
|
|||||||
public int getCdmaEriIconMode() {
|
public int getCdmaEriIconMode() {
|
||||||
int roamInd = getServiceState().getCdmaRoamingIndicator();
|
int roamInd = getServiceState().getCdmaRoamingIndicator();
|
||||||
int defRoamInd = getServiceState().getCdmaDefaultRoamingIndicator();
|
int defRoamInd = getServiceState().getCdmaDefaultRoamingIndicator();
|
||||||
int ret = -1;
|
return mEriManager.getCdmaEriIconMode(roamInd, defRoamInd);
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1288,94 +1180,6 @@ public class CDMAPhone extends PhoneBase {
|
|||||||
public String getCdmaEriText() {
|
public String getCdmaEriText() {
|
||||||
int roamInd = getServiceState().getCdmaRoamingIndicator();
|
int roamInd = getServiceState().getCdmaRoamingIndicator();
|
||||||
int defRoamInd = getServiceState().getCdmaDefaultRoamingIndicator();
|
int defRoamInd = getServiceState().getCdmaDefaultRoamingIndicator();
|
||||||
String ret = "ERI text";
|
return mEriManager.getCdmaEriText(roamInd, defRoamInd);
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,21 +29,12 @@ public interface CallFailCause {
|
|||||||
// Busy Tone
|
// Busy Tone
|
||||||
static final int USER_BUSY = 17;
|
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;
|
static final int NORMAL_UNSPECIFIED = 31;
|
||||||
//
|
|
||||||
// // Congestion Tone
|
// Congestion Tone
|
||||||
static final int NO_CIRCUIT_AVAIL = 34;
|
static final int NO_CIRCUIT_AVAIL = 34;
|
||||||
// static final int TEMPORARY_FAILURE = 41;
|
|
||||||
// static final int SWITCHING_CONGESTION = 42;
|
// others
|
||||||
// static final int CHANNEL_NOT_AVAIL = 44;
|
|
||||||
// static final int QOS_NOT_AVAIL = 49;
|
|
||||||
// static final int BEARER_NOT_AVAIL = 58;
|
|
||||||
//
|
|
||||||
// // others
|
|
||||||
static final int ACM_LIMIT_EXCEEDED = 68;
|
static final int ACM_LIMIT_EXCEEDED = 68;
|
||||||
static final int CALL_BARRED = 240;
|
static final int CALL_BARRED = 240;
|
||||||
static final int FDN_BLOCKED = 241;
|
static final int FDN_BLOCKED = 241;
|
||||||
|
|||||||
@@ -361,9 +361,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
|
|||||||
boolean desiredPowerState = mCdmaPhone.mSST.getDesiredPowerState();
|
boolean desiredPowerState = mCdmaPhone.mSST.getDesiredPowerState();
|
||||||
|
|
||||||
if ((state == State.IDLE || state == State.SCANNING)
|
if ((state == State.IDLE || state == State.SCANNING)
|
||||||
&& (psState == ServiceState.RADIO_TECHNOLOGY_1xRTT ||
|
&& (psState == ServiceState.STATE_IN_SERVICE)
|
||||||
psState == ServiceState.RADIO_TECHNOLOGY_EVDO_0 ||
|
|
||||||
psState == ServiceState.RADIO_TECHNOLOGY_EVDO_A)
|
|
||||||
&& ((phone.mCM.getRadioState() == CommandsInterface.RadioState.NV_READY) ||
|
&& ((phone.mCM.getRadioState() == CommandsInterface.RadioState.NV_READY) ||
|
||||||
mCdmaPhone.mRuimRecords.getRecordsLoaded())
|
mCdmaPhone.mRuimRecords.getRecordsLoaded())
|
||||||
&& (mCdmaPhone.mSST.isConcurrentVoiceAndData() ||
|
&& (mCdmaPhone.mSST.isConcurrentVoiceAndData() ||
|
||||||
|
|||||||
@@ -69,19 +69,12 @@ import java.util.TimeZone;
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
final class CdmaServiceStateTracker extends ServiceStateTracker {
|
final class CdmaServiceStateTracker extends ServiceStateTracker {
|
||||||
|
|
||||||
//***** Instance Variables
|
//***** Instance Variables
|
||||||
CDMAPhone phone;
|
CDMAPhone phone;
|
||||||
CdmaCellLocation cellLoc;
|
CdmaCellLocation cellLoc;
|
||||||
CdmaCellLocation newCellLoc;
|
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_
|
* The access technology currently in use: DATA_ACCESS_
|
||||||
*/
|
*/
|
||||||
@@ -89,16 +82,13 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
private int newNetworkType = 0;
|
private int newNetworkType = 0;
|
||||||
|
|
||||||
private boolean mCdmaRoaming = false;
|
private boolean mCdmaRoaming = false;
|
||||||
private int mRoamingIndicator = -1;
|
private int mRoamingIndicator;
|
||||||
private int mIsInPrl = -1;
|
private boolean mIsInPrl;
|
||||||
private int mDefaultRoamingIndicator = -1;
|
private int mDefaultRoamingIndicator;
|
||||||
|
|
||||||
/**
|
// Initially we assume no data connection
|
||||||
* TODO(Teleca): Maybe these should be initialized to STATE_OUT_OF_SERVICE like gprsState
|
private int cdmaDataConnectionState = ServiceState.STATE_OUT_OF_SERVICE;
|
||||||
* in GsmServiceStateTracker and remove the comment.
|
private int newCdmaDataConnectionState = ServiceState.STATE_OUT_OF_SERVICE;
|
||||||
*/
|
|
||||||
private int cdmaDataConnectionState = -1; // Initially we assume no data connection
|
|
||||||
private int newCdmaDataConnectionState = -1; // Initially we assume no data connection
|
|
||||||
private int mRegistrationState = -1;
|
private int mRegistrationState = -1;
|
||||||
private RegistrantList cdmaDataConnectionAttachedRegistrants = new RegistrantList();
|
private RegistrantList cdmaDataConnectionAttachedRegistrants = new RegistrantList();
|
||||||
private RegistrantList cdmaDataConnectionDetachedRegistrants = 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
|
// We can't register for SIM_RECORDS_LOADED immediately because the
|
||||||
// SIMRecords object may not be instantiated yet.
|
// SIMRecords object may not be instantiated yet.
|
||||||
private boolean mNeedToRegForRuimLoaded;
|
private boolean mNeedToRegForRuimLoaded = false;
|
||||||
|
|
||||||
// Wake lock used while setting time of day.
|
// Wake lock used while setting time of day.
|
||||||
private PowerManager.WakeLock mWakeLock;
|
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.
|
// Keep track of SPN display rules, so we only broadcast intent if something changes.
|
||||||
private String curSpn = null;
|
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 int curSpnRule = 0;
|
||||||
|
|
||||||
private String mMdn = null;
|
private String mMdn;
|
||||||
private int mHomeSystemId = -1;
|
private int mHomeSystemId;
|
||||||
private int mHomeNetworkId = -1;
|
private int mHomeNetworkId;
|
||||||
private String mMin = null;
|
private String mMin;
|
||||||
|
|
||||||
private boolean isEriTextLoaded = false;
|
private boolean isEriTextLoaded = false;
|
||||||
private boolean isSubscriptionFromRuim = false;
|
private boolean isSubscriptionFromRuim = false;
|
||||||
|
|
||||||
/**
|
// Registration Denied Reason, General/Authentication Failure, used only for debugging purposes
|
||||||
* TODO(Teleca): Is this purely for debugging purposes, or do we expect this string to be
|
private String mRegistrationDeniedReason;
|
||||||
* 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;
|
|
||||||
|
|
||||||
//***** Constants
|
//***** Constants
|
||||||
static final String LOG_TAG = "CDMA";
|
static final String LOG_TAG = "CDMA";
|
||||||
@@ -243,9 +231,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
Registrant r = new Registrant(h, what, obj);
|
Registrant r = new Registrant(h, what, obj);
|
||||||
cdmaDataConnectionAttachedRegistrants.add(r);
|
cdmaDataConnectionAttachedRegistrants.add(r);
|
||||||
|
|
||||||
if (cdmaDataConnectionState == ServiceState.RADIO_TECHNOLOGY_1xRTT
|
if (cdmaDataConnectionState == ServiceState.STATE_IN_SERVICE) {
|
||||||
|| cdmaDataConnectionState == ServiceState.RADIO_TECHNOLOGY_EVDO_0
|
|
||||||
|| cdmaDataConnectionState == ServiceState.RADIO_TECHNOLOGY_EVDO_A) {
|
|
||||||
r.notifyRegistrant();
|
r.notifyRegistrant();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -264,9 +250,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
Registrant r = new Registrant(h, what, obj);
|
Registrant r = new Registrant(h, what, obj);
|
||||||
cdmaDataConnectionDetachedRegistrants.add(r);
|
cdmaDataConnectionDetachedRegistrants.add(r);
|
||||||
|
|
||||||
if (cdmaDataConnectionState != ServiceState.RADIO_TECHNOLOGY_1xRTT
|
if (cdmaDataConnectionState != ServiceState.STATE_IN_SERVICE) {
|
||||||
&& cdmaDataConnectionState != ServiceState.RADIO_TECHNOLOGY_EVDO_0
|
|
||||||
&& cdmaDataConnectionState != ServiceState.RADIO_TECHNOLOGY_EVDO_A) {
|
|
||||||
r.notifyRegistrant();
|
r.notifyRegistrant();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -484,30 +468,40 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void updateSpnDisplay() {
|
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
|
} else {
|
||||||
// the RUIM handles the SIM stuff. Please complete this function.
|
// 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;
|
||||||
|
}
|
||||||
|
|
||||||
//int rule = phone.mRuimRecords.getDisplayRule(ss.getOperatorNumeric());
|
if (rule != curSpnRule
|
||||||
String spn = null; //phone.mRuimRecords.getServiceProviderName();
|
|| !TextUtils.equals(spn, curSpn)
|
||||||
String eri = ss.getOperatorAlphaLong();
|
|| !TextUtils.equals(plmn, curPlmn)) {
|
||||||
|
|
||||||
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;
|
|
||||||
Intent intent = new Intent(Intents.SPN_STRINGS_UPDATED_ACTION);
|
Intent intent = new Intent(Intents.SPN_STRINGS_UPDATED_ACTION);
|
||||||
intent.putExtra(Intents.EXTRA_SHOW_SPN, showSpn);
|
intent.putExtra(Intents.EXTRA_SHOW_SPN, showSpn);
|
||||||
intent.putExtra(Intents.EXTRA_SPN, spn);
|
intent.putExtra(Intents.EXTRA_SPN, spn);
|
||||||
intent.putExtra(Intents.EXTRA_SHOW_PLMN, showEri);
|
intent.putExtra(Intents.EXTRA_SHOW_PLMN, showPlmn);
|
||||||
intent.putExtra(Intents.EXTRA_PLMN, eri);
|
intent.putExtra(Intents.EXTRA_PLMN, plmn);
|
||||||
phone.getContext().sendStickyBroadcast(intent);
|
phone.getContext().sendStickyBroadcast(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
//curSpnRule = rule;
|
curSpnRule = rule;
|
||||||
//curSpn = spn;
|
curSpn = spn;
|
||||||
this.curEriText = eri;
|
curPlmn = plmn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -549,54 +543,39 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
}
|
}
|
||||||
} else try {
|
} else try {
|
||||||
switch (what) {
|
switch (what) {
|
||||||
case EVENT_POLL_STATE_REGISTRATION_CDMA: // Handle RIL_REQUEST_REGISTRATION_STATE,
|
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;
|
|
||||||
states = (String[])ar.result;
|
states = (String[])ar.result;
|
||||||
|
|
||||||
/**
|
int registrationState = 4; //[0] registrationState
|
||||||
* TODO(Teleca): Change from array to a "Class" or local
|
int radioTechnology = -1; //[3] radioTechnology
|
||||||
* variables so names instead of index's can be used.
|
int baseStationId = -1; //[4] baseStationId
|
||||||
*/
|
int baseStationLatitude = -1; //[5] baseStationLatitude
|
||||||
int responseValuesRegistrationState[] = {
|
int baseStationLongitude = -1; //[6] baseStationLongitude
|
||||||
-1, //[0] radioTechnology
|
int cssIndicator = 0; //[7] init with 0, because it is treated as a boolean
|
||||||
-1, //[1] baseStationId
|
int systemId = 0; //[8] systemId
|
||||||
-1, //[2] baseStationLatitude
|
int networkId = 0; //[9] networkId
|
||||||
-1, //[3] baseStationLongitude
|
int roamingIndicator = -1; //[10] Roaming indicator
|
||||||
0, //[4] cssIndicator; init with 0, because it is treated as a boolean
|
int systemIsInPrl = 0; //[11] Indicates if current system is in PRL
|
||||||
-1, //[5] systemId
|
int defaultRoamingIndicator = 0; //[12] Is default roaming indicator from PRL
|
||||||
-1, //[6] networkId
|
int reasonForDenial = 0; //[13] Denial reason if registrationState = 3
|
||||||
-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
|
|
||||||
};
|
|
||||||
|
|
||||||
if (states.length == 14) {
|
if (states.length == 14) {
|
||||||
try {
|
try {
|
||||||
this.mRegistrationState = Integer.parseInt(states[0]);
|
registrationState = Integer.parseInt(states[0]);
|
||||||
} catch (NumberFormatException ex) {
|
radioTechnology = Integer.parseInt(states[3]);
|
||||||
Log.w(LOG_TAG, "error parsing RegistrationState: " + ex);
|
baseStationId = Integer.parseInt(states[4], 16);
|
||||||
}
|
baseStationLatitude = Integer.parseInt(states[5], 16);
|
||||||
try {
|
baseStationLongitude = Integer.parseInt(states[6], 16);
|
||||||
responseValuesRegistrationState[0] = Integer.parseInt(states[3]);
|
cssIndicator = Integer.parseInt(states[7]);
|
||||||
responseValuesRegistrationState[1] = Integer.parseInt(states[4], 16);
|
systemId = Integer.parseInt(states[8]);
|
||||||
responseValuesRegistrationState[2] = Integer.parseInt(states[5], 16);
|
networkId = Integer.parseInt(states[9]);
|
||||||
responseValuesRegistrationState[3] = Integer.parseInt(states[6], 16);
|
roamingIndicator = Integer.parseInt(states[10]);
|
||||||
responseValuesRegistrationState[4] = Integer.parseInt(states[7]);
|
systemIsInPrl = Integer.parseInt(states[11]);
|
||||||
responseValuesRegistrationState[5] = Integer.parseInt(states[8]);
|
defaultRoamingIndicator = Integer.parseInt(states[12]);
|
||||||
responseValuesRegistrationState[6] = Integer.parseInt(states[9]);
|
reasonForDenial = Integer.parseInt(states[13]);
|
||||||
responseValuesRegistrationState[7] = Integer.parseInt(states[10]);
|
|
||||||
responseValuesRegistrationState[8] = Integer.parseInt(states[11]);
|
|
||||||
responseValuesRegistrationState[9] = Integer.parseInt(states[12]);
|
|
||||||
responseValuesRegistrationState[10] = Integer.parseInt(states[13]);
|
|
||||||
}
|
}
|
||||||
catch(NumberFormatException ex) {
|
catch(NumberFormatException ex) {
|
||||||
Log.w(LOG_TAG, "Warning! There is an unexpected value"
|
Log.w(LOG_TAG, "error parsing RegistrationState: " + ex);
|
||||||
+ "returned as response from "
|
|
||||||
+ "RIL_REQUEST_REGISTRATION_STATE.");
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new RuntimeException("Warning! Wrong number of parameters returned from "
|
throw new RuntimeException("Warning! Wrong number of parameters returned from "
|
||||||
@@ -604,29 +583,28 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
+ states.length);
|
+ states.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
mCdmaRoaming = regCodeIsRoaming(this.mRegistrationState);
|
mRegistrationState = registrationState;
|
||||||
this.newCdmaDataConnectionState =
|
mCdmaRoaming = regCodeIsRoaming(registrationState);
|
||||||
radioTechnologyToServiceState(responseValuesRegistrationState[0]);
|
newSS.setState (regCodeToServiceState(registrationState));
|
||||||
newSS.setState (regCodeToServiceState(this.mRegistrationState));
|
|
||||||
newSS.setRadioTechnology(responseValuesRegistrationState[0]);
|
|
||||||
newSS.setCssIndicator(responseValuesRegistrationState[4]);
|
|
||||||
newSS.setSystemAndNetworkId(responseValuesRegistrationState[5],
|
|
||||||
responseValuesRegistrationState[6]);
|
|
||||||
|
|
||||||
mRoamingIndicator = responseValuesRegistrationState[7];
|
this.newCdmaDataConnectionState = radioTechnologyToDataServiceState(radioTechnology);
|
||||||
mIsInPrl = responseValuesRegistrationState[8];
|
newSS.setRadioTechnology(radioTechnology);
|
||||||
mDefaultRoamingIndicator = responseValuesRegistrationState[9];
|
newNetworkType = radioTechnology;
|
||||||
|
|
||||||
|
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
|
// values are -1 if not available
|
||||||
newCellLoc.setCellLocationData(responseValuesRegistrationState[1],
|
newCellLoc.setCellLocationData(baseStationId, baseStationLatitude,
|
||||||
responseValuesRegistrationState[2],
|
baseStationLongitude);
|
||||||
responseValuesRegistrationState[3]);
|
|
||||||
|
|
||||||
if (responseValuesRegistrationState[10] == 0) {
|
if (reasonForDenial == 0) {
|
||||||
mRegistrationDeniedReason = ServiceStateTracker.REGISTRATION_DENIED_GEN;
|
mRegistrationDeniedReason = ServiceStateTracker.REGISTRATION_DENIED_GEN;
|
||||||
} else if (responseValuesRegistrationState[10] == 1) {
|
} else if (reasonForDenial == 1) {
|
||||||
mRegistrationDeniedReason = ServiceStateTracker.REGISTRATION_DENIED_AUTH;
|
mRegistrationDeniedReason = ServiceStateTracker.REGISTRATION_DENIED_AUTH;
|
||||||
} else {
|
} else {
|
||||||
mRegistrationDeniedReason = "";
|
mRegistrationDeniedReason = "";
|
||||||
@@ -641,9 +619,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
String opNames[] = (String[])ar.result;
|
String opNames[] = (String[])ar.result;
|
||||||
|
|
||||||
if (opNames != null && opNames.length >= 3) {
|
if (opNames != null && opNames.length >= 3) {
|
||||||
// TODO(Teleca): Is this necessary here and in the else clause?
|
if (cm.getRadioState().isNVReady()) {
|
||||||
newSS.setOperatorName(opNames[0], opNames[1], opNames[2]);
|
|
||||||
if (phone.mCM.getRadioState().isNVReady()) {
|
|
||||||
// In CDMA in case on NV the ss.mOperatorAlphaLong is set later with the
|
// 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
|
// ERI text, so here is ignored what is coming from the modem
|
||||||
newSS.setOperatorName(null, opNames[1], opNames[2]);
|
newSS.setOperatorName(null, opNames[1], opNames[2]);
|
||||||
@@ -695,28 +671,25 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
newSS.setRoaming(mCdmaRoaming);
|
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
|
// Setting SS CdmaRoamingIndicator and CdmaDefaultRoamingIndicator
|
||||||
// TODO(Teleca): use constants for the standard roaming indicators
|
// TODO(Teleca): Validate this is correct.
|
||||||
if (mIsInPrl == 0 && mRegistrationState == 5) {
|
if (mIsInPrl) {
|
||||||
// System is acquired but prl not loaded or no prl match
|
if (namMatch && (mRoamingIndicator <= 2)) {
|
||||||
newSS.setCdmaRoamingIndicator(2); //FLASHING
|
// System is acquired, prl match, nam match and mRoamingIndicator <= 2
|
||||||
} else if (!namMatch && (mIsInPrl == 1)) {
|
newSS.setCdmaRoamingIndicator(EriInfo.ROAMING_INDICATOR_OFF);
|
||||||
// System is acquired, no nam match, prl match
|
} else {
|
||||||
newSS.setCdmaRoamingIndicator(mRoamingIndicator);
|
// System is acquired, prl match, no nam match or mRoamingIndicator > 2
|
||||||
} else if (namMatch && (mIsInPrl == 1) && mRoamingIndicator <= 2) {
|
newSS.setCdmaRoamingIndicator(mRoamingIndicator);
|
||||||
// System is acquired, nam match, prl match, mRoamingIndicator <= 2
|
}
|
||||||
newSS.setCdmaRoamingIndicator(1); //OFF
|
} else {
|
||||||
} else if (namMatch && (mIsInPrl == 1) && mRoamingIndicator > 2) {
|
if (mRegistrationState == 5) {
|
||||||
// System is acquired, nam match, prl match, mRoamingIndicator > 2
|
// System is acquired but prl not loaded or no prl match
|
||||||
newSS.setCdmaRoamingIndicator(mRoamingIndicator);
|
newSS.setCdmaRoamingIndicator(EriInfo.ROAMING_INDICATOR_FLASH);
|
||||||
}
|
} else {
|
||||||
|
// Use the default indicator
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
newSS.setCdmaDefaultRoamingIndicator(mDefaultRoamingIndicator);
|
newSS.setCdmaDefaultRoamingIndicator(mDefaultRoamingIndicator);
|
||||||
|
|
||||||
// NOTE: Some operator may require to override the mCdmaRoaming (set by the modem)
|
// NOTE: Some operator may require to override the mCdmaRoaming (set by the modem)
|
||||||
@@ -725,7 +698,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
if (DBG) {
|
if (DBG) {
|
||||||
log("Set CDMA Roaming Indicator to: " + newSS.getCdmaRoamingIndicator()
|
log("Set CDMA Roaming Indicator to: " + newSS.getCdmaRoamingIndicator()
|
||||||
+ ". mCdmaRoaming = " + mCdmaRoaming + ", namMatch = " + namMatch
|
+ ". mCdmaRoaming = " + mCdmaRoaming + ", namMatch = " + namMatch
|
||||||
+ ", mIsInPrl= " + mIsInPrl + ", mRoamingIndicator = " + mRoamingIndicator
|
+ ", mIsInPrl = " + mIsInPrl + ", mRoamingIndicator = " + mRoamingIndicator
|
||||||
+ ", mDefaultRoamingIndicator= " + mDefaultRoamingIndicator);
|
+ ", mDefaultRoamingIndicator= " + mDefaultRoamingIndicator);
|
||||||
}
|
}
|
||||||
pollStateDone();
|
pollStateDone();
|
||||||
@@ -882,20 +855,12 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
&& newSS.getState() != ServiceState.STATE_IN_SERVICE;
|
&& newSS.getState() != ServiceState.STATE_IN_SERVICE;
|
||||||
|
|
||||||
boolean hasCdmaDataConnectionAttached =
|
boolean hasCdmaDataConnectionAttached =
|
||||||
(this.cdmaDataConnectionState != ServiceState.RADIO_TECHNOLOGY_1xRTT
|
this.cdmaDataConnectionState != ServiceState.STATE_IN_SERVICE
|
||||||
&& this.cdmaDataConnectionState != ServiceState.RADIO_TECHNOLOGY_EVDO_0
|
&& this.newCdmaDataConnectionState == ServiceState.STATE_IN_SERVICE;
|
||||||
&& 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);
|
|
||||||
|
|
||||||
boolean hasCdmaDataConnectionDetached =
|
boolean hasCdmaDataConnectionDetached =
|
||||||
(this.cdmaDataConnectionState == ServiceState.RADIO_TECHNOLOGY_1xRTT
|
this.cdmaDataConnectionState == ServiceState.STATE_IN_SERVICE
|
||||||
|| this.cdmaDataConnectionState == ServiceState.RADIO_TECHNOLOGY_EVDO_0
|
&& this.newCdmaDataConnectionState != ServiceState.STATE_IN_SERVICE;
|
||||||
|| 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);
|
|
||||||
|
|
||||||
boolean hasCdmaDataConnectionChanged =
|
boolean hasCdmaDataConnectionChanged =
|
||||||
cdmaDataConnectionState != newCdmaDataConnectionState;
|
cdmaDataConnectionState != newCdmaDataConnectionState;
|
||||||
@@ -938,18 +903,16 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (hasChanged) {
|
if (hasChanged) {
|
||||||
if (phone.mCM.getRadioState().isNVReady()) {
|
if (cm.getRadioState().isNVReady()) {
|
||||||
String eriText;
|
String eriText;
|
||||||
// Now the CDMAPhone sees the new ServiceState so it can get the new ERI text
|
// Now the CDMAPhone sees the new ServiceState so it can get the new ERI text
|
||||||
if (ss.getState() == ServiceState.STATE_IN_SERVICE) {
|
if (ss.getState() == ServiceState.STATE_IN_SERVICE) {
|
||||||
eriText = phone.getCdmaEriText();
|
eriText = phone.getCdmaEriText();
|
||||||
} else {
|
} else {
|
||||||
// Note that this is valid only for mRegistrationState 2,3,4, not 0!
|
// Note that ServiceState.STATE_OUT_OF_SERVICE is valid used for
|
||||||
/**
|
// mRegistrationState 0,2,3 and 4
|
||||||
* TODO(Teleca): From the comment this apparently isn't always true
|
eriText = phone.getContext().getText(
|
||||||
* should there be additional logic with other strings?
|
com.android.internal.R.string.roamingTextSearching).toString();
|
||||||
*/
|
|
||||||
eriText = EriInfo.SEARCHING_TEXT;
|
|
||||||
}
|
}
|
||||||
ss.setCdmaEriText(eriText);
|
ss.setCdmaEriText(eriText);
|
||||||
}
|
}
|
||||||
@@ -1047,6 +1010,12 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
return guess;
|
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
|
private void
|
||||||
queueNextSignalStrengthPoll() {
|
queueNextSignalStrengthPoll() {
|
||||||
if (dontPollSignalStrength || (cm.getRadioState().isGsm())) {
|
if (dontPollSignalStrength || (cm.getRadioState().isGsm())) {
|
||||||
@@ -1060,7 +1029,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
msg = obtainMessage();
|
msg = obtainMessage();
|
||||||
msg.what = EVENT_POLL_SIGNAL_STRENGTH;
|
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);
|
sendMessageDelayed(msg, POLL_PERIOD_MILLIS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1108,8 +1077,8 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private int radioTechnologyToServiceState(int code) {
|
private int radioTechnologyToDataServiceState(int code) {
|
||||||
int retVal = ServiceState.RADIO_TECHNOLOGY_UNKNOWN;
|
int retVal = ServiceState.STATE_OUT_OF_SERVICE;
|
||||||
switch(code) {
|
switch(code) {
|
||||||
case 0:
|
case 0:
|
||||||
case 1:
|
case 1:
|
||||||
@@ -1118,14 +1087,10 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
case 4:
|
case 4:
|
||||||
case 5:
|
case 5:
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6: // RADIO_TECHNOLOGY_1xRTT
|
||||||
retVal = ServiceState.RADIO_TECHNOLOGY_1xRTT;
|
case 7: // RADIO_TECHNOLOGY_EVDO_0
|
||||||
break;
|
case 8: // RADIO_TECHNOLOGY_EVDO_A
|
||||||
case 7:
|
retVal = ServiceState.STATE_IN_SERVICE;
|
||||||
retVal = ServiceState.RADIO_TECHNOLOGY_EVDO_0;
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
retVal = ServiceState.RADIO_TECHNOLOGY_EVDO_A;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Log.e(LOG_TAG, "Wrong radioTechnology code.");
|
Log.e(LOG_TAG, "Wrong radioTechnology code.");
|
||||||
@@ -1435,4 +1400,12 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
Log.d(LOG_TAG, "[CdmaServiceStateTracker] " + s);
|
Log.d(LOG_TAG, "[CdmaServiceStateTracker] " + s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMdnNumber() {
|
||||||
|
return mMdn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCdmaMin() {
|
||||||
|
return mMin;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,28 +23,6 @@ public final class EriInfo {
|
|||||||
public static final int ROAMING_ICON_MODE_NORMAL = 0;
|
public static final int ROAMING_ICON_MODE_NORMAL = 0;
|
||||||
public static final int ROAMING_ICON_MODE_FLASH = 1;
|
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 mRoamingIndicator;
|
||||||
public int mIconIndex;
|
public int mIconIndex;
|
||||||
public int mIconMode;
|
public int mIconMode;
|
||||||
|
|||||||
@@ -28,17 +28,12 @@ import com.android.internal.util.XmlUtils;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO(Teleca): Please as some comments on how this class is to
|
* EriManager loads the ERI file definitions and manages the CDMA roaming information.
|
||||||
* 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.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
public final class EriManager {
|
public final class EriManager {
|
||||||
|
|
||||||
class EriFile {
|
class EriFile {
|
||||||
public static final int MAX_ERI_ENTRIES = 30;
|
|
||||||
|
|
||||||
public int mVersionNumber; // File version number
|
public int mVersionNumber; // File version number
|
||||||
public int mNumberOfEriEntries; // Number of entries
|
public int mNumberOfEriEntries; // Number of entries
|
||||||
@@ -55,7 +50,30 @@ public final class EriManager {
|
|||||||
this.mCallPromptId = new String[] { "", "", "" };
|
this.mCallPromptId = new String[] { "", "", "" };
|
||||||
this.mRoamIndTable = new HashMap<Integer, EriInfo>();
|
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";
|
static final String LOG_TAG = "CDMA";
|
||||||
@@ -67,7 +85,7 @@ public final class EriManager {
|
|||||||
private PhoneBase mPhone;
|
private PhoneBase mPhone;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private int mEriFileSource = ERI_FROM_XML;
|
private int mEriFileSource = ERI_FROM_XML;
|
||||||
private boolean isEriFileLoaded = false;
|
private boolean isEriFileLoaded;
|
||||||
private EriFile mEriFile;
|
private EriFile mEriFile;
|
||||||
|
|
||||||
public EriManager(PhoneBase phone, Context context, int eriFileSource) {
|
public EriManager(PhoneBase phone, Context context, int eriFileSource) {
|
||||||
@@ -214,11 +232,205 @@ public final class EriManager {
|
|||||||
* Returns the EriInfo record associated with roamingIndicator
|
* Returns the EriInfo record associated with roamingIndicator
|
||||||
* or null if the entry is not found
|
* or null if the entry is not found
|
||||||
*/
|
*/
|
||||||
public EriInfo getEriInfo(int roamingIndicator) {
|
private EriInfo getEriInfo(int roamingIndicator) {
|
||||||
if (mEriFile.mRoamIndTable.containsKey(roamingIndicator)) {
|
if (mEriFile.mRoamIndTable.containsKey(roamingIndicator)) {
|
||||||
return mEriFile.mRoamIndTable.get(roamingIndicator);
|
return mEriFile.mRoamIndTable.get(roamingIndicator);
|
||||||
} else {
|
} else {
|
||||||
return null;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,11 +55,8 @@ public final class RuimRecords extends IccRecords {
|
|||||||
|
|
||||||
//***** Instance Variables
|
//***** Instance Variables
|
||||||
|
|
||||||
private String mImsi; // TODO(Teleca): to be checked, if this should be removed!
|
String spn;
|
||||||
private String mMyMobileNumber;
|
int spnDisplayCondition;
|
||||||
private String mSid; // TODO(Teleca): Unused should this be removed
|
|
||||||
private String mNid; // TODO(Teleca): Unused should this be removed
|
|
||||||
private String mMin2Min1;
|
|
||||||
|
|
||||||
//***** Event Constants
|
//***** Event Constants
|
||||||
|
|
||||||
@@ -134,19 +131,6 @@ public final class RuimRecords extends IccRecords {
|
|||||||
recordsRequested = false;
|
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
|
@Override
|
||||||
public void setVoiceMailNumber(String alphaTag, String voiceNumber, Message onComplete){
|
public void setVoiceMailNumber(String alphaTag, String voiceNumber, Message onComplete){
|
||||||
// In CDMA this is Operator/OEM dependent
|
// 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
|
@Override
|
||||||
public void handleMessage(Message msg) {
|
public void handleMessage(Message msg) {
|
||||||
AsyncResult ar;
|
AsyncResult ar;
|
||||||
@@ -223,28 +181,35 @@ public final class RuimRecords extends IccRecords {
|
|||||||
/* IO events */
|
/* IO events */
|
||||||
|
|
||||||
case EVENT_GET_CDMA_SUBSCRIPTION_DONE:
|
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;
|
ar = (AsyncResult)msg.obj;
|
||||||
String localTemp[] = (String[])ar.result;
|
String localTemp[] = (String[])ar.result;
|
||||||
if (ar.exception != null) {
|
if (ar.exception != null) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(m_ota_commited) {
|
if(m_ota_commited) {
|
||||||
if(mMyMobileNumber != localTemp[0]) {
|
//if(mMyMobileNumber != localTemp[0]) {
|
||||||
Intent intent = new Intent(TelephonyIntents.ACTION_CDMA_OTA_MDN_CHANGED);
|
Intent intent = new Intent(TelephonyIntents.ACTION_CDMA_OTA_MDN_CHANGED);
|
||||||
intent.putExtra("mdn", localTemp[0]);
|
intent.putExtra("mdn", localTemp[0]);
|
||||||
Log.d(LOG_TAG,"Broadcasting intent MDN Change in OTA ");
|
Log.d(LOG_TAG,"Broadcasting intent MDN Change in OTA ");
|
||||||
ActivityManagerNative.broadcastStickyIntent(intent, null);
|
ActivityManagerNative.broadcastStickyIntent(intent, null);
|
||||||
}
|
//}
|
||||||
m_ota_commited=false;
|
m_ota_commited=false;
|
||||||
}
|
}
|
||||||
mMyMobileNumber = localTemp[0];
|
//mMyMobileNumber = localTemp[0];
|
||||||
mSid = localTemp[1];
|
//mSid = localTemp[1];
|
||||||
mNid = localTemp[2];
|
//mNid = localTemp[2];
|
||||||
if (localTemp.length >= 3) { // TODO(Moto): remove when new ril always returns min2_min1
|
//if (localTemp.length >= 3) { // TODO(Moto): remove when new ril always returns min2_min1
|
||||||
mMin2Min1 = localTemp[3];
|
// mMin2Min1 = localTemp[3];
|
||||||
}
|
//}
|
||||||
|
|
||||||
Log.d(LOG_TAG, "MDN: " + mMyMobileNumber + " MIN: " + mMin2Min1);
|
//Log.d(LOG_TAG, "MDN: " + mMyMobileNumber + " MIN: " + mMin2Min1);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -350,14 +315,14 @@ public final class RuimRecords extends IccRecords {
|
|||||||
RuimCard.INTENT_VALUE_ICC_READY, null);
|
RuimCard.INTENT_VALUE_ICC_READY, null);
|
||||||
|
|
||||||
fetchRuimRecords();
|
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() {
|
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() {
|
private void fetchRuimRecords() {
|
||||||
|
|||||||
@@ -151,7 +151,6 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
|
|
||||||
private static final int POLL_PDP_MILLIS = 5 * 1000;
|
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 = "com.android.internal.telephony.gprs-reconnect";
|
||||||
private static final String INTENT_RECONNECT_ALARM_EXTRA_REASON = "reason";
|
private static final String INTENT_RECONNECT_ALARM_EXTRA_REASON = "reason";
|
||||||
|
|
||||||
|
|||||||
@@ -75,13 +75,6 @@ import java.util.TimeZone;
|
|||||||
*/
|
*/
|
||||||
final class GsmServiceStateTracker extends ServiceStateTracker {
|
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
|
//***** Instance Variables
|
||||||
GSMPhone phone;
|
GSMPhone phone;
|
||||||
GsmCellLocation cellLoc;
|
GsmCellLocation cellLoc;
|
||||||
|
|||||||
@@ -184,9 +184,6 @@ public class StkService extends Handler implements AppInterface {
|
|||||||
mCmdIf.unSetOnStkCallSetUp(this);
|
mCmdIf.unSetOnStkCallSetUp(this);
|
||||||
|
|
||||||
this.removeCallbacksAndMessages(null);
|
this.removeCallbacksAndMessages(null);
|
||||||
|
|
||||||
//removing instance
|
|
||||||
sInstance = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void finalize() {
|
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 ci CommandsInterface object
|
||||||
* @param sr SIMRecords object
|
* @param sr SIMRecords object
|
||||||
|
|||||||
Reference in New Issue
Block a user