Merge change 9354

* changes:
  Handle SMS during CDMA emergency callback mode
This commit is contained in:
Android (Google) Code Review
2009-07-31 11:15:28 -07:00

View File

@@ -19,6 +19,7 @@ package com.android.internal.telephony.cdma;
import android.app.Activity;
import android.app.PendingIntent;
import android.app.PendingIntent.CanceledException;
import android.content.ContentValues;
import android.content.SharedPreferences;
import android.database.Cursor;
@@ -31,6 +32,7 @@ import android.provider.Telephony.Sms.Intents;
import android.preference.PreferenceManager;
import android.util.Config;
import android.util.Log;
import android.telephony.SmsManager;
import com.android.internal.telephony.TelephonyProperties;
import com.android.internal.telephony.CommandsInterface;
@@ -45,6 +47,7 @@ import com.android.internal.util.HexDump;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.lang.Boolean;
final class CdmaSMSDispatcher extends SMSDispatcher {
@@ -331,6 +334,24 @@ final class CdmaSMSDispatcher extends SMSDispatcher {
sentIntent, deliveryIntent);
}
protected void sendRawPdu(byte[] smsc, byte[] pdu, PendingIntent sentIntent,
PendingIntent deliveryIntent) {
String inEcm = SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE);
if (Boolean.parseBoolean(inEcm)) {
if (sentIntent != null) {
try {
sentIntent.send(SmsManager.RESULT_ERROR_NO_SERVICE);
} catch (CanceledException ex) {}
}
if (Config.LOGD) {
Log.d(TAG, "Block SMS in Emergency Callback mode");
}
return;
}
super.sendRawPdu(smsc, pdu, sentIntent, deliveryIntent);
}
/** {@inheritDoc} */
protected void sendSms(SmsTracker tracker) {
HashMap map = tracker.mData;