diff --git a/src/org/thoughtcrime/securesms/ConversationActivity.java b/src/org/thoughtcrime/securesms/ConversationActivity.java index 50eed0dda5..1f8f449c76 100644 --- a/src/org/thoughtcrime/securesms/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/ConversationActivity.java @@ -1668,7 +1668,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity } Permissions.with(this) - .request(Manifest.permission.SEND_SMS) + .request(Manifest.permission.SEND_SMS, Manifest.permission.READ_SMS) .ifNecessary(!isSecureText || forceSms) .withPermanentDenialDialog(getString(R.string.ConversationActivity_signal_needs_sms_permission_in_order_to_send_an_sms)) .onAllGranted(() -> { diff --git a/src/org/thoughtcrime/securesms/jobs/MmsSendJob.java b/src/org/thoughtcrime/securesms/jobs/MmsSendJob.java index 10b1153805..5a9dd03954 100644 --- a/src/org/thoughtcrime/securesms/jobs/MmsSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/MmsSendJob.java @@ -172,7 +172,7 @@ public class MmsSendJob extends SendJob { throws UndeliverableMessageException { SendReq req = new SendReq(); - String lineNumber = Utils.getMyPhoneNumber(context); + String lineNumber = getMyNumber(context); Address destination = message.getRecipient().getAddress(); MediaConstraints mediaConstraints = MediaConstraints.getMmsMediaConstraints(message.getSubscriptionId()); List scaledAttachments = scaleAttachments(masterSecret, mediaConstraints, message.getAttachments()); @@ -287,4 +287,12 @@ public class MmsSendJob extends SendJob { MessageNotifier.notifyMessageDeliveryFailed(context, recipient, threadId); } } + + private String getMyNumber(Context context) throws UndeliverableMessageException { + try { + return Utils.getMyPhoneNumber(context); + } catch (SecurityException e) { + throw new UndeliverableMessageException(e); + } + } }