Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b72eb97e authored by Cheuksan Wang's avatar Cheuksan Wang
Browse files

new SMS/MMS carrier app API

Changes based on api council review

BUG: 18005911
Change-Id: I23bd207ce70f7fa201d6d964c1700cfc44cb009b
parent 4cd3e47e
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -203,8 +203,8 @@ LOCAL_SRC_FILES += \
	core/java/android/os/IUpdateLock.aidl \
	core/java/android/os/IUserManager.aidl \
	core/java/android/os/IVibratorService.aidl \
	core/java/android/service/carriermessaging/ICarrierMessagingCallback.aidl \
	core/java/android/service/carriermessaging/ICarrierMessagingService.aidl \
	core/java/android/service/carrier/ICarrierMessagingCallback.aidl \
	core/java/android/service/carrier/ICarrierMessagingService.aidl \
	core/java/android/service/notification/INotificationListener.aidl \
	core/java/android/service/notification/IStatusBarNotificationHolder.aidl \
	core/java/android/service/notification/IConditionListener.aidl \
@@ -522,8 +522,7 @@ aidl_files := \
	frameworks/base/core/java/android/view/textservice/SpellCheckerInfo.aidl \
	frameworks/base/core/java/android/view/textservice/SentenceSuggestionsInfo.aidl \
	frameworks/base/core/java/android/view/textservice/SuggestionsInfo.aidl \
	frameworks/base/core/java/android/service/carriermessaging/MessagePdu.aidl \
	frameworks/base/core/java/android/service/carriermessaging/CarrierMessagingService.aidl \
	frameworks/base/core/java/android/service/carrier/MessagePdu.aidl \
	frameworks/base/core/java/android/service/notification/StatusBarNotification.aidl \
	frameworks/base/core/java/android/speech/tts/Voice.aidl \
	frameworks/base/core/java/android/app/usage/UsageEvents.aidl \
