Send and download MMS via content provider instead of PDU bytes.
Change-Id: Ib5a93d07799c9e14fea8be820c6bd4bc7ae8be3a
This commit is contained in:
@@ -1369,8 +1369,8 @@
|
|||||||
<provider android:name=".os.MmsFileProvider"
|
<provider android:name=".os.MmsFileProvider"
|
||||||
android:authorities="com.example.android.apis.os.MmsFileProvider"
|
android:authorities="com.example.android.apis.os.MmsFileProvider"
|
||||||
android:enabled="@bool/atLeastLRelease"
|
android:enabled="@bool/atLeastLRelease"
|
||||||
android:permission="android.permission.MODIFY_PHONE_STATE"
|
android:grantUriPermissions="true"
|
||||||
android:exported="true"/>
|
android:exported="false" />
|
||||||
|
|
||||||
<!-- ************************************* -->
|
<!-- ************************************* -->
|
||||||
<!-- ANDROID.ANIMATION PACKAGE SAMPLES -->
|
<!-- ANDROID.ANIMATION PACKAGE SAMPLES -->
|
||||||
|
|||||||
@@ -191,8 +191,9 @@ public class MmsMessagingDemo extends Activity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (contentUri != null) {
|
if (contentUri != null) {
|
||||||
SmsManager.getDefault().sendMultimediaMessage(contentUri,
|
SmsManager.getDefault().sendMultimediaMessage(getApplicationContext(),
|
||||||
null/*locationUrl*/, null/*configOverrides*/, pendingIntent);
|
contentUri, null/*locationUrl*/, null/*configOverrides*/,
|
||||||
|
pendingIntent);
|
||||||
} else {
|
} else {
|
||||||
Log.e(TAG, "Error writing sending Mms");
|
Log.e(TAG, "Error writing sending Mms");
|
||||||
try {
|
try {
|
||||||
@@ -225,8 +226,8 @@ public class MmsMessagingDemo extends Activity {
|
|||||||
.build();
|
.build();
|
||||||
final PendingIntent pendingIntent = PendingIntent.getBroadcast(
|
final PendingIntent pendingIntent = PendingIntent.getBroadcast(
|
||||||
MmsMessagingDemo.this, 0, new Intent(ACTION_MMS_RECEIVED), 0);
|
MmsMessagingDemo.this, 0, new Intent(ACTION_MMS_RECEIVED), 0);
|
||||||
SmsManager.getDefault().downloadMultimediaMessage(locationUrl, contentUri,
|
SmsManager.getDefault().downloadMultimediaMessage(getApplicationContext(),
|
||||||
null/*configOverrides*/, pendingIntent);
|
locationUrl, contentUri, null/*configOverrides*/, pendingIntent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user