Loading telephony/java/android/telephony/TelephonyManager.java +16 −0 Original line number Diff line number Diff line Loading @@ -954,4 +954,20 @@ public class TelephonyManager { return mContext.getResources().getBoolean( com.android.internal.R.bool.config_voice_capable); } /** * @return true if the current device supports sms service. * <p> * If true, this means that the device supports both sending and * receiving sms via the telephony network. * <p> * Note: Voicemail waiting sms, cell broadcasting sms, and MMS are * disabled when device doesn't support sms. * * @hide pending API review */ public boolean isSmsCapable() { return mContext.getResources().getBoolean( com.android.internal.R.bool.config_sms_capable); } } telephony/java/com/android/internal/telephony/SMSDispatcher.java +22 −2 Original line number Diff line number Diff line Loading @@ -156,6 +156,9 @@ public abstract class SMSDispatcher extends Handler { protected boolean mStorageAvailable = true; protected boolean mReportMemoryStatusPending = false; /* Flag indicating whether the current device allows sms service */ protected boolean mSmsCapable = true; protected static int getNextConcatenatedRef() { sConcatenatedRef += 1; return sConcatenatedRef; Loading Loading @@ -249,6 +252,9 @@ public abstract class SMSDispatcher extends Handler { filter.addAction(Intent.ACTION_DEVICE_STORAGE_FULL); filter.addAction(Intent.ACTION_DEVICE_STORAGE_NOT_FULL); mContext.registerReceiver(mResultReceiver, filter); mSmsCapable = mContext.getResources().getBoolean( com.android.internal.R.bool.config_sms_capable); } public void dispose() { Loading Loading @@ -682,6 +688,7 @@ public abstract class SMSDispatcher extends Handler { * <code>RESULT_ERROR_GENERIC_FAILURE</code><br> * <code>RESULT_ERROR_RADIO_OFF</code><br> * <code>RESULT_ERROR_NULL_PDU</code><br> * <code>RESULT_ERROR_NO_SERVICE</code><br>. * For <code>RESULT_ERROR_GENERIC_FAILURE</code> the sentIntent may include * the extra "errorCode" containing a radio technology specific value, * generally only useful for troubleshooting.<br> Loading Loading @@ -709,6 +716,7 @@ public abstract class SMSDispatcher extends Handler { * <code>RESULT_ERROR_GENERIC_FAILURE</code><br> * <code>RESULT_ERROR_RADIO_OFF</code><br> * <code>RESULT_ERROR_NULL_PDU</code><br> * <code>RESULT_ERROR_NO_SERVICE</code><br>. * For <code>RESULT_ERROR_GENERIC_FAILURE</code> the sentIntent may include * the extra "errorCode" containing a radio technology specific value, * generally only useful for troubleshooting.<br> Loading Loading @@ -737,7 +745,8 @@ public abstract class SMSDispatcher extends Handler { * or one of these errors: * <code>RESULT_ERROR_GENERIC_FAILURE</code> * <code>RESULT_ERROR_RADIO_OFF</code> * <code>RESULT_ERROR_NULL_PDU</code>. * <code>RESULT_ERROR_NULL_PDU</code> * <code>RESULT_ERROR_NO_SERVICE</code>. * The per-application based SMS control checks sentIntent. If sentIntent * is NULL the caller will be checked against all unknown applications, * which cause smaller number of SMS to be sent in checking period. Loading @@ -763,7 +772,8 @@ public abstract class SMSDispatcher extends Handler { * or one of these errors: * <code>RESULT_ERROR_GENERIC_FAILURE</code> * <code>RESULT_ERROR_RADIO_OFF</code> * <code>RESULT_ERROR_NULL_PDU</code>. * <code>RESULT_ERROR_NULL_PDU</code> * <code>RESULT_ERROR_NO_SERVICE</code>. * The per-application based SMS control checks sentIntent. If sentIntent * is NULL the caller will be checked against all unknown applications, * which cause smaller number of SMS to be sent in checking period. Loading @@ -773,6 +783,16 @@ public abstract class SMSDispatcher extends Handler { */ protected void sendRawPdu(byte[] smsc, byte[] pdu, PendingIntent sentIntent, PendingIntent deliveryIntent) { if (!mSmsCapable) { if (sentIntent != null) { try { sentIntent.send(RESULT_ERROR_NO_SERVICE); } catch (CanceledException ex) {} } Log.d(TAG, "Device does not support sms service."); return; } if (pdu == null) { if (sentIntent != null) { try { Loading telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java +7 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,13 @@ final class CdmaSMSDispatcher extends SMSDispatcher { return Activity.RESULT_OK; } if (!mSmsCapable) { // Device doesn't support SMS service, Log.d(TAG, "Received short message on device which doesn't support " + "SMS service. Ignored."); return Intents.RESULT_SMS_HANDLED; } // See if we have a network duplicate SMS. SmsMessage sms = (SmsMessage) smsb; mLastDispatchedSmsFingerprint = sms.getIncomingSmsFingerprint(); Loading telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java +7 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,13 @@ final class GsmSMSDispatcher extends SMSDispatcher { return Intents.RESULT_SMS_HANDLED; } if (!mSmsCapable) { // Device doesn't support SMS service, Log.d(TAG, "Received short message on device which doesn't support " + "SMS service. Ignored."); return Intents.RESULT_SMS_HANDLED; } // Special case the message waiting indicator messages if (sms.isMWISetMessage()) { mGsmPhone.updateMessageWaitingIndicator(true); Loading Loading
telephony/java/android/telephony/TelephonyManager.java +16 −0 Original line number Diff line number Diff line Loading @@ -954,4 +954,20 @@ public class TelephonyManager { return mContext.getResources().getBoolean( com.android.internal.R.bool.config_voice_capable); } /** * @return true if the current device supports sms service. * <p> * If true, this means that the device supports both sending and * receiving sms via the telephony network. * <p> * Note: Voicemail waiting sms, cell broadcasting sms, and MMS are * disabled when device doesn't support sms. * * @hide pending API review */ public boolean isSmsCapable() { return mContext.getResources().getBoolean( com.android.internal.R.bool.config_sms_capable); } }
telephony/java/com/android/internal/telephony/SMSDispatcher.java +22 −2 Original line number Diff line number Diff line Loading @@ -156,6 +156,9 @@ public abstract class SMSDispatcher extends Handler { protected boolean mStorageAvailable = true; protected boolean mReportMemoryStatusPending = false; /* Flag indicating whether the current device allows sms service */ protected boolean mSmsCapable = true; protected static int getNextConcatenatedRef() { sConcatenatedRef += 1; return sConcatenatedRef; Loading Loading @@ -249,6 +252,9 @@ public abstract class SMSDispatcher extends Handler { filter.addAction(Intent.ACTION_DEVICE_STORAGE_FULL); filter.addAction(Intent.ACTION_DEVICE_STORAGE_NOT_FULL); mContext.registerReceiver(mResultReceiver, filter); mSmsCapable = mContext.getResources().getBoolean( com.android.internal.R.bool.config_sms_capable); } public void dispose() { Loading Loading @@ -682,6 +688,7 @@ public abstract class SMSDispatcher extends Handler { * <code>RESULT_ERROR_GENERIC_FAILURE</code><br> * <code>RESULT_ERROR_RADIO_OFF</code><br> * <code>RESULT_ERROR_NULL_PDU</code><br> * <code>RESULT_ERROR_NO_SERVICE</code><br>. * For <code>RESULT_ERROR_GENERIC_FAILURE</code> the sentIntent may include * the extra "errorCode" containing a radio technology specific value, * generally only useful for troubleshooting.<br> Loading Loading @@ -709,6 +716,7 @@ public abstract class SMSDispatcher extends Handler { * <code>RESULT_ERROR_GENERIC_FAILURE</code><br> * <code>RESULT_ERROR_RADIO_OFF</code><br> * <code>RESULT_ERROR_NULL_PDU</code><br> * <code>RESULT_ERROR_NO_SERVICE</code><br>. * For <code>RESULT_ERROR_GENERIC_FAILURE</code> the sentIntent may include * the extra "errorCode" containing a radio technology specific value, * generally only useful for troubleshooting.<br> Loading Loading @@ -737,7 +745,8 @@ public abstract class SMSDispatcher extends Handler { * or one of these errors: * <code>RESULT_ERROR_GENERIC_FAILURE</code> * <code>RESULT_ERROR_RADIO_OFF</code> * <code>RESULT_ERROR_NULL_PDU</code>. * <code>RESULT_ERROR_NULL_PDU</code> * <code>RESULT_ERROR_NO_SERVICE</code>. * The per-application based SMS control checks sentIntent. If sentIntent * is NULL the caller will be checked against all unknown applications, * which cause smaller number of SMS to be sent in checking period. Loading @@ -763,7 +772,8 @@ public abstract class SMSDispatcher extends Handler { * or one of these errors: * <code>RESULT_ERROR_GENERIC_FAILURE</code> * <code>RESULT_ERROR_RADIO_OFF</code> * <code>RESULT_ERROR_NULL_PDU</code>. * <code>RESULT_ERROR_NULL_PDU</code> * <code>RESULT_ERROR_NO_SERVICE</code>. * The per-application based SMS control checks sentIntent. If sentIntent * is NULL the caller will be checked against all unknown applications, * which cause smaller number of SMS to be sent in checking period. Loading @@ -773,6 +783,16 @@ public abstract class SMSDispatcher extends Handler { */ protected void sendRawPdu(byte[] smsc, byte[] pdu, PendingIntent sentIntent, PendingIntent deliveryIntent) { if (!mSmsCapable) { if (sentIntent != null) { try { sentIntent.send(RESULT_ERROR_NO_SERVICE); } catch (CanceledException ex) {} } Log.d(TAG, "Device does not support sms service."); return; } if (pdu == null) { if (sentIntent != null) { try { Loading
telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java +7 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,13 @@ final class CdmaSMSDispatcher extends SMSDispatcher { return Activity.RESULT_OK; } if (!mSmsCapable) { // Device doesn't support SMS service, Log.d(TAG, "Received short message on device which doesn't support " + "SMS service. Ignored."); return Intents.RESULT_SMS_HANDLED; } // See if we have a network duplicate SMS. SmsMessage sms = (SmsMessage) smsb; mLastDispatchedSmsFingerprint = sms.getIncomingSmsFingerprint(); Loading
telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java +7 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,13 @@ final class GsmSMSDispatcher extends SMSDispatcher { return Intents.RESULT_SMS_HANDLED; } if (!mSmsCapable) { // Device doesn't support SMS service, Log.d(TAG, "Received short message on device which doesn't support " + "SMS service. Ignored."); return Intents.RESULT_SMS_HANDLED; } // Special case the message waiting indicator messages if (sms.isMWISetMessage()) { mGsmPhone.updateMessageWaitingIndicator(true); Loading