diff options
author | Julian Odell <juliano@google.com> | 2014-09-03 20:20:33 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-09-03 20:20:34 +0000 |
commit | 6c25708eb5b1980445213b7b30cc9d6dad16b7f1 (patch) | |
tree | 6c666f52e3519aa0783de717a0844b14beb09836 | |
parent | 4d12a0377128f18b2b971f4cf2d14de4e01a129e (diff) | |
parent | 31ef14d4f00b90e13a9755ecfa6cbe8aa7466da7 (diff) | |
download | frameworks_base-6c25708eb5b1980445213b7b30cc9d6dad16b7f1.zip frameworks_base-6c25708eb5b1980445213b7b30cc9d6dad16b7f1.tar.gz frameworks_base-6c25708eb5b1980445213b7b30cc9d6dad16b7f1.tar.bz2 |
Merge "Bug 17262099: MMS API changes (multi-project)." into lmp-dev
-rw-r--r-- | api/current.txt | 9 | ||||
-rw-r--r-- | services/core/java/com/android/server/MmsServiceBroker.java | 29 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/IMms.aidl | 19 |
3 files changed, 32 insertions, 25 deletions
diff --git a/api/current.txt b/api/current.txt index ce93382..15230c3 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28855,23 +28855,23 @@ package android.telephony { } public final class SmsManager { - method public android.net.Uri addMultimediaMessageDraft(byte[]); + method public android.net.Uri addMultimediaMessageDraft(android.net.Uri); method public android.net.Uri addTextMessageDraft(java.lang.String, java.lang.String); method public boolean archiveStoredConversation(long, boolean); method public boolean deleteStoredConversation(long); method public boolean deleteStoredMessage(android.net.Uri); method public java.util.ArrayList<java.lang.String> divideMessage(java.lang.String); - method public void downloadMultimediaMessage(java.lang.String, android.content.ContentValues, android.app.PendingIntent); + method public void downloadMultimediaMessage(java.lang.String, android.net.Uri, android.content.ContentValues, android.app.PendingIntent); method public boolean getAutoPersisting(); method public android.os.Bundle getCarrierConfigValues(); method public static android.telephony.SmsManager getDefault(); method public static android.telephony.SmsManager getSmsManagerUsingSubId(long); method public long getSubId(); - method public android.net.Uri importMultimediaMessage(byte[], java.lang.String, long, boolean, boolean); + method public android.net.Uri importMultimediaMessage(android.net.Uri, java.lang.String, long, boolean, boolean); method public android.net.Uri importTextMessage(java.lang.String, int, java.lang.String, long, boolean, boolean); method public void injectSmsPdu(byte[], java.lang.String, android.app.PendingIntent); method public void sendDataMessage(java.lang.String, java.lang.String, short, byte[], android.app.PendingIntent, android.app.PendingIntent); - method public void sendMultimediaMessage(byte[], java.lang.String, android.content.ContentValues, android.app.PendingIntent); + method public void sendMultimediaMessage(android.net.Uri, java.lang.String, android.content.ContentValues, android.app.PendingIntent); method public void sendMultipartTextMessage(java.lang.String, java.lang.String, java.util.ArrayList<java.lang.String>, java.util.ArrayList<android.app.PendingIntent>, java.util.ArrayList<android.app.PendingIntent>); method public void sendStoredMultimediaMessage(android.net.Uri, android.content.ContentValues, android.app.PendingIntent); method public void sendStoredMultipartTextMessage(android.net.Uri, java.lang.String, java.util.ArrayList<android.app.PendingIntent>, java.util.ArrayList<android.app.PendingIntent>); @@ -28914,6 +28914,7 @@ package android.telephony { field public static final java.lang.String MMS_CONFIG_USER_AGENT = "userAgent"; field public static final int MMS_ERROR_HTTP_FAILURE = 4; // 0x4 field public static final int MMS_ERROR_INVALID_APN = 2; // 0x2 + field public static final int MMS_ERROR_IO_ERROR = 5; // 0x5 field public static final int MMS_ERROR_UNABLE_CONNECT_MMS = 3; // 0x3 field public static final int MMS_ERROR_UNSPECIFIED = 1; // 0x1 field public static final java.lang.String MMS_EXTRA_DATA = "data"; diff --git a/services/core/java/com/android/server/MmsServiceBroker.java b/services/core/java/com/android/server/MmsServiceBroker.java index 2830b5e..65ad1ce 100644 --- a/services/core/java/com/android/server/MmsServiceBroker.java +++ b/services/core/java/com/android/server/MmsServiceBroker.java @@ -192,29 +192,30 @@ public class MmsServiceBroker extends SystemService { // Service API calls implementation, proxied to the real MmsService in "com.android.mms.service" private final class BinderService extends IMms.Stub { @Override - public void sendMessage(long subId, String callingPkg, byte[] pdu, String locationUrl, - ContentValues configOverrides, PendingIntent sentIntent) throws RemoteException { + public void sendMessage(long subId, String callingPkg, Uri contentUri, + String locationUrl, ContentValues configOverrides, PendingIntent sentIntent) + throws RemoteException { mContext.enforceCallingPermission(Manifest.permission.SEND_SMS, "Send MMS message"); if (getAppOpsManager().noteOp(AppOpsManager.OP_SEND_SMS, Binder.getCallingUid(), callingPkg) != AppOpsManager.MODE_ALLOWED) { return; } - getServiceGuarded().sendMessage(subId, callingPkg, pdu, locationUrl, configOverrides, - sentIntent); + getServiceGuarded().sendMessage(subId, callingPkg, contentUri, locationUrl, + configOverrides, sentIntent); } @Override public void downloadMessage(long subId, String callingPkg, String locationUrl, - ContentValues configOverrides, PendingIntent downloadedIntent) - throws RemoteException { + Uri contentUri, ContentValues configOverrides, + PendingIntent downloadedIntent) throws RemoteException { mContext.enforceCallingPermission(Manifest.permission.RECEIVE_MMS, "Download MMS message"); if (getAppOpsManager().noteOp(AppOpsManager.OP_RECEIVE_MMS, Binder.getCallingUid(), callingPkg) != AppOpsManager.MODE_ALLOWED) { return; } - getServiceGuarded().downloadMessage(subId, callingPkg, locationUrl, configOverrides, - downloadedIntent); + getServiceGuarded().downloadMessage(subId, callingPkg, locationUrl, contentUri, + configOverrides, downloadedIntent); } @Override @@ -249,8 +250,9 @@ public class MmsServiceBroker extends SystemService { } @Override - public Uri importMultimediaMessage(String callingPkg, byte[] pdu, String messageId, - long timestampSecs, boolean seen, boolean read) throws RemoteException { + public Uri importMultimediaMessage(String callingPkg, Uri contentUri, + String messageId, long timestampSecs, boolean seen, boolean read) + throws RemoteException { mContext.enforceCallingPermission(Manifest.permission.WRITE_SMS, "Import MMS message"); if (getAppOpsManager().noteOp(AppOpsManager.OP_WRITE_SMS, Binder.getCallingUid(), callingPkg) != AppOpsManager.MODE_ALLOWED) { @@ -259,7 +261,7 @@ public class MmsServiceBroker extends SystemService { return FAKE_MMS_SENT_URI; } return getServiceGuarded().importMultimediaMessage( - callingPkg, pdu, messageId, timestampSecs, seen, read); + callingPkg, contentUri, messageId, timestampSecs, seen, read); } @Override @@ -317,7 +319,8 @@ public class MmsServiceBroker extends SystemService { } @Override - public Uri addMultimediaMessageDraft(String callingPkg, byte[] pdu) throws RemoteException { + public Uri addMultimediaMessageDraft(String callingPkg, Uri contentUri) + throws RemoteException { mContext.enforceCallingPermission(Manifest.permission.WRITE_SMS, "Add MMS draft"); if (getAppOpsManager().noteOp(AppOpsManager.OP_WRITE_SMS, Binder.getCallingUid(), callingPkg) != AppOpsManager.MODE_ALLOWED) { @@ -325,7 +328,7 @@ public class MmsServiceBroker extends SystemService { // while writing the TelephonyProvider return FAKE_MMS_DRAFT_URI; } - return getServiceGuarded().addMultimediaMessageDraft(callingPkg, pdu); + return getServiceGuarded().addMultimediaMessageDraft(callingPkg, contentUri); } @Override diff --git a/telephony/java/com/android/internal/telephony/IMms.aidl b/telephony/java/com/android/internal/telephony/IMms.aidl index 2aeb42f..63b7a53 100644 --- a/telephony/java/com/android/internal/telephony/IMms.aidl +++ b/telephony/java/com/android/internal/telephony/IMms.aidl @@ -30,7 +30,8 @@ interface IMms { * * @param subId the SIM id * @param callingPkg the package name of the calling app - * @param pdu the MMS message encoded in standard MMS PDU format + * @param contentUri the content uri from which to read MMS message encoded in standard MMS + * PDU format * @param locationUrl the optional location url for where this message should be sent to * @param configOverrides the carrier-specific messaging configuration values to override for * sending the message. See {@link android.telephony.MessagingConfigurationManager} for the @@ -38,8 +39,8 @@ interface IMms { * @param sentIntent if not NULL this <code>PendingIntent</code> is * broadcast when the message is successfully sent, or failed */ - void sendMessage(long subId, String callingPkg, in byte[] pdu, String locationUrl, - in ContentValues configOverrides, in PendingIntent sentIntent); + void sendMessage(long subId, String callingPkg, in Uri contentUri, + String locationUrl, in ContentValues configOverrides, in PendingIntent sentIntent); /** * Download an MMS message using known location and transaction id @@ -48,6 +49,7 @@ interface IMms { * @param callingPkg the package name of the calling app * @param locationUrl the location URL of the MMS message to be downloaded, usually obtained * from the MMS WAP push notification + * @param contentUri a contentUri to which the downloaded MMS message will be written * @param configOverrides the carrier-specific messaging configuration values to override for * downloading the message. See {@link android.telephony.MessagingConfigurationManager} for the * value names and types. @@ -55,7 +57,8 @@ interface IMms { * broadcast when the message is downloaded, or the download is failed */ void downloadMessage(long subId, String callingPkg, String locationUrl, - in ContentValues configOverrides, in PendingIntent downloadedIntent); + in Uri contentUri, in ContentValues configOverrides, + in PendingIntent downloadedIntent); /** * Update the status of a pending (send-by-IP) MMS message handled by the carrier app. @@ -104,14 +107,14 @@ interface IMms { * Import a multimedia message into system's MMS store * * @param callingPkg the package name of the calling app - * @param pdu the PDU of the message to import + * @param contentUri the content uri from which to read PDU of the message to import * @param messageId the optional message id * @param timestampSecs the message timestamp in seconds * @param seen if the message is seen * @param read if the message is read * @return the message URI, null if failed */ - Uri importMultimediaMessage(String callingPkg, in byte[] pdu, String messageId, + Uri importMultimediaMessage(String callingPkg, in Uri contentUri, String messageId, long timestampSecs, boolean seen, boolean read); /** @@ -168,10 +171,10 @@ interface IMms { * Add a multimedia message draft to system MMS store * * @param callingPkg the package name of the calling app - * @param pdu the PDU data of the draft MMS + * @param contentUri the content Uri from which to read PDU data of the draft MMS * @return the URI of the stored draft message */ - Uri addMultimediaMessageDraft(String callingPkg, in byte[] pdu); + Uri addMultimediaMessageDraft(String callingPkg, in Uri contentUri); /** * Send a system stored MMS message |