summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Cheng Yang <chengyang@motorola.com> 2009-07-11 00:04:57 +0800
committer Wink Saville <wink@google.com> 2009-07-13 14:00:07 -0700
commit117eace23924f575877ae8ecbb899af22e6f16c0 (patch)
tree5a57378bcc6fcf2e4112974e262898b0fdc38fbb
parent9ba6998b0bd2472d997787938b598d8f72853b01 (diff)
Block incoming SMS in CDMA Emergency Callback Mode
Block incoming SMS in CDMA Emergency Callback Mode CDMA carriers expect that incoming SMS is not processed by phone while it is in Emergency Callback Mode, so don't acknowlegde it to the network.
-rw-r--r--telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java b/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java
index ecdc8f643b0d..c4db6098fd07 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java
@@ -25,12 +25,14 @@ import android.database.Cursor;
import android.database.SQLException;
import android.os.AsyncResult;
import android.os.Message;
+import android.os.SystemProperties;
import android.provider.Telephony;
import android.provider.Telephony.Sms.Intents;
import android.preference.PreferenceManager;
import android.util.Config;
import android.util.Log;
+import com.android.internal.telephony.TelephonyProperties;
import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.SmsHeader;
import com.android.internal.telephony.SmsMessageBase;
@@ -75,6 +77,11 @@ final class CdmaSMSDispatcher extends SMSDispatcher {
return Intents.RESULT_SMS_GENERIC_ERROR;
}
+ String inEcm=SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE, "false");
+ if (inEcm.equals("true")) {
+ return Intents.RESULT_SMS_GENERIC_ERROR;
+ }
+
// Decode BD stream and set sms variables.
SmsMessage sms = (SmsMessage) smsb;
sms.parseSms();
@@ -343,6 +350,12 @@ final class CdmaSMSDispatcher extends SMSDispatcher {
/** {@inheritDoc} */
protected void acknowledgeLastIncomingSms(boolean success, int result, Message response){
// FIXME unit test leaves cm == null. this should change
+
+ String inEcm=SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE, "false");
+ if (inEcm.equals("true")) {
+ return;
+ }
+
if (mCm != null) {
mCm.acknowledgeLastIncomingCdmaSms(success, resultToCause(result), response);
}