diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index f5ab29b871e9e..7eddda6ba40e4 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -167,6 +167,11 @@
{0}: Not forwarded
+
+
+ Feature code complete.
+
+ Connection problem or invalid feature code.
OK
diff --git a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
index ef2f548effd62..c139619771dfe 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
@@ -68,7 +68,6 @@ public class CDMAPhone extends PhoneBase {
RuimRecords mRuimRecords;
RuimCard mRuimCard;
MyHandler h;
- ArrayList mPendingMMIs = new ArrayList();
RuimPhoneBookInterfaceManager mRuimPhoneBookInterfaceManager;
RuimSmsInterfaceManager mRuimSmsInterfaceManager;
PhoneSubInfo mSubInfo;
@@ -245,41 +244,31 @@ public class CDMAPhone extends PhoneBase {
// Need to make sure dialString gets parsed properly
String newDialString = PhoneNumberUtils.stripSeparators(dialString);
- FeatureCode fc = FeatureCode.newFromDialString(newDialString, this);
- if (LOCAL_DEBUG) Log.d(LOG_TAG,
- "dialing w/ fc '" + fc + "'...");
- // check for feature code
- if (fc == null) {
- // check if call in progress
- if (!mCT.foregroundCall.isIdle()) {
+ if (!mCT.foregroundCall.isIdle()) {
+ FeatureCode fc = FeatureCode.newFromDialString(newDialString, this);
+ if (fc != null) {
+ //mMmiRegistrants.notifyRegistrants(new AsyncResult(null, fc, null));
+ fc.processCode();
+ } else {
FeatureCode digits = new FeatureCode(this);
// use dial number as poundString
digits.poundString = newDialString;
- mPendingMMIs.add(fc);
- mMmiRegistrants.notifyRegistrants(new AsyncResult(null, fc, null));
digits.processCode();
- return null;
- } else {
- return mCT.dial(newDialString);
}
- } else {
- mPendingMMIs.add(fc);
- mMmiRegistrants.notifyRegistrants(new AsyncResult(null, fc, null));
- fc.processCode();
-
- // FIXME should this return null or something else?
return null;
+ } else {
+ return mCT.dial(newDialString);
}
}
+
public int getSignalStrengthASU() {
return mSST.rssi == 99 ? -1 : mSST.rssi;
}
public boolean
getMessageWaitingIndicator() {
- Log.e(LOG_TAG, "method getMessageWaitingIndicator is NOT supported in CDMA!");
- return false;
+ return mRuimRecords.getVoiceMessageWaiting();
}
public List extends MmiCode>
@@ -709,22 +698,23 @@ public class CDMAPhone extends PhoneBase {
mRuimRecords.setVoiceMessageWaiting(1, mwi ? -1 : 0);
}
+ public void
+ notifyMessageWaitingIndicator() {
+ mNotifier.notifyMessageWaitingChanged(this);
+ }
/**
* Removes the given FC from the pending list and notifies
* registrants that it is complete.
* @param fc FC that is done
*/
- /*package*/ void onMMIDone(FeatureCode fc) {
+ /*package*/ void onFeatureCodeDone(FeatureCode fc) {
/* Only notify complete if it's on the pending list.
* Otherwise, it's already been handled (eg, previously canceled).
* The exception is cancellation of an incoming USSD-REQUEST, which is
* not on the list.
*/
- if (mPendingMMIs.remove(fc)) {
- mMmiCompleteRegistrants.notifyRegistrants(
- new AsyncResult(null, fc, null));
- }
+ mMmiCompleteRegistrants.notifyRegistrants(new AsyncResult(null, fc, null));
}
//***** Inner Classes
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
index 84febf3b54ea3..ed617efaa95a7 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
@@ -304,7 +304,8 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
return trySetupData(Phone.REASON_DATA_ENABLED);
} else if (!enable) {
setEnabled(EXTERNAL_NETWORK_DEFAULT_ID, false);
- return false;
+ cleanUpConnection(true, Phone.REASON_DATA_DISABLED);
+ return true;
} else // isEnabled && enable
return true;
diff --git a/telephony/java/com/android/internal/telephony/cdma/FeatureCode.java b/telephony/java/com/android/internal/telephony/cdma/FeatureCode.java
index 65b7336453589..c226b62eef439 100644
--- a/telephony/java/com/android/internal/telephony/cdma/FeatureCode.java
+++ b/telephony/java/com/android/internal/telephony/cdma/FeatureCode.java
@@ -257,12 +257,12 @@ public final class FeatureCode extends Handler implements MmiCode {
if (ar.exception != null) {
state = State.FAILED;
- message = context.getText(com.android.internal.R.string.mmiError);
+ message = context.getText(com.android.internal.R.string.fcError);
} else {
state = State.COMPLETE;
- message = context.getText(com.android.internal.R.string.mmiComplete);
+ message = context.getText(com.android.internal.R.string.fcComplete);
}
- phone.onMMIDone(this);
+ phone.onFeatureCodeDone(this);
break;
}
}
@@ -307,6 +307,6 @@ public final class FeatureCode extends Handler implements MmiCode {
}
message = sb;
- phone.onMMIDone(this);
+ phone.onFeatureCodeDone(this);
}
}
diff --git a/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java b/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java
index 7776f8b474b95..13408cfb7b9cf 100644
--- a/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java
+++ b/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java
@@ -334,12 +334,27 @@ public final class RuimRecords extends IccRecords {
@Override
public void setVoiceMessageWaiting(int line, int countWaiting) {
- Log.i(LOG_TAG, "RuimRecords: setVoiceMessageWaiting not supported.");
+ if (line != 1) {
+ // only profile 1 is supported
+ return;
+ }
+
+ // range check
+ if (countWaiting < 0) {
+ countWaiting = -1;
+ } else if (countWaiting > 0xff) {
+ // C.S0015-B v2, 4.5.12
+ // range: 0-99
+ countWaiting = 0xff;
+ }
+ countVoiceMessages = countWaiting;
+
+ ((CDMAPhone) phone).notifyMessageWaitingIndicator();
}
private void handleRuimRefresh(int[] result) {
if (result == null || result.length == 0) {
- if (DBG) log("handleRuimRefresh without input");
+ if (DBG) log("handleRuimRefresh without input");
return;
}