Skip to content

Commit

Permalink
Use configOverrides from smsManager
Browse files Browse the repository at this point in the history
  • Loading branch information
moezbhatti committed Nov 13, 2019
1 parent b8836af commit 2d26a76
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,17 @@ public void downloadMultimediaMessage(final Context context, final String locati
final PendingIntent pendingIntent = PendingIntent.getBroadcast(
context, 0, download, PendingIntent.FLAG_CANCEL_CURRENT);

final SmsManager smsManager = SmsManagerFactory.INSTANCE.createSmsManager(subscriptionId);
Bundle configOverrides = new Bundle();
String httpParams = MmsConfig.getHttpParams();
if (!TextUtils.isEmpty(httpParams)) {
configOverrides.putString(SmsManager.MMS_CONFIG_HTTP_PARAMS, httpParams);
} else {
configOverrides = smsManager.getCarrierConfigValues();
}

grantUriPermission(context, contentUri);
SmsManagerFactory.INSTANCE.createSmsManager(subscriptionId).downloadMultimediaMessage(context,
location, contentUri, configOverrides, pendingIntent);
smsManager.downloadMultimediaMessage(context, location, contentUri, configOverrides, pendingIntent);
}

private void grantUriPermission(Context context, Uri contentUri) {
Expand Down

0 comments on commit 2d26a76

Please sign in to comment.