Ejemplo n.º 1
0
 /**
  * Send AcknowledgeInd (response to mms manual download). Ignore failures.
  *
  * @param context Context
  * @param subId The SIM's subId we are currently using
  * @param transactionId The transaction id of the MMS message
  * @param contentLocation The url of the MMS message
  * @throws MmsFailureException
  * @throws InvalidHeaderValueException
  */
 public static void sendAcknowledgeForMmsDownload(
     final Context context,
     final int subId,
     final byte[] transactionId,
     final String contentLocation)
     throws MmsFailureException, InvalidHeaderValueException {
   final String selfNumber = PhoneUtils.get(subId).getCanonicalForSelf(true /*allowOverride*/);
   // Create the M-Acknowledge.ind
   final AcknowledgeInd acknowledgeInd =
       new AcknowledgeInd(PduHeaders.CURRENT_MMS_VERSION, transactionId);
   acknowledgeInd.setFrom(new EncodedStringValue(selfNumber));
   final Uri messageUri = Uri.parse(contentLocation);
   // Sending
   sendMms(
       context,
       subId,
       messageUri,
       MmsConfig.get(subId).getNotifyWapMMSC() ? contentLocation : null,
       acknowledgeInd,
       false /*responseImportant*/,
       null /* sentIntentExtras */);
 }