+22 −47
Original line number Diff line number Diff line
@@ -26911,71 +26911,46 @@ package android.security {
}
package android.service.carriermessaging {
package android.service.carrier {
  public abstract class CarrierMessagingService extends android.app.Service {
    ctor public CarrierMessagingService();
    method public android.os.IBinder onBind(android.content.Intent);
    method public int onDownloadMms(android.net.Uri, java.lang.String);
    method public boolean onFilterSms(android.service.carriermessaging.MessagePdu, java.lang.String, int);
    method public android.service.carriermessaging.CarrierMessagingService.SendSmsResponse onSendDataSms(byte[], java.lang.String, java.lang.String, int);
    method public android.service.carriermessaging.CarrierMessagingService.SendMmsResult onSendMms(android.net.Uri, java.lang.String);
    method public java.util.List<android.service.carriermessaging.CarrierMessagingService.SendSmsResponse> onSendMultipartTextSms(java.util.List<java.lang.String>, java.lang.String, java.lang.String);
    method public android.service.carriermessaging.CarrierMessagingService.SendSmsResponse onSendTextSms(java.lang.String, java.lang.String, java.lang.String);
    method public void onDownloadMms(android.net.Uri, int, android.net.Uri, android.service.carrier.CarrierMessagingService.ResultCallback<java.lang.Integer>);
    method public void onFilterSms(android.service.carrier.MessagePdu, java.lang.String, int, int, android.service.carrier.CarrierMessagingService.ResultCallback<java.lang.Boolean>);
    method public void onSendDataSms(byte[], int, java.lang.String, int, android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendSmsResult>);
    method public void onSendMms(android.net.Uri, int, android.net.Uri, android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendMmsResult>);
    method public void onSendMultipartTextSms(java.util.List<java.lang.String>, int, java.lang.String, android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendMultipartSmsResult>);
    method public void onSendTextSms(java.lang.String, int, java.lang.String, android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendSmsResult>);
    field public static final int DOWNLOAD_STATUS_ERROR = 2; // 0x2
    field public static final int DOWNLOAD_STATUS_OK = 0; // 0x0
    field public static final int DOWNLOAD_STATUS_RETRY_ON_CARRIER_NETWORK = 1; // 0x1
    field public static final int SEND_STATUS_ERROR = 2; // 0x2
    field public static final int SEND_STATUS_OK = 0; // 0x0
    field public static final int SEND_STATUS_RETRY_ON_CARRIER_NETWORK = 1; // 0x1
    field public static final java.lang.String SERVICE_INTERFACE = "android.service.carriermessaging.CarrierMessagingService";
    field public static final java.lang.String SERVICE_INTERFACE = "android.service.carrier.CarrierMessagingService";
  }
  public static abstract interface CarrierMessagingService.ResultCallback {
    method public abstract void onReceiveResult(T) throws android.os.RemoteException;
  }
  public static final class CarrierMessagingService.SendMmsResult {
    ctor public CarrierMessagingService.SendMmsResult(int, byte[]);
    method public int getResult();
    method public byte[] getSendConfPdu();
    method public int getSendStatus();
  }
  public static final class CarrierMessagingService.SendSmsResponse implements android.os.Parcelable {
    ctor public CarrierMessagingService.SendSmsResponse(int, byte[], int);
    method public int describeContents();
    method public byte[] getAckPdu();
    method public int getErrorCode();
    method public int getMessageRef();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.carriermessaging.CarrierMessagingService.SendSmsResponse> CREATOR;
  public static final class CarrierMessagingService.SendMultipartSmsResult {
    ctor public CarrierMessagingService.SendMultipartSmsResult(int, int[]);
    method public int[] getMessageRefs();
    method public int getSendStatus();
  }
  public abstract interface ICarrierMessagingCallback implements android.os.IInterface {
    method public abstract void onDownloadMmsComplete(int) throws android.os.RemoteException;
    method public abstract void onFilterComplete(boolean) throws android.os.RemoteException;
    method public abstract void onSendMmsComplete(int, byte[]) throws android.os.RemoteException;
    method public abstract void onSendMultipartSmsComplete(int, java.util.List<android.service.carriermessaging.CarrierMessagingService.SendSmsResponse>) throws android.os.RemoteException;
    method public abstract void onSendSmsComplete(int, android.service.carriermessaging.CarrierMessagingService.SendSmsResponse) throws android.os.RemoteException;
  }
  public static abstract class ICarrierMessagingCallback.Stub extends android.os.Binder implements android.service.carriermessaging.ICarrierMessagingCallback {
    ctor public ICarrierMessagingCallback.Stub();
    method public android.os.IBinder asBinder();
    method public static android.service.carriermessaging.ICarrierMessagingCallback asInterface(android.os.IBinder);
    method public boolean onTransact(int, android.os.Parcel, android.os.Parcel, int) throws android.os.RemoteException;
  }
  public abstract interface ICarrierMessagingService implements android.os.IInterface {
    method public abstract void downloadMms(android.net.Uri, java.lang.String, android.service.carriermessaging.ICarrierMessagingCallback) throws android.os.RemoteException;
    method public abstract void filterSms(android.service.carriermessaging.MessagePdu, java.lang.String, int, android.service.carriermessaging.ICarrierMessagingCallback) throws android.os.RemoteException;
    method public abstract void sendDataSms(byte[], java.lang.String, java.lang.String, int, android.service.carriermessaging.ICarrierMessagingCallback) throws android.os.RemoteException;
    method public abstract void sendMms(android.net.Uri, java.lang.String, android.service.carriermessaging.ICarrierMessagingCallback) throws android.os.RemoteException;
    method public abstract void sendMultipartTextSms(java.util.List<java.lang.String>, java.lang.String, java.lang.String, android.service.carriermessaging.ICarrierMessagingCallback) throws android.os.RemoteException;
    method public abstract void sendTextSms(java.lang.String, java.lang.String, java.lang.String, android.service.carriermessaging.ICarrierMessagingCallback) throws android.os.RemoteException;
  }
  public static abstract class ICarrierMessagingService.Stub extends android.os.Binder implements android.service.carriermessaging.ICarrierMessagingService {
    ctor public ICarrierMessagingService.Stub();
    method public android.os.IBinder asBinder();
    method public static android.service.carriermessaging.ICarrierMessagingService asInterface(android.os.IBinder);
    method public boolean onTransact(int, android.os.Parcel, android.os.Parcel, int) throws android.os.RemoteException;
  public static final class CarrierMessagingService.SendSmsResult {
    ctor public CarrierMessagingService.SendSmsResult(int, int);
    method public int getMessageRef();
    method public int getSendStatus();
  }
  public final class MessagePdu implements android.os.Parcelable {
@@ -26983,7 +26958,7 @@ package android.service.carriermessaging {
    method public int describeContents();
    method public java.util.List<byte[]> getPdus();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.carriermessaging.MessagePdu> CREATOR;
    field public static final android.os.Parcelable.Creator<android.service.carrier.MessagePdu> CREATOR;
  }
}
+417 −0

File changed and moved.

Preview size limit exceeded, changes collapsed.

+4 −7
Original line number Diff line number Diff line
@@ -14,20 +14,17 @@
 * limitations under the License.
 */

package android.service.carriermessaging;

import android.service.carriermessaging.CarrierMessagingService;
package android.service.carrier;

/**
 * Callback interface definition for the Carrier Messaging Service client to get informed of the
 * result of various API invocations.
 * @hide
 */
oneway interface ICarrierMessagingCallback {
    void onFilterComplete(boolean keepMessage);
    void onSendSmsComplete(
        int result, in CarrierMessagingService.SendSmsResponse sendSmsResponse);
    void onSendMultipartSmsComplete(
        int result, in List<CarrierMessagingService.SendSmsResponse> sendSmsResponses);
    void onSendSmsComplete(int result, int messageRef);
    void onSendMultipartSmsComplete(int result, in int[] messageRefs);
    void onSendMmsComplete(int result, in byte[] sendConfPdu);
    void onDownloadMmsComplete(int result);
}
+22 −15
Original line number Diff line number Diff line
@@ -14,15 +14,16 @@
 * limitations under the License.
 */

package android.service.carriermessaging;
package android.service.carrier;

import android.net.Uri;
import android.service.carriermessaging.ICarrierMessagingCallback;
import android.service.carriermessaging.MessagePdu;
import android.service.carrier.ICarrierMessagingCallback;
import android.service.carrier.MessagePdu;

/**
 * <p class="note"><strong>Note:</strong>
 * This service can only be implemented by a carrier privileged app.
 * @hide
 */
oneway interface ICarrierMessagingService {
    /**
@@ -32,10 +33,12 @@ oneway interface ICarrierMessagingService {
     * @param pdu the PDUs of the message
     * @param format the format of the PDUs, typically "3gpp" or "3gpp2"
     * @param destPort the destination port of a data SMS. It will be -1 for text SMS
     * @param subId SMS subscription ID of the SIM
     * @param callback the callback to notify upon completion
     */
    void filterSms(
        in MessagePdu pdu, String format, int destPort, in ICarrierMessagingCallback callback);
        in MessagePdu pdu, String format, int destPort, int subId,
        in ICarrierMessagingCallback callback);

    /**
     * Request sending a new text SMS from the device.
@@ -43,11 +46,11 @@ oneway interface ICarrierMessagingService {
     * status.
     *
     * @param text the text to send
     * @param format the format of the response PDU, typically "3gpp" or "3gpp2"
     * @param subId SMS subscription ID of the SIM
     * @param destAddress phone number of the recipient of the message
     * @param callback the callback to notify upon completion
     */
    void sendTextSms(String text, String format, String destAddress,
    void sendTextSms(String text, int subId, String destAddress,
            in ICarrierMessagingCallback callback);

    /**
@@ -56,12 +59,12 @@ oneway interface ICarrierMessagingService {
     * status.
     *
     * @param data the data to send
     * @param format the format of the response PDU, typically "3gpp" or "3gpp2"
     * @param subId SMS subscription ID of the SIM
     * @param destAddress phone number of the recipient of the message
     * @param destPort port number of the recipient of the message
     * @param callback the callback to notify upon completion
     */
    void sendDataSms(in byte[] data, String format, String destAddress, int destPort,
    void sendDataSms(in byte[] data, int subId, String destAddress, int destPort,
            in ICarrierMessagingCallback callback);

    /**
@@ -70,11 +73,11 @@ oneway interface ICarrierMessagingService {
     * with the send status.
     *
     * @param parts the parts of the multi-part text SMS to send
     * @param format the format of the response PDU, typically "3gpp" or "3gpp2"
     * @param subId SMS subscription ID of the SIM
     * @param destAddress phone number of the recipient of the message
     * @param callback the callback to notify upon completion
     */
    void sendMultipartTextSms(in List<String> parts, String format, String destAddress,
    void sendMultipartTextSms(in List<String> parts, int subId, String destAddress,
            in ICarrierMessagingCallback callback);

    /**
@@ -83,11 +86,13 @@ oneway interface ICarrierMessagingService {
     * status.
     *
     * @param pduUri the content provider URI of the PDU to send
     * @param locationUrl the optional url to send this MMS PDU.
     *         If this is not specified, PDU should be sent to the default MMSC url.
     * @param subId SMS subscription ID of the SIM
     * @param location the optional URI to send this MMS PDU. If this is {code null},
     *        the PDU should be sent to the default MMSC URL.
     * @param callback the callback to notify upon completion
     */
    void sendMms(in Uri pduUri, String locationUrl, in ICarrierMessagingCallback callback);
    void sendMms(in Uri pduUri, int subId, in Uri location,
            in ICarrierMessagingCallback callback);

    /**
     * Request downloading a new MMS.
@@ -95,9 +100,11 @@ oneway interface ICarrierMessagingService {
     * download status.
     *
     * @param pduUri the content provider URI of the PDU to be downloaded.
     * @param locationUrl the URL of the message to be downloaded.
     * @param subId SMS subscription ID of the SIM
     * @param location the URI of the message to be downloaded.
     * @param callback the callback to notify upon completion
     */
    void downloadMms(in Uri pduUri, String locationUrl, in ICarrierMessagingCallback callback);
    void downloadMms(in Uri pduUri, int subId, in Uri location,
            in ICarrierMessagingCallback callback);
}
Loading