diff options
author | Wink Saville <> | 2009-04-06 15:20:45 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-04-06 15:20:45 -0700 |
commit | d6c5d527d3fa73dafc6e7cd36e4d6922b6d31845 (patch) | |
tree | e0533a8ca7ee518aef5ae49c22cf1dd6d04f2f4d /telephony/java/com | |
parent | 60a51818483dae32d18414a4f128ca057e267e8c (diff) | |
download | frameworks_base-d6c5d527d3fa73dafc6e7cd36e4d6922b6d31845.zip frameworks_base-d6c5d527d3fa73dafc6e7cd36e4d6922b6d31845.tar.gz frameworks_base-d6c5d527d3fa73dafc6e7cd36e4d6922b6d31845.tar.bz2 |
AI 144705: Teleca patch from 03/27/2009, fixes some CDMA issues.
Automated import of CL 144705
Diffstat (limited to 'telephony/java/com')
4 files changed, 39 insertions, 33 deletions
diff --git a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java index ef2f548..c139619 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 <FeatureCode> mPendingMMIs = new ArrayList<FeatureCode>(); 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 84febf3..ed617ef 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 65b7336..c226b62 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 7776f8b..13408cf 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; } |