1 /**
2  * Copyright (c) 2014, The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.service.carrier;
18 
19 import android.net.Uri;
20 import android.service.carrier.ICarrierMessagingCallback;
21 import android.service.carrier.MessagePdu;
22 
23 /**
24  * <p class="note"><strong>Note:</strong>
25  * This service can only be implemented by a carrier privileged app.
26  * @hide
27  */
28 oneway interface ICarrierMessagingService {
29     /**
30      * Request filtering an incoming SMS message.
31      * The service will call callback.onFilterComplete with the filtering result.
32      *
33      * @param pdu the PDUs of the message
34      * @param format the format of the PDUs, typically "3gpp" or "3gpp2"
35      * @param destPort the destination port of a data SMS. It will be -1 for text SMS
36      * @param subId SMS subscription ID of the SIM
37      * @param callback the callback to notify upon completion
38      */
39     @UnsupportedAppUsage(maxTargetSdk = 28)
filterSms( in MessagePdu pdu, String format, int destPort, int subId, in ICarrierMessagingCallback callback)40     void filterSms(
41         in MessagePdu pdu, String format, int destPort, int subId,
42         in ICarrierMessagingCallback callback);
43 
44     /**
45      * Request sending a new text SMS from the device.
46      * The service will call {@link ICarrierMessagingCallback#onSendSmsComplete} with the send
47      * status.
48      *
49      * @param text the text to send
50      * @param subId SMS subscription ID of the SIM
51      * @param destAddress phone number of the recipient of the message
52      * @param sendSmsFlag flag for sending SMS
53      * @param callback the callback to notify upon completion
54      */
sendTextSms(String text, int subId, String destAddress, int sendSmsFlag, in ICarrierMessagingCallback callback)55     void sendTextSms(String text, int subId, String destAddress, int sendSmsFlag,
56             in ICarrierMessagingCallback callback);
57 
58     /**
59      * Request sending a new data SMS from the device.
60      * The service will call {@link ICarrierMessagingCallback#onSendSmsComplete} with the send
61      * status.
62      *
63      * @param data the data to send
64      * @param subId SMS subscription ID of the SIM
65      * @param destAddress phone number of the recipient of the message
66      * @param destPort port number of the recipient of the message
67      * @param sendSmsFlag flag for sending SMS
68      * @param callback the callback to notify upon completion
69      */
sendDataSms(in byte[] data, int subId, String destAddress, int destPort, int sendSmsFlag, in ICarrierMessagingCallback callback)70     void sendDataSms(in byte[] data, int subId, String destAddress, int destPort,
71             int sendSmsFlag, in ICarrierMessagingCallback callback);
72 
73     /**
74      * Request sending a new multi-part text SMS from the device.
75      * The service will call {@link ICarrierMessagingCallback#onSendMultipartSmsComplete}
76      * with the send status.
77      *
78      * @param parts the parts of the multi-part text SMS to send
79      * @param subId SMS subscription ID of the SIM
80      * @param destAddress phone number of the recipient of the message
81      * @param sendSmsFlag flag for sending SMS
82      * @param callback the callback to notify upon completion
83      */
sendMultipartTextSms(in List<String> parts, int subId, String destAddress, int sendSmsFlag, in ICarrierMessagingCallback callback)84     void sendMultipartTextSms(in List<String> parts, int subId, String destAddress,
85             int sendSmsFlag, in ICarrierMessagingCallback callback);
86 
87     /**
88      * Request sending a new MMS PDU from the device.
89      * The service will call {@link ICarrierMessagingCallback#onSendMmsComplete} with the send
90      * status.
91      *
92      * @param pduUri the content provider URI of the PDU to send
93      * @param subId SMS subscription ID of the SIM
94      * @param location the optional URI to send this MMS PDU. If this is {code null},
95      *        the PDU should be sent to the default MMSC URL.
96      * @param callback the callback to notify upon completion
97      */
sendMms(in Uri pduUri, int subId, in Uri location, in ICarrierMessagingCallback callback)98     void sendMms(in Uri pduUri, int subId, in Uri location,
99             in ICarrierMessagingCallback callback);
100 
101     /**
102      * Request downloading a new MMS.
103      * The service will call {@link ICarrierMessagingCallback#onDownloadMmsComplete} with the
104      * download status.
105      *
106      * @param pduUri the content provider URI of the PDU to be downloaded.
107      * @param subId SMS subscription ID of the SIM
108      * @param location the URI of the message to be downloaded.
109      * @param callback the callback to notify upon completion
110      */
downloadMms(in Uri pduUri, int subId, in Uri location, in ICarrierMessagingCallback callback)111     void downloadMms(in Uri pduUri, int subId, in Uri location,
112             in ICarrierMessagingCallback callback);
113 }
114 
115