1e5d0e473Sopenharmony_ci/*
2e5d0e473Sopenharmony_ci * Copyright (C) 2021 Huawei Device Co., Ltd.
3e5d0e473Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4e5d0e473Sopenharmony_ci * you may not use this file except in compliance with the License.
5e5d0e473Sopenharmony_ci * You may obtain a copy of the License at
6e5d0e473Sopenharmony_ci *
7e5d0e473Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8e5d0e473Sopenharmony_ci *
9e5d0e473Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10e5d0e473Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11e5d0e473Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12e5d0e473Sopenharmony_ci * See the License for the specific language governing permissions and
13e5d0e473Sopenharmony_ci * limitations under the License.
14e5d0e473Sopenharmony_ci */
15e5d0e473Sopenharmony_ci
16e5d0e473Sopenharmony_ci#ifndef SMS_SERVICE_MANAGER_CLIENT_H
17e5d0e473Sopenharmony_ci#define SMS_SERVICE_MANAGER_CLIENT_H
18e5d0e473Sopenharmony_ci
19e5d0e473Sopenharmony_ci#include <mutex>
20e5d0e473Sopenharmony_ci#include <string>
21e5d0e473Sopenharmony_ci#include <vector>
22e5d0e473Sopenharmony_ci
23e5d0e473Sopenharmony_ci#include "i_sms_service_interface.h"
24e5d0e473Sopenharmony_ci#include "singleton.h"
25e5d0e473Sopenharmony_ci
26e5d0e473Sopenharmony_cinamespace OHOS {
27e5d0e473Sopenharmony_cinamespace Telephony {
28e5d0e473Sopenharmony_ciclass SmsServiceManagerClient : public std::enable_shared_from_this<SmsServiceManagerClient> {
29e5d0e473Sopenharmony_ci    DECLARE_SINGLETON(SmsServiceManagerClient)
30e5d0e473Sopenharmony_cipublic:
31e5d0e473Sopenharmony_ci    /**
32e5d0e473Sopenharmony_ci     * @brief Init the proxy of SmsService.
33e5d0e473Sopenharmony_ci     */
34e5d0e473Sopenharmony_ci    bool InitSmsServiceProxy();
35e5d0e473Sopenharmony_ci
36e5d0e473Sopenharmony_ci    /**
37e5d0e473Sopenharmony_ci     * @brief Reset the proxy of SmsService.
38e5d0e473Sopenharmony_ci     */
39e5d0e473Sopenharmony_ci    void ResetSmsServiceProxy();
40e5d0e473Sopenharmony_ci
41e5d0e473Sopenharmony_ci    /**
42e5d0e473Sopenharmony_ci     * @brief Set the Default Sms Slot Id To SmsService
43e5d0e473Sopenharmony_ci     *
44e5d0e473Sopenharmony_ci     * @param slotId [in], indicates the card slot index number,
45e5d0e473Sopenharmony_ci     * ranging from {@code 0} to the maximum card slot index number supported by the device.
46e5d0e473Sopenharmony_ci     * @return int32_t, returns {@code 0} if success.
47e5d0e473Sopenharmony_ci     */
48e5d0e473Sopenharmony_ci    int32_t SetDefaultSmsSlotId(int32_t slotId);
49e5d0e473Sopenharmony_ci
50e5d0e473Sopenharmony_ci    /**
51e5d0e473Sopenharmony_ci     * @brief Get the Default Sms Slot Id From SmsService
52e5d0e473Sopenharmony_ci     *
53e5d0e473Sopenharmony_ci     * @return int32_t, returns {@code 0} if success.
54e5d0e473Sopenharmony_ci     */
55e5d0e473Sopenharmony_ci    int32_t GetDefaultSmsSlotId();
56e5d0e473Sopenharmony_ci
57e5d0e473Sopenharmony_ci    /**
58e5d0e473Sopenharmony_ci     * @brief Get the Default Sms Sim Id From SmsService
59e5d0e473Sopenharmony_ci     *
60e5d0e473Sopenharmony_ci     * @param simId [out], indicates the sms sim index number.
61e5d0e473Sopenharmony_ci     * @return int32_t, returns {@code 0} if success.
62e5d0e473Sopenharmony_ci     */
63e5d0e473Sopenharmony_ci    int32_t GetDefaultSmsSimId(int32_t &simId);
64e5d0e473Sopenharmony_ci
65e5d0e473Sopenharmony_ci    /**
66e5d0e473Sopenharmony_ci     * @brief Sends a text type SMS message.
67e5d0e473Sopenharmony_ci     *
68e5d0e473Sopenharmony_ci     * @param slotId [in], indicates the card slot index number,
69e5d0e473Sopenharmony_ci     * ranging from {@code 0} to the maximum card slot index number supported by the device.
70e5d0e473Sopenharmony_ci     * @param desAddr [in], indicates the destination address.
71e5d0e473Sopenharmony_ci     * @param scAddr [in], indicates the sms center address.
72e5d0e473Sopenharmony_ci     * @param text [in], indicates sms content.
73e5d0e473Sopenharmony_ci     * @param sendCallback [in], indicates callback for send out.
74e5d0e473Sopenharmony_ci     * @param deliverCallback [in], indicates callback for delivery to destination user.
75e5d0e473Sopenharmony_ci     * @return int32_t, returns {@code 0} if success.
76e5d0e473Sopenharmony_ci     */
77e5d0e473Sopenharmony_ci    int32_t SendMessage(int32_t slotId, const std::u16string desAddr, const std::u16string scAddr,
78e5d0e473Sopenharmony_ci        const std::u16string text, const sptr<ISendShortMessageCallback> &callback,
79e5d0e473Sopenharmony_ci        const sptr<IDeliveryShortMessageCallback> &deliveryCallback);
80e5d0e473Sopenharmony_ci
81e5d0e473Sopenharmony_ci    /**
82e5d0e473Sopenharmony_ci     * @brief Sends a data type SMS message.
83e5d0e473Sopenharmony_ci     *
84e5d0e473Sopenharmony_ci     * @param slotId [in], indicates the card slot index number,
85e5d0e473Sopenharmony_ci     * ranging from {@code 0} to the maximum card slot index number supported by the device.
86e5d0e473Sopenharmony_ci     * @param desAddr [in], indicates the destination address.
87e5d0e473Sopenharmony_ci     * @param scAddr [in], indicates the sms center address.
88e5d0e473Sopenharmony_ci     * @param port [in], indicates the port of data sms.
89e5d0e473Sopenharmony_ci     * @param data [in], indicates the array of data sms.
90e5d0e473Sopenharmony_ci     * @param dataLen [in], indicates the array length of data sms.
91e5d0e473Sopenharmony_ci     * @param sendCallback [in], indicates callback for send out.
92e5d0e473Sopenharmony_ci     * @param deliverCallback [in], indicates callback for delivery to destination user.
93e5d0e473Sopenharmony_ci     * @return int32_t, returns {@code 0} if success.
94e5d0e473Sopenharmony_ci     */
95e5d0e473Sopenharmony_ci    int32_t SendMessage(int32_t slotId, const std::u16string desAddr, const std::u16string scAddr,
96e5d0e473Sopenharmony_ci        uint16_t port, const uint8_t *data, uint16_t dataLen, const sptr<ISendShortMessageCallback> &callback,
97e5d0e473Sopenharmony_ci        const sptr<IDeliveryShortMessageCallback> &deliveryCallback);
98e5d0e473Sopenharmony_ci
99e5d0e473Sopenharmony_ci    /**
100e5d0e473Sopenharmony_ci     * @brief Sends a text type SMS message without saving database.
101e5d0e473Sopenharmony_ci     *
102e5d0e473Sopenharmony_ci     * @param slotId [in], indicates the card slot index number,
103e5d0e473Sopenharmony_ci     * ranging from {@code 0} to the maximum card slot index number supported by the device.
104e5d0e473Sopenharmony_ci     * @param desAddr [in], indicates the destination address.
105e5d0e473Sopenharmony_ci     * @param scAddr [in], indicates the sms center address.
106e5d0e473Sopenharmony_ci     * @param text [in], indicates sms content.
107e5d0e473Sopenharmony_ci     * @param callback [in], indicates callback for send out.
108e5d0e473Sopenharmony_ci     * @param deliveryCallback [in], indicates callback for delivery to destination user.
109e5d0e473Sopenharmony_ci     * @return int32_t, returns {@code 0} if success.
110e5d0e473Sopenharmony_ci     */
111e5d0e473Sopenharmony_ci    int32_t SendMessageWithoutSave(int32_t slotId, const std::u16string desAddr, const std::u16string scAddr,
112e5d0e473Sopenharmony_ci        const std::u16string text, const sptr<ISendShortMessageCallback> &callback,
113e5d0e473Sopenharmony_ci        const sptr<IDeliveryShortMessageCallback> &deliveryCallback);
114e5d0e473Sopenharmony_ci
115e5d0e473Sopenharmony_ci    /**
116e5d0e473Sopenharmony_ci     * @brief Sets the address for the Short Message Service Center (SMSC) based on a specified slot ID.
117e5d0e473Sopenharmony_ci     *
118e5d0e473Sopenharmony_ci     * @param slotId [in], indicates the card slot index number,
119e5d0e473Sopenharmony_ci     * ranging from {@code 0} to the maximum card slot index number supported by the device.
120e5d0e473Sopenharmony_ci     * @param scAddr [in], indicates the sms center address.
121e5d0e473Sopenharmony_ci     * @return int32_t, returns {@code 0} if success.
122e5d0e473Sopenharmony_ci     */
123e5d0e473Sopenharmony_ci    int32_t SetScAddress(int32_t slotId, const std::u16string &scAddr);
124e5d0e473Sopenharmony_ci
125e5d0e473Sopenharmony_ci    /**
126e5d0e473Sopenharmony_ci     * @brief Obtains the SMSC address based on a specified slot ID.
127e5d0e473Sopenharmony_ci     *
128e5d0e473Sopenharmony_ci     * @param slotId [in], indicates the card slot index number,
129e5d0e473Sopenharmony_ci     * ranging from {@code 0} to the maximum card slot index number supported by the device.
130e5d0e473Sopenharmony_ci     * @param smscAddress [out]
131e5d0e473Sopenharmony_ci     * @return int32_t, returns {@code 0} if success.
132e5d0e473Sopenharmony_ci     */
133e5d0e473Sopenharmony_ci    int32_t GetScAddress(int32_t slotId, std::u16string &smscAddress);
134e5d0e473Sopenharmony_ci
135e5d0e473Sopenharmony_ci    /**
136e5d0e473Sopenharmony_ci     * @brief Add a sms to sim card.
137e5d0e473Sopenharmony_ci     *
138e5d0e473Sopenharmony_ci     * @param slotId [in], indicates the card slot index number,
139e5d0e473Sopenharmony_ci     * ranging from {@code 0} to the maximum card slot index number supported by the device.
140e5d0e473Sopenharmony_ci     * @param smsc [in], indicates the short message service center.
141e5d0e473Sopenharmony_ci     * @param pdu [in], indicates the protocol data unit of message.
142e5d0e473Sopenharmony_ci     * @param status [in], indicates the status of sim message.
143e5d0e473Sopenharmony_ci     * @return int32_t, returns {@code 0} if success.
144e5d0e473Sopenharmony_ci     */
145e5d0e473Sopenharmony_ci    int32_t AddSimMessage(int32_t slotId, const std::u16string &smsc, const std::u16string &pdu,
146e5d0e473Sopenharmony_ci        ISmsServiceInterface::SimMessageStatus status);
147e5d0e473Sopenharmony_ci
148e5d0e473Sopenharmony_ci    /**
149e5d0e473Sopenharmony_ci     * @brief Delete a sms in the sim card.
150e5d0e473Sopenharmony_ci     *
151e5d0e473Sopenharmony_ci     * @param slotId [in], indicates the card slot index number,
152e5d0e473Sopenharmony_ci     * ranging from {@code 0} to the maximum card slot index number supported by the device.
153e5d0e473Sopenharmony_ci     * @param msgIndex [in], indicates the message index.
154e5d0e473Sopenharmony_ci     * @return int32_t, returns {@code 0} if success.
155e5d0e473Sopenharmony_ci     */
156e5d0e473Sopenharmony_ci    int32_t DelSimMessage(int32_t slotId, uint32_t msgIndex);
157e5d0e473Sopenharmony_ci
158e5d0e473Sopenharmony_ci    /**
159e5d0e473Sopenharmony_ci     * @brief Update a sms in the sim card.
160e5d0e473Sopenharmony_ci     *
161e5d0e473Sopenharmony_ci     * @param slotId [in], indicates the card slot index number,
162e5d0e473Sopenharmony_ci     * ranging from {@code 0} to the maximum card slot index number supported by the device.
163e5d0e473Sopenharmony_ci     * @param msgIndex [in], indicates the message index.
164e5d0e473Sopenharmony_ci     * @param newStatus [in], indicates the new status of the sim message.
165e5d0e473Sopenharmony_ci     * @param pdu [in], indicates the protocol data unit of message.
166e5d0e473Sopenharmony_ci     * @param smsc [in], indicates the short message service center.
167e5d0e473Sopenharmony_ci     * @return int32_t, returns {@code 0} if success.
168e5d0e473Sopenharmony_ci     */
169e5d0e473Sopenharmony_ci    int32_t UpdateSimMessage(int32_t slotId, uint32_t msgIndex, ISmsServiceInterface::SimMessageStatus newStatus,
170e5d0e473Sopenharmony_ci        const std::u16string &pdu, const std::u16string &smsc);
171e5d0e473Sopenharmony_ci
172e5d0e473Sopenharmony_ci    /**
173e5d0e473Sopenharmony_ci     * @brief Get sim card all the sms.
174e5d0e473Sopenharmony_ci     *
175e5d0e473Sopenharmony_ci     * @param slotId [in], indicates the card slot index number,
176e5d0e473Sopenharmony_ci     * ranging from {@code 0} to the maximum card slot index number supported by the device.
177e5d0e473Sopenharmony_ci     * @param message [out], indicates all SMS messages of sim card.
178e5d0e473Sopenharmony_ci     * @return int32_t, returns {@code 0} if success.
179e5d0e473Sopenharmony_ci     */
180e5d0e473Sopenharmony_ci    int32_t GetAllSimMessages(int32_t slotId, std::vector<ShortMessage> &message);
181e5d0e473Sopenharmony_ci
182e5d0e473Sopenharmony_ci    /**
183e5d0e473Sopenharmony_ci     * @brief Configure a cell broadcast in a certain band range.
184e5d0e473Sopenharmony_ci     *
185e5d0e473Sopenharmony_ci     * @param slotId [in], indicates the card slot index number,
186e5d0e473Sopenharmony_ci     * ranging from {@code 0} to the maximum card slot index number supported by the device.
187e5d0e473Sopenharmony_ci     * @param enable [in], indicates whether to enable cell broadcast.
188e5d0e473Sopenharmony_ci     * @param fromMsgId [in], indicates the start message ID.
189e5d0e473Sopenharmony_ci     * @param toMsgId [in], indicates the end message ID.
190e5d0e473Sopenharmony_ci     * @param netType [in], indicates the network type.
191e5d0e473Sopenharmony_ci     * @return int32_t, returns {@code 0} if success.
192e5d0e473Sopenharmony_ci     */
193e5d0e473Sopenharmony_ci    int32_t SetCBConfig(int32_t slotId, bool enable, uint32_t startMessageId, uint32_t endMessageId, uint8_t ranType);
194e5d0e473Sopenharmony_ci
195e5d0e473Sopenharmony_ci    /**
196e5d0e473Sopenharmony_ci     * @brief SetImsSmsConfig enable or disable IMS SMS.
197e5d0e473Sopenharmony_ci     *
198e5d0e473Sopenharmony_ci     * @param slotId Indicates the card slot index number,
199e5d0e473Sopenharmony_ci     * ranging from {@code 0} to the maximum card slot index number supported by the device.
200e5d0e473Sopenharmony_ci     * @param enable Indicates enable or disable Ims sms
201e5d0e473Sopenharmony_ci     * ranging {@code 0} disable Ims sms {@code 1} enable Ims sms
202e5d0e473Sopenharmony_ci     * @return Returns {@code true} if enable or disable Ims Sms success; returns {@code false} otherwise.
203e5d0e473Sopenharmony_ci     */
204e5d0e473Sopenharmony_ci    bool SetImsSmsConfig(int32_t slotId, int32_t enable);
205e5d0e473Sopenharmony_ci
206e5d0e473Sopenharmony_ci    /**
207e5d0e473Sopenharmony_ci     * @brief Calculate Sms Message Split Segment count
208e5d0e473Sopenharmony_ci     *
209e5d0e473Sopenharmony_ci     * @param message [in], indicates input message.
210e5d0e473Sopenharmony_ci     * @param splitMessage [out], indicates the split information.
211e5d0e473Sopenharmony_ci     * @return int32_t, returns {@code 0} if success.
212e5d0e473Sopenharmony_ci     */
213e5d0e473Sopenharmony_ci    int32_t SplitMessage(const std::u16string &message, std::vector<std::u16string> &splitMessage);
214e5d0e473Sopenharmony_ci
215e5d0e473Sopenharmony_ci    /**
216e5d0e473Sopenharmony_ci     * @brief Calculate the Sms Message Segments Info
217e5d0e473Sopenharmony_ci     *
218e5d0e473Sopenharmony_ci     * @param slotId [in], indicates the card slot index number,
219e5d0e473Sopenharmony_ci     * ranging from {@code 0} to the maximum card slot index number supported by the device.
220e5d0e473Sopenharmony_ci     * @param message [in], indicates input message.
221e5d0e473Sopenharmony_ci     * @param force7BitCode [in], indicates sms encode type, 7bit or not.
222e5d0e473Sopenharmony_ci     * @param segInfo [out], indicates output sms segment.
223e5d0e473Sopenharmony_ci     * @return int32_t, returns {@code 0} if get sms segments info.
224e5d0e473Sopenharmony_ci     */
225e5d0e473Sopenharmony_ci    int32_t GetSmsSegmentsInfo(int32_t slotId, const std::u16string &message, bool force7BitCode,
226e5d0e473Sopenharmony_ci        ISmsServiceInterface::SmsSegmentsInfo &segInfo);
227e5d0e473Sopenharmony_ci
228e5d0e473Sopenharmony_ci    /**
229e5d0e473Sopenharmony_ci     * @brief Check Sms Is supported Ims newtwork
230e5d0e473Sopenharmony_ci     *
231e5d0e473Sopenharmony_ci     * @param slotId Indicates the card slot index number, ranging from {@code 0} to the maximum card
232e5d0e473Sopenharmony_ci     * slot index number supported by the device.
233e5d0e473Sopenharmony_ci     * @param isSupported Whether ims SMS is supported.
234e5d0e473Sopenharmony_ci     * @return int32_t, returns {@code 0} if success.
235e5d0e473Sopenharmony_ci     */
236e5d0e473Sopenharmony_ci    int32_t IsImsSmsSupported(int32_t slotId, bool &isSupported);
237e5d0e473Sopenharmony_ci
238e5d0e473Sopenharmony_ci    /**
239e5d0e473Sopenharmony_ci     * @brief Get the Ims Short Message Format 3gpp/3gpp2
240e5d0e473Sopenharmony_ci     *
241e5d0e473Sopenharmony_ci     * @param format Ims short message format
242e5d0e473Sopenharmony_ci     * @return int32_t, returns {@code 0} if success.
243e5d0e473Sopenharmony_ci     */
244e5d0e473Sopenharmony_ci    int32_t GetImsShortMessageFormat(std::u16string &format);
245e5d0e473Sopenharmony_ci
246e5d0e473Sopenharmony_ci    /**
247e5d0e473Sopenharmony_ci     * @brief Check whether it is supported Sms Capability
248e5d0e473Sopenharmony_ci     *
249e5d0e473Sopenharmony_ci     * @return {@code true} if UE has sms capability; returns {@code false} otherwise.
250e5d0e473Sopenharmony_ci     */
251e5d0e473Sopenharmony_ci    bool HasSmsCapability();
252e5d0e473Sopenharmony_ci
253e5d0e473Sopenharmony_ci    /**
254e5d0e473Sopenharmony_ci     * @brief Create a short message
255e5d0e473Sopenharmony_ci     *
256e5d0e473Sopenharmony_ci     * @param pdu Indicates pdu code,
257e5d0e473Sopenharmony_ci     * @param specification Indicates 3gpp or 3gpp2
258e5d0e473Sopenharmony_ci     * @param message Indicates a short message object
259e5d0e473Sopenharmony_ci     * @return Returns {@code 0} if CreateMessage success
260e5d0e473Sopenharmony_ci     */
261e5d0e473Sopenharmony_ci    int32_t CreateMessage(std::string pdu, std::string specification, ShortMessage &message);
262e5d0e473Sopenharmony_ci
263e5d0e473Sopenharmony_ci    /**
264e5d0e473Sopenharmony_ci     * @brief Mms base64 encode
265e5d0e473Sopenharmony_ci     *
266e5d0e473Sopenharmony_ci     * @param src Indicates source string,
267e5d0e473Sopenharmony_ci     * @param dest Indicates destination string
268e5d0e473Sopenharmony_ci     * @return Returns {@code true} if encode success; returns {@code false} otherwise
269e5d0e473Sopenharmony_ci     */
270e5d0e473Sopenharmony_ci    bool GetBase64Encode(std::string src, std::string &dest);
271e5d0e473Sopenharmony_ci
272e5d0e473Sopenharmony_ci    /**
273e5d0e473Sopenharmony_ci     * @brief Mms base64 decode
274e5d0e473Sopenharmony_ci     *
275e5d0e473Sopenharmony_ci     * @param src Indicates source string,
276e5d0e473Sopenharmony_ci     * @param dest Indicates destination string
277e5d0e473Sopenharmony_ci     * @return Returns {@code true} if decode success; returns {@code false} otherwise
278e5d0e473Sopenharmony_ci     */
279e5d0e473Sopenharmony_ci    bool GetBase64Decode(std::string src, std::string &dest);
280e5d0e473Sopenharmony_ci
281e5d0e473Sopenharmony_ci    /**
282e5d0e473Sopenharmony_ci     * @brief Get Encode String
283e5d0e473Sopenharmony_ci     *
284e5d0e473Sopenharmony_ci     * @param encodeString Indicates output string,
285e5d0e473Sopenharmony_ci     * @param charset Indicates character set,
286e5d0e473Sopenharmony_ci     * @param valLength Indicates input string length,
287e5d0e473Sopenharmony_ci     * @param strEncodeString Indicates input string
288e5d0e473Sopenharmony_ci     * @return Returns {@code true} if decode success; returns {@code false} otherwise
289e5d0e473Sopenharmony_ci     */
290e5d0e473Sopenharmony_ci    bool GetEncodeStringFunc(
291e5d0e473Sopenharmony_ci        std::string &encodeString, uint32_t charset, uint32_t valLength, std::string strEncodeString);
292e5d0e473Sopenharmony_ci
293e5d0e473Sopenharmony_ci    /**
294e5d0e473Sopenharmony_ci     * Send a Mms.
295e5d0e473Sopenharmony_ci     * @param slotId Indicates the card slot index number,
296e5d0e473Sopenharmony_ci     * ranging from {@code 0} to the maximum card slot index number supported by
297e5d0e473Sopenharmony_ci     * the device
298e5d0e473Sopenharmony_ci     * @param mmsc Indicates service center of mms
299e5d0e473Sopenharmony_ci     * @param data Indicates mms pdu byte array
300e5d0e473Sopenharmony_ci     * @param ua Indicates mms user agent
301e5d0e473Sopenharmony_ci     * @param uaprof Indicates mms user agent profile
302e5d0e473Sopenharmony_ci     * @param time Indicates timestamp for hap call function of SDK
303e5d0e473Sopenharmony_ci     * @return Returns {@code 0} if send mms success; returns {@code false} otherwise
304e5d0e473Sopenharmony_ci     */
305e5d0e473Sopenharmony_ci    int32_t SendMms(int32_t slotId, const std::u16string &mmsc, const std::u16string &data, const std::u16string &ua,
306e5d0e473Sopenharmony_ci        const std::u16string &uaprof, int64_t &time);
307e5d0e473Sopenharmony_ci
308e5d0e473Sopenharmony_ci    /**
309e5d0e473Sopenharmony_ci     * Download a Mms.
310e5d0e473Sopenharmony_ci     * @param slotId Indicates the card slot index number,
311e5d0e473Sopenharmony_ci     * ranging from {@code 0} to the maximum card slot index number supported by
312e5d0e473Sopenharmony_ci     * the device
313e5d0e473Sopenharmony_ci     * @param mmsc Indicates service center of mms
314e5d0e473Sopenharmony_ci     * @param data Indicates mms pdu byte array
315e5d0e473Sopenharmony_ci     * @param ua Indicates mms user agent
316e5d0e473Sopenharmony_ci     * @param uaprof Indicates mms user agent profile
317e5d0e473Sopenharmony_ci     * @return Returns {@code 0} if download mms success; returns {@code false} otherwise
318e5d0e473Sopenharmony_ci     */
319e5d0e473Sopenharmony_ci    int32_t DownloadMms(int32_t slotId, const std::u16string &mmsc, std::u16string &data, const std::u16string &ua,
320e5d0e473Sopenharmony_ci        const std::u16string &uaprof);
321e5d0e473Sopenharmony_ci
322e5d0e473Sopenharmony_ciprivate:
323e5d0e473Sopenharmony_ci    std::mutex mutex_;
324e5d0e473Sopenharmony_ci    sptr<ISmsServiceInterface> smsServiceInterface_;
325e5d0e473Sopenharmony_ci    sptr<IRemoteObject::DeathRecipient> recipient_;
326e5d0e473Sopenharmony_ci};
327e5d0e473Sopenharmony_ci
328e5d0e473Sopenharmony_ci/**
329e5d0e473Sopenharmony_ci * @brief Enumerates the result of sending SMS.
330e5d0e473Sopenharmony_ci */
331e5d0e473Sopenharmony_cienum class SmsSendResult {
332e5d0e473Sopenharmony_ci    /**
333e5d0e473Sopenharmony_ci     * Indicates that the SMS message is successfully sent.
334e5d0e473Sopenharmony_ci     */
335e5d0e473Sopenharmony_ci    SEND_SMS_SUCCESS = 0,
336e5d0e473Sopenharmony_ci    /**
337e5d0e473Sopenharmony_ci     * Indicates that sending the SMS message fails due to an unknown reason.
338e5d0e473Sopenharmony_ci     */
339e5d0e473Sopenharmony_ci    SEND_SMS_FAILURE_UNKNOWN = 1,
340e5d0e473Sopenharmony_ci    /**
341e5d0e473Sopenharmony_ci     * Indicates that sending the SMS fails because the modem is powered off.
342e5d0e473Sopenharmony_ci     */
343e5d0e473Sopenharmony_ci    SEND_SMS_FAILURE_RADIO_OFF = 2,
344e5d0e473Sopenharmony_ci    /**
345e5d0e473Sopenharmony_ci     * Indicates that sending the SMS message fails because the network is unavailable
346e5d0e473Sopenharmony_ci     * or does not support sending or reception of SMS messages.
347e5d0e473Sopenharmony_ci     */
348e5d0e473Sopenharmony_ci    SEND_SMS_FAILURE_SERVICE_UNAVAILABLE = 3
349e5d0e473Sopenharmony_ci};
350e5d0e473Sopenharmony_ci} // namespace Telephony
351e5d0e473Sopenharmony_ci} // namespace OHOS
352e5d0e473Sopenharmony_ci#endif // SMS_SERVICE_MANAGER_CLIENT_H
353