Loading telephony/java/com/android/internal/telephony/SMSDispatcher.java +13 −3 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.os.Handler; import android.os.Message; import android.os.PowerManager; import android.os.StatFs; import android.os.SystemProperties; import android.provider.Telephony; import android.provider.Telephony.Sms.Intents; import android.provider.Settings; Loading Loading @@ -156,8 +157,10 @@ public abstract class SMSDispatcher extends Handler { protected boolean mStorageAvailable = true; protected boolean mReportMemoryStatusPending = false; /* Flag indicating whether the current device allows sms service */ /* Flags indicating whether the current device allows sms service */ protected boolean mSmsCapable = true; protected boolean mSmsReceiveDisabled; protected boolean mSmsSendDisabled; protected static int getNextConcatenatedRef() { sConcatenatedRef += 1; Loading Loading @@ -255,6 +258,13 @@ public abstract class SMSDispatcher extends Handler { mSmsCapable = mContext.getResources().getBoolean( com.android.internal.R.bool.config_sms_capable); mSmsReceiveDisabled = !SystemProperties.getBoolean( TelephonyProperties.PROPERTY_SMS_RECEIVE, mSmsCapable); mSmsSendDisabled = !SystemProperties.getBoolean( TelephonyProperties.PROPERTY_SMS_SEND, mSmsCapable); Log.d(TAG, "SMSDispatcher: ctor mSmsCapable=" + mSmsCapable + " mSmsReceiveDisabled=" + mSmsReceiveDisabled + " mSmsSendDisabled=" + mSmsSendDisabled); } public void dispose() { Loading Loading @@ -783,13 +793,13 @@ public abstract class SMSDispatcher extends Handler { */ protected void sendRawPdu(byte[] smsc, byte[] pdu, PendingIntent sentIntent, PendingIntent deliveryIntent) { if (!mSmsCapable) { if (mSmsSendDisabled) { if (sentIntent != null) { try { sentIntent.send(RESULT_ERROR_NO_SERVICE); } catch (CanceledException ex) {} } Log.d(TAG, "Device does not support sms service."); Log.d(TAG, "Device does not support sending sms."); return; } Loading telephony/java/com/android/internal/telephony/TelephonyProperties.java +12 −0 Original line number Diff line number Diff line Loading @@ -147,4 +147,16 @@ public interface TelephonyProperties * when there is a radio technology change. */ static final String PROPERTY_RESET_ON_RADIO_TECH_CHANGE = "persist.radio.reset_on_switch"; /** * Set to false to disable SMS receiving, default is * the value of config_sms_capable */ static final String PROPERTY_SMS_RECEIVE = "telephony.sms.receive"; /** * Set to false to disable SMS sending, default is * the value of config_sms_capable */ static final String PROPERTY_SMS_SEND = "telephony.sms.send"; } telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java +3 −3 Original line number Diff line number Diff line Loading @@ -107,10 +107,10 @@ final class CdmaSMSDispatcher extends SMSDispatcher { return Activity.RESULT_OK; } if (!mSmsCapable) { // Device doesn't support SMS service, if (mSmsReceiveDisabled) { // Device doesn't support receiving SMS, Log.d(TAG, "Received short message on device which doesn't support " + "SMS service. Ignored."); + "receiving SMS. Ignored."); return Intents.RESULT_SMS_HANDLED; } Loading telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java +1 −1 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ final class GsmSMSDispatcher extends SMSDispatcher { return Intents.RESULT_SMS_HANDLED; } if (!mSmsCapable) { if (mSmsReceiveDisabled) { // Device doesn't support SMS service, Log.d(TAG, "Received short message on device which doesn't support " + "SMS service. Ignored."); Loading Loading
telephony/java/com/android/internal/telephony/SMSDispatcher.java +13 −3 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.os.Handler; import android.os.Message; import android.os.PowerManager; import android.os.StatFs; import android.os.SystemProperties; import android.provider.Telephony; import android.provider.Telephony.Sms.Intents; import android.provider.Settings; Loading Loading @@ -156,8 +157,10 @@ public abstract class SMSDispatcher extends Handler { protected boolean mStorageAvailable = true; protected boolean mReportMemoryStatusPending = false; /* Flag indicating whether the current device allows sms service */ /* Flags indicating whether the current device allows sms service */ protected boolean mSmsCapable = true; protected boolean mSmsReceiveDisabled; protected boolean mSmsSendDisabled; protected static int getNextConcatenatedRef() { sConcatenatedRef += 1; Loading Loading @@ -255,6 +258,13 @@ public abstract class SMSDispatcher extends Handler { mSmsCapable = mContext.getResources().getBoolean( com.android.internal.R.bool.config_sms_capable); mSmsReceiveDisabled = !SystemProperties.getBoolean( TelephonyProperties.PROPERTY_SMS_RECEIVE, mSmsCapable); mSmsSendDisabled = !SystemProperties.getBoolean( TelephonyProperties.PROPERTY_SMS_SEND, mSmsCapable); Log.d(TAG, "SMSDispatcher: ctor mSmsCapable=" + mSmsCapable + " mSmsReceiveDisabled=" + mSmsReceiveDisabled + " mSmsSendDisabled=" + mSmsSendDisabled); } public void dispose() { Loading Loading @@ -783,13 +793,13 @@ public abstract class SMSDispatcher extends Handler { */ protected void sendRawPdu(byte[] smsc, byte[] pdu, PendingIntent sentIntent, PendingIntent deliveryIntent) { if (!mSmsCapable) { if (mSmsSendDisabled) { if (sentIntent != null) { try { sentIntent.send(RESULT_ERROR_NO_SERVICE); } catch (CanceledException ex) {} } Log.d(TAG, "Device does not support sms service."); Log.d(TAG, "Device does not support sending sms."); return; } Loading
telephony/java/com/android/internal/telephony/TelephonyProperties.java +12 −0 Original line number Diff line number Diff line Loading @@ -147,4 +147,16 @@ public interface TelephonyProperties * when there is a radio technology change. */ static final String PROPERTY_RESET_ON_RADIO_TECH_CHANGE = "persist.radio.reset_on_switch"; /** * Set to false to disable SMS receiving, default is * the value of config_sms_capable */ static final String PROPERTY_SMS_RECEIVE = "telephony.sms.receive"; /** * Set to false to disable SMS sending, default is * the value of config_sms_capable */ static final String PROPERTY_SMS_SEND = "telephony.sms.send"; }
telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java +3 −3 Original line number Diff line number Diff line Loading @@ -107,10 +107,10 @@ final class CdmaSMSDispatcher extends SMSDispatcher { return Activity.RESULT_OK; } if (!mSmsCapable) { // Device doesn't support SMS service, if (mSmsReceiveDisabled) { // Device doesn't support receiving SMS, Log.d(TAG, "Received short message on device which doesn't support " + "SMS service. Ignored."); + "receiving SMS. Ignored."); return Intents.RESULT_SMS_HANDLED; } Loading
telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java +1 −1 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ final class GsmSMSDispatcher extends SMSDispatcher { return Intents.RESULT_SMS_HANDLED; } if (!mSmsCapable) { if (mSmsReceiveDisabled) { // Device doesn't support SMS service, Log.d(TAG, "Received short message on device which doesn't support " + "SMS service. Ignored."); Loading