1d95e75fdSopenharmony_ci/* 2d95e75fdSopenharmony_ci * Copyright (C) 2021-2022 Huawei Device Co., Ltd. 3d95e75fdSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4d95e75fdSopenharmony_ci * you may not use this file except in compliance with the License. 5d95e75fdSopenharmony_ci * You may obtain a copy of the License at 6d95e75fdSopenharmony_ci * 7d95e75fdSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8d95e75fdSopenharmony_ci * 9d95e75fdSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10d95e75fdSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11d95e75fdSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12d95e75fdSopenharmony_ci * See the License for the specific language governing permissions and 13d95e75fdSopenharmony_ci * limitations under the License. 14d95e75fdSopenharmony_ci */ 15d95e75fdSopenharmony_ci 16d95e75fdSopenharmony_ci#ifndef CELLULAR_CALL_SUPPLEMENT_H 17d95e75fdSopenharmony_ci#define CELLULAR_CALL_SUPPLEMENT_H 18d95e75fdSopenharmony_ci 19d95e75fdSopenharmony_ci#include <string> 20d95e75fdSopenharmony_ci 21d95e75fdSopenharmony_ci#include "cellular_call_data_struct.h" 22d95e75fdSopenharmony_ci#include "tel_ril_call_parcel.h" 23d95e75fdSopenharmony_ci#include "tel_ril_types.h" 24d95e75fdSopenharmony_ci#include "ims_call_types.h" 25d95e75fdSopenharmony_ci#include "module_service_utils.h" 26d95e75fdSopenharmony_ci#include "supplement_request_cs.h" 27d95e75fdSopenharmony_ci#include "supplement_request_ims.h" 28d95e75fdSopenharmony_ci#include "telephony_log_wrapper.h" 29d95e75fdSopenharmony_ci 30d95e75fdSopenharmony_cinamespace OHOS { 31d95e75fdSopenharmony_cinamespace Telephony { 32d95e75fdSopenharmony_ciclass CellularCallSupplement { 33d95e75fdSopenharmony_cipublic: 34d95e75fdSopenharmony_ci /** 35d95e75fdSopenharmony_ci * Handle Clip mmi code 36d95e75fdSopenharmony_ci * 37d95e75fdSopenharmony_ci * 3GPP TS 22.030 V4.0.0 (2001-03) 6.5.6.2 Calling Line Identification Presentation (CLIP) 38d95e75fdSopenharmony_ci * The CLIP Supplementary Service is defined in GSM 02.81[12] 39d95e75fdSopenharmony_ci * 3GPP TS 22.030 V4.0.0 (2001-03) Annex B (normative):Codes for defined Supplementary Services 40d95e75fdSopenharmony_ci * 41d95e75fdSopenharmony_ci * @param slotId 42d95e75fdSopenharmony_ci * @param MMIData 43d95e75fdSopenharmony_ci */ 44d95e75fdSopenharmony_ci void HandleClip(int32_t slotId, const MMIData &mmiData); 45d95e75fdSopenharmony_ci 46d95e75fdSopenharmony_ci /** 47d95e75fdSopenharmony_ci * Handle Clir mmi code 48d95e75fdSopenharmony_ci * 49d95e75fdSopenharmony_ci * 3GPP TS 22.081 V4.0.0 (2001-03) 2 Calling Line Identification Restriction (CLIR) 50d95e75fdSopenharmony_ci * 3GPP TS 22.030 V4.0.0 (2001-03) Annex B (normative):Codes for defined Supplementary Services 51d95e75fdSopenharmony_ci * 52d95e75fdSopenharmony_ci * @param slotId 53d95e75fdSopenharmony_ci * @param MMIData 54d95e75fdSopenharmony_ci */ 55d95e75fdSopenharmony_ci void HandleClir(int32_t slotId, const MMIData &mmiData); 56d95e75fdSopenharmony_ci 57d95e75fdSopenharmony_ci /** 58d95e75fdSopenharmony_ci * Handle Colr mmi code 59d95e75fdSopenharmony_ci * 60d95e75fdSopenharmony_ci * 3GPP TS 22.081 V4.0.0 (2001-03) 4 Connected Line Identification Restriction (COLR) 61d95e75fdSopenharmony_ci * 3GPP TS 22.030 V4.0.0 (2001-03) Annex B (normative):Codes for defined Supplementary Services 62d95e75fdSopenharmony_ci * 63d95e75fdSopenharmony_ci * @param slotId 64d95e75fdSopenharmony_ci * @param MMIData 65d95e75fdSopenharmony_ci */ 66d95e75fdSopenharmony_ci void HandleColr(int32_t slotId, const MMIData &mmiData); 67d95e75fdSopenharmony_ci 68d95e75fdSopenharmony_ci /** 69d95e75fdSopenharmony_ci * Handle Colp mmi code 70d95e75fdSopenharmony_ci * 71d95e75fdSopenharmony_ci * 3GPP TS 22.081 V4.0.0 (2001-03) 3 Connected Line Identification Presentation (COLP) 72d95e75fdSopenharmony_ci * 3GPP TS 22.030 V4.0.0 (2001-03) Annex B (normative):Codes for defined Supplementary Services 73d95e75fdSopenharmony_ci * 74d95e75fdSopenharmony_ci * @param slotId 75d95e75fdSopenharmony_ci * @param MMIData 76d95e75fdSopenharmony_ci */ 77d95e75fdSopenharmony_ci void HandleColp(int32_t slotId, const MMIData &mmiData); 78d95e75fdSopenharmony_ci 79d95e75fdSopenharmony_ci /** 80d95e75fdSopenharmony_ci * Handle Call Transfer mmi code 81d95e75fdSopenharmony_ci * 82d95e75fdSopenharmony_ci * 3GPP TS 22.030 V4.0.0 (2001-03) 83d95e75fdSopenharmony_ci * 3GPP TS 22.030 V4.0.0 (2001-03) Annex B (normative):Codes for defined Supplementary Services 84d95e75fdSopenharmony_ci * 85d95e75fdSopenharmony_ci * @param slotId 86d95e75fdSopenharmony_ci * @param MMIData 87d95e75fdSopenharmony_ci */ 88d95e75fdSopenharmony_ci void HandleCallTransfer(int32_t slotId, const MMIData &mmiData); 89d95e75fdSopenharmony_ci 90d95e75fdSopenharmony_ci /** 91d95e75fdSopenharmony_ci * Set Call Transfer 92d95e75fdSopenharmony_ci * 93d95e75fdSopenharmony_ci * 27007-430_2001 7.11 Call forwarding number and conditions +CCFC 94d95e75fdSopenharmony_ci * 3GPP TS 22.082 [4] 95d95e75fdSopenharmony_ci * Control of the call forwarding supplementary service 96d95e75fdSopenharmony_ci * 97d95e75fdSopenharmony_ci * @param slotId 98d95e75fdSopenharmony_ci * @param CallTransferInfo 99d95e75fdSopenharmony_ci * @return Returns TELEPHONY_SUCCESS on success, others on failure. 100d95e75fdSopenharmony_ci */ 101d95e75fdSopenharmony_ci int32_t SetCallTransferInfo(int32_t slotId, const CallTransferInfo &cTInfo); 102d95e75fdSopenharmony_ci 103d95e75fdSopenharmony_ci /** 104d95e75fdSopenharmony_ci * Confirm whether IMS can set call transfer time. 105d95e75fdSopenharmony_ci * 106d95e75fdSopenharmony_ci * @param slotId[in], The slot id 107d95e75fdSopenharmony_ci * @param result[out], The result of can set or not 108d95e75fdSopenharmony_ci * @return Returns TELEPHONY_SUCCESS on success, others on failure. 109d95e75fdSopenharmony_ci */ 110d95e75fdSopenharmony_ci int32_t CanSetCallTransferTime(int32_t slotId, bool &result); 111d95e75fdSopenharmony_ci 112d95e75fdSopenharmony_ci /** 113d95e75fdSopenharmony_ci * Inquire Call Transfer 114d95e75fdSopenharmony_ci * 115d95e75fdSopenharmony_ci * 27007-430_2001 7.11 Call forwarding number and conditions +CCFC 116d95e75fdSopenharmony_ci * 3GPP TS 22.082 [4] 117d95e75fdSopenharmony_ci * Control of the call forwarding supplementary service 118d95e75fdSopenharmony_ci * 119d95e75fdSopenharmony_ci * @param slotId 120d95e75fdSopenharmony_ci * @param CallTransferType 121d95e75fdSopenharmony_ci * @return Returns TELEPHONY_SUCCESS on success, others on failure. 122d95e75fdSopenharmony_ci */ 123d95e75fdSopenharmony_ci int32_t GetCallTransferInfo(int32_t slotId, CallTransferType type); 124d95e75fdSopenharmony_ci 125d95e75fdSopenharmony_ci /** 126d95e75fdSopenharmony_ci * Handle Call Restriction mmi code 127d95e75fdSopenharmony_ci * 128d95e75fdSopenharmony_ci * 3GPP TS 22.088 [6] 1 Barring of outgoing calls 129d95e75fdSopenharmony_ci * 3GPP TS 22.088 [6] 2 Barring of incoming calls 130d95e75fdSopenharmony_ci * 131d95e75fdSopenharmony_ci * @param slotId 132d95e75fdSopenharmony_ci * @param MMIData 133d95e75fdSopenharmony_ci */ 134d95e75fdSopenharmony_ci void HandleCallRestriction(int32_t slotId, const MMIData &mmiData); 135d95e75fdSopenharmony_ci 136d95e75fdSopenharmony_ci /** 137d95e75fdSopenharmony_ci * Set Call Restriction 138d95e75fdSopenharmony_ci * 139d95e75fdSopenharmony_ci * 27007-430_2001 7.4 Facility lock +CLCK 140d95e75fdSopenharmony_ci * 3GPP TS 22.088 [6] 1 Barring of outgoing calls 141d95e75fdSopenharmony_ci * 3GPP TS 22.088 [6] 2 Barring of incoming calls 142d95e75fdSopenharmony_ci * 143d95e75fdSopenharmony_ci * Control of the call barring supplementary service 144d95e75fdSopenharmony_ci * 145d95e75fdSopenharmony_ci * @param slotId 146d95e75fdSopenharmony_ci * @param CallRestrictionInfo 147d95e75fdSopenharmony_ci * @return Returns TELEPHONY_SUCCESS on success, others on failure. 148d95e75fdSopenharmony_ci */ 149d95e75fdSopenharmony_ci int32_t SetCallRestriction(int32_t slotId, const CallRestrictionInfo &cRInfo); 150d95e75fdSopenharmony_ci 151d95e75fdSopenharmony_ci /** 152d95e75fdSopenharmony_ci * Inquire Call Restriction 153d95e75fdSopenharmony_ci * 154d95e75fdSopenharmony_ci * 27007-430_2001 7.4 Facility lock +CLCK 155d95e75fdSopenharmony_ci * 3GPP TS 22.088 [6] 1 Barring of outgoing calls 156d95e75fdSopenharmony_ci * 3GPP TS 22.088 [6] 2 Barring of incoming calls 157d95e75fdSopenharmony_ci * 158d95e75fdSopenharmony_ci * Control of the call barring supplementary service 159d95e75fdSopenharmony_ci * 160d95e75fdSopenharmony_ci * @param slotId 161d95e75fdSopenharmony_ci * @param CallRestrictionType 162d95e75fdSopenharmony_ci * @return Returns TELEPHONY_SUCCESS on success, others on failure. 163d95e75fdSopenharmony_ci */ 164d95e75fdSopenharmony_ci int32_t GetCallRestriction(int32_t slotId, CallRestrictionType facType); 165d95e75fdSopenharmony_ci 166d95e75fdSopenharmony_ci /** 167d95e75fdSopenharmony_ci * Inquire Call Restriction Password 168d95e75fdSopenharmony_ci * 169d95e75fdSopenharmony_ci * 27007-430_2001 7.4 Facility lock +CLCK 170d95e75fdSopenharmony_ci * 3GPP TS 22.088 [6] 1 Barring of outgoing calls 171d95e75fdSopenharmony_ci * 3GPP TS 22.088 [6] 2 Barring of incoming calls 172d95e75fdSopenharmony_ci * 173d95e75fdSopenharmony_ci * Control of the call barring supplementary service 174d95e75fdSopenharmony_ci * 175d95e75fdSopenharmony_ci * @param slotId 176d95e75fdSopenharmony_ci * @param CallRestrictionType 177d95e75fdSopenharmony_ci * @param oldPassword[in] indicate the call restriction old password 178d95e75fdSopenharmony_ci * @param newPassword[in] indicate the call restriction new password 179d95e75fdSopenharmony_ci * @return Returns TELEPHONY_SUCCESS on success, others on failure. 180d95e75fdSopenharmony_ci */ 181d95e75fdSopenharmony_ci int32_t SetBarringPassword( 182d95e75fdSopenharmony_ci int32_t slotId, CallRestrictionType facType, const char *oldPassword, const char *newPassword); 183d95e75fdSopenharmony_ci 184d95e75fdSopenharmony_ci /** 185d95e75fdSopenharmony_ci * Handle Call Waiting mmi code 186d95e75fdSopenharmony_ci * 187d95e75fdSopenharmony_ci * 27007-430_2001 7.12 Call waiting +CCWA 188d95e75fdSopenharmony_ci * 3GPP TS 22.083 [5] 1 Call waiting (CW) 189d95e75fdSopenharmony_ci * 190d95e75fdSopenharmony_ci * @param slotId 191d95e75fdSopenharmony_ci * @param MMIData 192d95e75fdSopenharmony_ci */ 193d95e75fdSopenharmony_ci void HandleCallWaiting(int32_t slotId, const MMIData &mmiData); 194d95e75fdSopenharmony_ci 195d95e75fdSopenharmony_ci /** 196d95e75fdSopenharmony_ci * Set Call Waiting 197d95e75fdSopenharmony_ci * 198d95e75fdSopenharmony_ci * 27007-430_2001 7.12 Call waiting +CCWA 199d95e75fdSopenharmony_ci * 3GPP TS 22.083 [5] 1 Call waiting (CW) 200d95e75fdSopenharmony_ci * 201d95e75fdSopenharmony_ci * Control of the Call Waiting supplementary service 202d95e75fdSopenharmony_ci * 203d95e75fdSopenharmony_ci * @param slotId 204d95e75fdSopenharmony_ci * @param activate 205d95e75fdSopenharmony_ci * @return Returns TELEPHONY_SUCCESS on success, others on failure. 206d95e75fdSopenharmony_ci */ 207d95e75fdSopenharmony_ci int32_t SetCallWaiting(int32_t slotId, bool activate); 208d95e75fdSopenharmony_ci 209d95e75fdSopenharmony_ci /** 210d95e75fdSopenharmony_ci * Inquire Call Waiting 211d95e75fdSopenharmony_ci * 212d95e75fdSopenharmony_ci * 27007-430_2001 7.12 Call waiting +CCWA 213d95e75fdSopenharmony_ci * 3GPP TS 22.083 [5] 1 Call waiting (CW) 214d95e75fdSopenharmony_ci * 215d95e75fdSopenharmony_ci * Control of the Call Waiting supplementary service 216d95e75fdSopenharmony_ci * 217d95e75fdSopenharmony_ci * @param slotId 218d95e75fdSopenharmony_ci * @return Returns TELEPHONY_SUCCESS on success, others on failure. 219d95e75fdSopenharmony_ci */ 220d95e75fdSopenharmony_ci int32_t GetCallWaiting(int32_t slotId); 221d95e75fdSopenharmony_ci 222d95e75fdSopenharmony_ci /** 223d95e75fdSopenharmony_ci * Send Ussd msg 224d95e75fdSopenharmony_ci * 225d95e75fdSopenharmony_ci * 22.090 Unstructured Supplementary Service Data (USSD); Stage 1 226d95e75fdSopenharmony_ci * 23.090 Unstructured Supplementary Service Data (USSD); Stage 2 227d95e75fdSopenharmony_ci * 24.090 Unstructured Supplementary Service Data (USSD); Stage 3 228d95e75fdSopenharmony_ci * 229d95e75fdSopenharmony_ci * Control of the Ussd supplementary service 230d95e75fdSopenharmony_ci * 231d95e75fdSopenharmony_ci * @param slotId 232d95e75fdSopenharmony_ci * @return Returns TELEPHONY_SUCCESS on success, others on failure. 233d95e75fdSopenharmony_ci */ 234d95e75fdSopenharmony_ci int32_t SendUssd(int32_t slotId, const std::string &msg); 235d95e75fdSopenharmony_ci 236d95e75fdSopenharmony_ci /** 237d95e75fdSopenharmony_ci * Event Set Pin Puk 238d95e75fdSopenharmony_ci * 239d95e75fdSopenharmony_ci * @param PinPukResponse 240d95e75fdSopenharmony_ci */ 241d95e75fdSopenharmony_ci void EventSetPinPuk(const PinPukResponse &pinPukResponse); 242d95e75fdSopenharmony_ci 243d95e75fdSopenharmony_ci /** 244d95e75fdSopenharmony_ci * SIM PIN unlock 245d95e75fdSopenharmony_ci * 246d95e75fdSopenharmony_ci * @param slotId 247d95e75fdSopenharmony_ci * @param mmiData 248d95e75fdSopenharmony_ci * @return Returns true on success. 249d95e75fdSopenharmony_ci */ 250d95e75fdSopenharmony_ci void AlterPinPassword(int32_t slotId, const MMIData &mmiData); 251d95e75fdSopenharmony_ci 252d95e75fdSopenharmony_ci /** 253d95e75fdSopenharmony_ci * SIM PUK unlock 254d95e75fdSopenharmony_ci * 255d95e75fdSopenharmony_ci * @param slotId 256d95e75fdSopenharmony_ci * @param mmiData 257d95e75fdSopenharmony_ci * @return Returns true on success. 258d95e75fdSopenharmony_ci */ 259d95e75fdSopenharmony_ci void UnlockPuk(int32_t slotId, const MMIData &mmiData); 260d95e75fdSopenharmony_ci 261d95e75fdSopenharmony_ci /** 262d95e75fdSopenharmony_ci * SIM PIN2 unlock 263d95e75fdSopenharmony_ci * 264d95e75fdSopenharmony_ci * @param slotId 265d95e75fdSopenharmony_ci * @param mmiData 266d95e75fdSopenharmony_ci * @return Returns true on success. 267d95e75fdSopenharmony_ci */ 268d95e75fdSopenharmony_ci void AlterPin2Password(int32_t slotId, const MMIData &mmiData); 269d95e75fdSopenharmony_ci 270d95e75fdSopenharmony_ci /** 271d95e75fdSopenharmony_ci * SIM PUK2 unlock 272d95e75fdSopenharmony_ci * 273d95e75fdSopenharmony_ci * @param slotId 274d95e75fdSopenharmony_ci * @param mmiData 275d95e75fdSopenharmony_ci * @return Returns true on success. 276d95e75fdSopenharmony_ci */ 277d95e75fdSopenharmony_ci void UnlockPuk2(int32_t slotId, const MMIData &mmiData); 278d95e75fdSopenharmony_ci 279d95e75fdSopenharmony_ci /** 280d95e75fdSopenharmony_ci * Close Unfinished ussd 281d95e75fdSopenharmony_ci * 282d95e75fdSopenharmony_ci * Control of close Ussd supplementary service 283d95e75fdSopenharmony_ci * 284d95e75fdSopenharmony_ci * @param slotId 285d95e75fdSopenharmony_ci * @return Returns TELEPHONY_SUCCESS on success, others on failure. 286d95e75fdSopenharmony_ci */ 287d95e75fdSopenharmony_ci int32_t CloseUnFinishedUssd(int32_t slotId); 288d95e75fdSopenharmony_ci 289d95e75fdSopenharmony_ci /** 290d95e75fdSopenharmony_ci * Get clip result 291d95e75fdSopenharmony_ci * 292d95e75fdSopenharmony_ci * 3GPP TS 27.007 V3.9.0 (2001-06) 7.6 Calling line identification presentation +CLIP 293d95e75fdSopenharmony_ci * 294d95e75fdSopenharmony_ci * @param GetClipResult 295d95e75fdSopenharmony_ci * @param message the remain message for user which come from network 296d95e75fdSopenharmony_ci * @param flag, {@code SS_FROM_MMI_CODE} mean the request action come from dial api 297d95e75fdSopenharmony_ci * {@code SS_FROM_SETTING_MENU} means the request action come from setting app. 298d95e75fdSopenharmony_ci */ 299d95e75fdSopenharmony_ci void EventGetClip(const GetClipResult &getClipResult, const std::string &message, int32_t flag); 300d95e75fdSopenharmony_ci 301d95e75fdSopenharmony_ci /** 302d95e75fdSopenharmony_ci * Set clip result 303d95e75fdSopenharmony_ci * 304d95e75fdSopenharmony_ci * 3GPP TS 27.007 V3.9.0 (2001-06) 7.6 Calling line identification presentation +CLIP 305d95e75fdSopenharmony_ci * 306d95e75fdSopenharmony_ci * @param result 307d95e75fdSopenharmony_ci * @param message the remain message for user which come from network 308d95e75fdSopenharmony_ci * @param flag, {@code SS_FROM_MMI_CODE} mean the request action come from dial api 309d95e75fdSopenharmony_ci * {@code SS_FROM_SETTING_MENU} means the request action come from setting app. 310d95e75fdSopenharmony_ci */ 311d95e75fdSopenharmony_ci void EventSetClip(int32_t result, const std::string &message, int32_t flag); 312d95e75fdSopenharmony_ci 313d95e75fdSopenharmony_ci /** 314d95e75fdSopenharmony_ci * Get clir result 315d95e75fdSopenharmony_ci * 316d95e75fdSopenharmony_ci * 3GPP TS 27.007 V3.9.0 (2001-06) 7.7 Calling line identification restriction +CLIR 317d95e75fdSopenharmony_ci * 318d95e75fdSopenharmony_ci * @param GetClirResult 319d95e75fdSopenharmony_ci * @param message the remain message for user which come from network 320d95e75fdSopenharmony_ci * @param flag, {@code SS_FROM_MMI_CODE} mean the request action come from dial api 321d95e75fdSopenharmony_ci * {@code SS_FROM_SETTING_MENU} means the request action come from setting app. 322d95e75fdSopenharmony_ci */ 323d95e75fdSopenharmony_ci void EventGetClir(const GetClirResult &result, const std::string &message, int32_t flag); 324d95e75fdSopenharmony_ci 325d95e75fdSopenharmony_ci /** 326d95e75fdSopenharmony_ci * Set clir result 327d95e75fdSopenharmony_ci * 328d95e75fdSopenharmony_ci * 3GPP TS 27.007 V3.9.0 (2001-06) 7.7 Calling line identification restriction +CLIR 329d95e75fdSopenharmony_ci * 330d95e75fdSopenharmony_ci * @param result 331d95e75fdSopenharmony_ci * @param message the remain message for user which come from network 332d95e75fdSopenharmony_ci * @param flag, {@code SS_FROM_MMI_CODE} mean the request action come from dial api 333d95e75fdSopenharmony_ci * {@code SS_FROM_SETTING_MENU} means the request action come from setting app. 334d95e75fdSopenharmony_ci */ 335d95e75fdSopenharmony_ci void EventSetClir(int32_t result, const std::string &message, int32_t flag); 336d95e75fdSopenharmony_ci 337d95e75fdSopenharmony_ci /** 338d95e75fdSopenharmony_ci * Get colr result 339d95e75fdSopenharmony_ci * 340d95e75fdSopenharmony_ci * 3GPP TS 27.007 V3.9.0 (2001-06) 7.31 Connected line identification restriction status +COLR 341d95e75fdSopenharmony_ci * 342d95e75fdSopenharmony_ci * @param GetColrResult 343d95e75fdSopenharmony_ci * @param message the remain message for user which come from network 344d95e75fdSopenharmony_ci * @param flag, {@code SS_FROM_MMI_CODE} mean the request action come from dial api 345d95e75fdSopenharmony_ci * {@code SS_FROM_SETTING_MENU} means the request action come from setting app. 346d95e75fdSopenharmony_ci */ 347d95e75fdSopenharmony_ci void EventGetColr(const GetColrResult &result, const std::string &message, int32_t flag); 348d95e75fdSopenharmony_ci 349d95e75fdSopenharmony_ci /** 350d95e75fdSopenharmony_ci * Set colr result 351d95e75fdSopenharmony_ci * 352d95e75fdSopenharmony_ci * 3GPP TS 27.007 V3.9.0 (2001-06) 7.31 Connected line identification restriction status +COLR 353d95e75fdSopenharmony_ci * 354d95e75fdSopenharmony_ci * @param result 355d95e75fdSopenharmony_ci * @param message the remain message for user which come from network 356d95e75fdSopenharmony_ci * @param flag, {@code SS_FROM_MMI_CODE} mean the request action come from dial api 357d95e75fdSopenharmony_ci * {@code SS_FROM_SETTING_MENU} means the request action come from setting app. 358d95e75fdSopenharmony_ci */ 359d95e75fdSopenharmony_ci void EventSetColr(int32_t result, const std::string &message, int32_t flag); 360d95e75fdSopenharmony_ci 361d95e75fdSopenharmony_ci /** 362d95e75fdSopenharmony_ci * Get colp result 363d95e75fdSopenharmony_ci * 364d95e75fdSopenharmony_ci * 3GPP TS 27.007 V3.9.0 (2001-06) 7.8 Connected line identification presentation +COLP 365d95e75fdSopenharmony_ci * 366d95e75fdSopenharmony_ci * @param GetColpResult 367d95e75fdSopenharmony_ci * @param message the remain message for user which come from network 368d95e75fdSopenharmony_ci * @param flag, {@code SS_FROM_MMI_CODE} mean the request action come from dial api 369d95e75fdSopenharmony_ci * {@code SS_FROM_SETTING_MENU} means the request action come from setting app. 370d95e75fdSopenharmony_ci */ 371d95e75fdSopenharmony_ci void EventGetColp(const GetColpResult &result, const std::string &message, int32_t flag); 372d95e75fdSopenharmony_ci 373d95e75fdSopenharmony_ci /** 374d95e75fdSopenharmony_ci * Set colp result 375d95e75fdSopenharmony_ci * 376d95e75fdSopenharmony_ci * 3GPP TS 27.007 V3.9.0 (2001-06) 7.8 Connected line identification presentation +COLP 377d95e75fdSopenharmony_ci * 378d95e75fdSopenharmony_ci * @param result 379d95e75fdSopenharmony_ci * @param message the remain message for user which come from network 380d95e75fdSopenharmony_ci * @param flag, {@code SS_FROM_MMI_CODE} mean the request action come from dial api 381d95e75fdSopenharmony_ci * {@code SS_FROM_SETTING_MENU} means the request action come from setting app. 382d95e75fdSopenharmony_ci */ 383d95e75fdSopenharmony_ci void EventSetColp(int32_t result, const std::string &message, int32_t flag); 384d95e75fdSopenharmony_ci 385d95e75fdSopenharmony_ci /** 386d95e75fdSopenharmony_ci * Get call restriction result 387d95e75fdSopenharmony_ci * 388d95e75fdSopenharmony_ci * 3GPP TS 27.007 V3.9.0 (2001-06) 7.4 Facility lock +CLCK 389d95e75fdSopenharmony_ci * 390d95e75fdSopenharmony_ci * @param CallRestrictionResult 391d95e75fdSopenharmony_ci * @param message the remain message for user which come from network 392d95e75fdSopenharmony_ci * @param flag, {@code SS_FROM_MMI_CODE} mean the request action come from dial api 393d95e75fdSopenharmony_ci * {@code SS_FROM_SETTING_MENU} means the request action come from setting app. 394d95e75fdSopenharmony_ci */ 395d95e75fdSopenharmony_ci void EventGetCallRestriction(const CallRestrictionResult &result, const std::string &message, int32_t flag); 396d95e75fdSopenharmony_ci 397d95e75fdSopenharmony_ci /** 398d95e75fdSopenharmony_ci * Set call restriction result 399d95e75fdSopenharmony_ci * 400d95e75fdSopenharmony_ci * 3GPP TS 27.007 V3.9.0 (2001-06) 7.4 Facility lock +CLCK 401d95e75fdSopenharmony_ci * 402d95e75fdSopenharmony_ci * @param result 403d95e75fdSopenharmony_ci * @param message the remain message for user which come from network 404d95e75fdSopenharmony_ci * @param flag, {@code SS_FROM_MMI_CODE} mean the request action come from dial api 405d95e75fdSopenharmony_ci * {@code SS_FROM_SETTING_MENU} means the request action come from setting app. 406d95e75fdSopenharmony_ci */ 407d95e75fdSopenharmony_ci void EventSetCallRestriction(int32_t result, const std::string &message, int32_t flag); 408d95e75fdSopenharmony_ci 409d95e75fdSopenharmony_ci /** 410d95e75fdSopenharmony_ci * Set call restriction password result 411d95e75fdSopenharmony_ci * 412d95e75fdSopenharmony_ci * 3GPP TS 27.007 V3.9.0 (2001-06) 7.4 Facility lock +CLCK 413d95e75fdSopenharmony_ci * 414d95e75fdSopenharmony_ci * @param result 415d95e75fdSopenharmony_ci * @param message the remain message for user which come from network 416d95e75fdSopenharmony_ci * @param flag, {@code SS_FROM_MMI_CODE} mean the request action come from dial api 417d95e75fdSopenharmony_ci * {@code SS_FROM_SETTING_MENU} means the request action come from setting app. 418d95e75fdSopenharmony_ci */ 419d95e75fdSopenharmony_ci void EventSetBarringPassword(int32_t result, const std::string &message, int32_t flag); 420d95e75fdSopenharmony_ci /** 421d95e75fdSopenharmony_ci * Get call waiting result 422d95e75fdSopenharmony_ci * 423d95e75fdSopenharmony_ci * 3GPP TS 27.007 V3.9.0 (2001-06) 7.12 Call waiting +CCWA 424d95e75fdSopenharmony_ci * status: 0 not active; 1 active 425d95e75fdSopenharmony_ci * 426d95e75fdSopenharmony_ci * @param CallWaitResult waitingInfo 427d95e75fdSopenharmony_ci * @param message the remain message for user which come from network 428d95e75fdSopenharmony_ci * @param flag, {@code SS_FROM_MMI_CODE} mean the request action come from dial api 429d95e75fdSopenharmony_ci * {@code SS_FROM_SETTING_MENU} means the request action come from setting app. 430d95e75fdSopenharmony_ci */ 431d95e75fdSopenharmony_ci void EventGetCallWaiting(const CallWaitResult &waitingInfo, const std::string &message, int32_t flag); 432d95e75fdSopenharmony_ci 433d95e75fdSopenharmony_ci /** 434d95e75fdSopenharmony_ci * Set call waiting result 435d95e75fdSopenharmony_ci * 436d95e75fdSopenharmony_ci * 3GPP TS 27.007 V3.9.0 (2001-06) 7.12 Call waiting +CCWA 437d95e75fdSopenharmony_ci * 438d95e75fdSopenharmony_ci * @param result 439d95e75fdSopenharmony_ci * @param message the remain message for user which come from network 440d95e75fdSopenharmony_ci * @param flag, {@code SS_FROM_MMI_CODE} mean the request action come from dial api 441d95e75fdSopenharmony_ci * {@code SS_FROM_SETTING_MENU} means the request action come from setting app. 442d95e75fdSopenharmony_ci */ 443d95e75fdSopenharmony_ci void EventSetCallWaiting(int32_t result, const std::string &message, int32_t flag); 444d95e75fdSopenharmony_ci 445d95e75fdSopenharmony_ci /** 446d95e75fdSopenharmony_ci * Get call transfer result 447d95e75fdSopenharmony_ci * 448d95e75fdSopenharmony_ci * 3GPP TS 27.007 V3.9.0 (2001-06) 7.11 Call forwarding number and conditions +CCFC 449d95e75fdSopenharmony_ci * 450d95e75fdSopenharmony_ci * @param CallForwardQueryInfoList 451d95e75fdSopenharmony_ci * @param message the remain message for user which come from network 452d95e75fdSopenharmony_ci * @param flag, {@code SS_FROM_MMI_CODE} mean the request action come from dial api 453d95e75fdSopenharmony_ci * {@code SS_FROM_SETTING_MENU} means the request action come from setting app. 454d95e75fdSopenharmony_ci */ 455d95e75fdSopenharmony_ci void EventGetCallTransferInfo( 456d95e75fdSopenharmony_ci const CallForwardQueryInfoList &cFQueryList, const std::string &message, int32_t flag); 457d95e75fdSopenharmony_ci 458d95e75fdSopenharmony_ci /** 459d95e75fdSopenharmony_ci * Set call transfer result 460d95e75fdSopenharmony_ci * 461d95e75fdSopenharmony_ci * 3GPP TS 27.007 V3.9.0 (2001-06) 7.11 Call forwarding number and conditions +CCFC 462d95e75fdSopenharmony_ci * 463d95e75fdSopenharmony_ci * @param result 464d95e75fdSopenharmony_ci * @param message the remain message for user which come from network 465d95e75fdSopenharmony_ci * @param flag, {@code SS_FROM_MMI_CODE} mean the request action come from dial api 466d95e75fdSopenharmony_ci * {@code SS_FROM_SETTING_MENU} means the request action come from setting app. 467d95e75fdSopenharmony_ci */ 468d95e75fdSopenharmony_ci void EventSetCallTransferInfo(int32_t result, const std::string &message, int32_t flag); 469d95e75fdSopenharmony_ci 470d95e75fdSopenharmony_ci /** 471d95e75fdSopenharmony_ci * Send ussd result 472d95e75fdSopenharmony_ci * 473d95e75fdSopenharmony_ci * 3GPP TS 3GPP TS 22.030 V16.0.0 (2020-07) 6.5 Supplementary Services Control 474d95e75fdSopenharmony_ci * 475d95e75fdSopenharmony_ci * @param RadioResponseInfo 476d95e75fdSopenharmony_ci */ 477d95e75fdSopenharmony_ci void EventSendUssd(const RadioResponseInfo &responseInfo); 478d95e75fdSopenharmony_ci 479d95e75fdSopenharmony_ci /** 480d95e75fdSopenharmony_ci * Ss notify 481d95e75fdSopenharmony_ci * 482d95e75fdSopenharmony_ci * @param SsNoticeInfo 483d95e75fdSopenharmony_ci */ 484d95e75fdSopenharmony_ci void EventSsNotify(SsNoticeInfo &ssNoticeInfo); 485d95e75fdSopenharmony_ci 486d95e75fdSopenharmony_ci /** 487d95e75fdSopenharmony_ci * Ussd notify 488d95e75fdSopenharmony_ci * 489d95e75fdSopenharmony_ci * @param UssdNoticeInfo 490d95e75fdSopenharmony_ci */ 491d95e75fdSopenharmony_ci void EventUssdNotify(UssdNoticeInfo &ussdNoticeInfo); 492d95e75fdSopenharmony_ci 493d95e75fdSopenharmony_ci /** 494d95e75fdSopenharmony_ci * Close Unfinished ussd result 495d95e75fdSopenharmony_ci * 496d95e75fdSopenharmony_ci * @param RadioResponseInfo 497d95e75fdSopenharmony_ci */ 498d95e75fdSopenharmony_ci void EventCloseUnFinishedUssd(const RadioResponseInfo &responseInfo); 499d95e75fdSopenharmony_ci 500d95e75fdSopenharmony_ciprivate: 501d95e75fdSopenharmony_ci /** 502d95e75fdSopenharmony_ci * Obtain ServiceCode 503d95e75fdSopenharmony_ci * 504d95e75fdSopenharmony_ci * @param serviceInfoB 505d95e75fdSopenharmony_ci * @return ServiceClassType 506d95e75fdSopenharmony_ci */ 507d95e75fdSopenharmony_ci int32_t ObtainServiceCode(const std::string &serviceInfoB); 508d95e75fdSopenharmony_ci 509d95e75fdSopenharmony_ci /** 510d95e75fdSopenharmony_ci * Obtain ServiceCode 511d95e75fdSopenharmony_ci * 512d95e75fdSopenharmony_ci * @param actionString 513d95e75fdSopenharmony_ci * @param phoneNumber 514d95e75fdSopenharmony_ci * @param callTransferAction 515d95e75fdSopenharmony_ci * @return Returns TELEPHONY_SUCCESS on success, others on failure. 516d95e75fdSopenharmony_ci */ 517d95e75fdSopenharmony_ci int32_t ObtainCallTrasferAction( 518d95e75fdSopenharmony_ci const char *actionString, const std::string &phoneNumber, CallTransferSettingType &callTransferAction); 519d95e75fdSopenharmony_ci 520d95e75fdSopenharmony_ci /** 521d95e75fdSopenharmony_ci * Obtain Cause 522d95e75fdSopenharmony_ci * 523d95e75fdSopenharmony_ci * 3GPP TS 22.030 V4.0.0 (2001-03) Annex B (normative): Codes for defined Supplementary Services 524d95e75fdSopenharmony_ci * 525d95e75fdSopenharmony_ci * @param basicString 526d95e75fdSopenharmony_ci * @return CallTransferType 527d95e75fdSopenharmony_ci */ 528d95e75fdSopenharmony_ci int32_t ObtainCause(const std::string &serviceInfoC); 529d95e75fdSopenharmony_ci 530d95e75fdSopenharmony_ci /** 531d95e75fdSopenharmony_ci * Handle get call transfer action which come from mmi code 532d95e75fdSopenharmony_ci * 533d95e75fdSopenharmony_ci * @param slotId 534d95e75fdSopenharmony_ci * @param cause the call transfer type 535d95e75fdSopenharmony_ci */ 536d95e75fdSopenharmony_ci void HandleGetCallTransfer(int32_t slotId, int32_t cause); 537d95e75fdSopenharmony_ci 538d95e75fdSopenharmony_ci /** 539d95e75fdSopenharmony_ci * Handle set call transfer action which come from mmi code 540d95e75fdSopenharmony_ci * 541d95e75fdSopenharmony_ci * @param slotId 542d95e75fdSopenharmony_ci * @param serviceCode the service class type 543d95e75fdSopenharmony_ci * @param cause the call transfer type 544d95e75fdSopenharmony_ci * @param phoneNumber the call transfer number 545d95e75fdSopenharmony_ci * @param callTransferAction 546d95e75fdSopenharmony_ci */ 547d95e75fdSopenharmony_ci void HandleSetCallTransfer(int32_t slotId, int32_t serviceCode, int32_t cause, const std::string &phoneNumber, 548d95e75fdSopenharmony_ci CallTransferSettingType callTransferAction); 549d95e75fdSopenharmony_ci 550d95e75fdSopenharmony_ci int32_t CheckSetCallTransferInfo(const CallTransferInfo &cfInfo); 551d95e75fdSopenharmony_ci int32_t SetCallTransferInfoByIms( 552d95e75fdSopenharmony_ci int32_t slotId, const CallTransferInfo &cfInfo, const std::shared_ptr<SsRequestCommand> &command); 553d95e75fdSopenharmony_ci int32_t CheckCallRestrictionType(std::string &fac, const CallRestrictionType &facType); 554d95e75fdSopenharmony_ci int32_t SetCallRestrictionByIms(int32_t slotId, std::string &fac, int32_t mode, std::string &pw, 555d95e75fdSopenharmony_ci const std::shared_ptr<SsRequestCommand> &command); 556d95e75fdSopenharmony_ci 557d95e75fdSopenharmony_ci /** 558d95e75fdSopenharmony_ci * Obtain Barring Installation 559d95e75fdSopenharmony_ci * 560d95e75fdSopenharmony_ci * 27007-430_2001 7.4 Facility lock +CLCK 561d95e75fdSopenharmony_ci * 3GPP TS 22.088 [6] 1 Barring of outgoing calls 562d95e75fdSopenharmony_ci * 3GPP TS 22.088 [6] 2 Barring of incoming calls 563d95e75fdSopenharmony_ci * 564d95e75fdSopenharmony_ci * @param serviceInfoC 565d95e75fdSopenharmony_ci * @return Barring type 566d95e75fdSopenharmony_ci */ 567d95e75fdSopenharmony_ci std::string ObtainBarringInstallation(const std::string &serviceInfoC); 568d95e75fdSopenharmony_ci 569d95e75fdSopenharmony_ci /** 570d95e75fdSopenharmony_ci * Is Phone Gsm Type 571d95e75fdSopenharmony_ci * 572d95e75fdSopenharmony_ci * @param slotId 573d95e75fdSopenharmony_ci * @return bool 574d95e75fdSopenharmony_ci */ 575d95e75fdSopenharmony_ci bool PhoneTypeGsmOrNot(int32_t slotId); 576d95e75fdSopenharmony_ci 577d95e75fdSopenharmony_ci /** 578d95e75fdSopenharmony_ci * Confirm if need use IMS handle first 579d95e75fdSopenharmony_ci * 580d95e75fdSopenharmony_ci * @param slotId 581d95e75fdSopenharmony_ci * @return bool 582d95e75fdSopenharmony_ci */ 583d95e75fdSopenharmony_ci bool NeedUseImsToHandle(int32_t slotId); 584d95e75fdSopenharmony_ci 585d95e75fdSopenharmony_ci /** 586d95e75fdSopenharmony_ci * Get Message 587d95e75fdSopenharmony_ci * 588d95e75fdSopenharmony_ci * @param MmiCodeInfo 589d95e75fdSopenharmony_ci * @param SsNoticeInfo 590d95e75fdSopenharmony_ci */ 591d95e75fdSopenharmony_ci void GetMessage(MmiCodeInfo &mmiCodeInfo, const SsNoticeInfo &ssNoticeInfo); 592d95e75fdSopenharmony_ci 593d95e75fdSopenharmony_ciprivate: 594d95e75fdSopenharmony_ci void BuildCallForwardQueryInfo(const CallForwardQueryResult &queryResult, const std::string &message, int32_t flag); 595d95e75fdSopenharmony_ci void ReportMmiCodeMessage(int32_t result, const std::string successMsg, const std::string failedMsg); 596d95e75fdSopenharmony_ci bool IsVaildPinOrPuk(std::string newPinOrPuk, std::string newPinOrPukCheck); 597d95e75fdSopenharmony_ci 598d95e75fdSopenharmony_ciprivate: 599d95e75fdSopenharmony_ci SupplementRequestCs supplementRequestCs_; 600d95e75fdSopenharmony_ci SupplementRequestIms supplementRequestIms_; 601d95e75fdSopenharmony_ci ModuleServiceUtils moduleServiceUtils_; 602d95e75fdSopenharmony_ci}; 603d95e75fdSopenharmony_ci} // namespace Telephony 604d95e75fdSopenharmony_ci} // namespace OHOS 605d95e75fdSopenharmony_ci#endif // CELLULAR_CALL_SUPPLEMENT_H 606