1 /* 2 * Copyright (C) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef CALL_SETTING_MANAGER_H 17 #define CALL_SETTING_MANAGER_H 18 19 #include <cstring> 20 #include <memory> 21 22 #include "pac_map.h" 23 24 #include "cellular_call_connection.h" 25 26 namespace OHOS { 27 namespace Telephony { 28 class CallSettingManager { 29 public: 30 CallSettingManager(); 31 ~CallSettingManager(); 32 33 int32_t GetCallWaiting(int32_t slotId); 34 int32_t SetCallWaiting(int32_t slotId, bool activate); 35 int32_t GetCallRestriction(int32_t slotId, CallRestrictionType type); 36 int32_t SetCallRestriction(int32_t slotId, CallRestrictionInfo &info); 37 int32_t SetCallRestrictionPassword( 38 int32_t slotId, CallRestrictionType fac, const char *oldPassword, const char *newPassword); 39 int32_t GetCallTransferInfo(int32_t slotId, CallTransferType type); 40 int32_t SetCallTransferInfo(int32_t slotId, CallTransferInfo &info); 41 int32_t CanSetCallTransferTime(int32_t slotId, bool &result); 42 int32_t SetCallPreferenceMode(int32_t slotId, int32_t mode); 43 int32_t GetImsConfig(int32_t slotId, ImsConfigItem item); 44 int32_t SetImsConfig(int32_t slotId, ImsConfigItem item, std::u16string &value); 45 int32_t GetImsFeatureValue(int32_t slotId, FeatureType type); 46 int32_t SetImsFeatureValue(int32_t slotId, FeatureType type, int32_t value); 47 int32_t EnableImsSwitch(int32_t slotId); 48 int32_t DisableImsSwitch(int32_t slotId); 49 int32_t IsImsSwitchEnabled(int32_t slotId, bool &enabled); 50 int32_t SetVoNRState(int32_t slotId, int32_t state); 51 int32_t GetVoNRState(int32_t slotId, int32_t &state); 52 int32_t CloseUnFinishedUssd(int32_t slotId); 53 54 private: 55 int32_t CallWaitingPolicy(int32_t slotId); 56 int32_t GetCallRestrictionPolicy(int32_t slotId, CallRestrictionType type); 57 int32_t SetCallRestrictionPolicy(int32_t slotId, CallRestrictionInfo &info); 58 int32_t GetCallTransferInfoPolicy(int32_t slotId, CallTransferType type); 59 int32_t SetCallTransferInfoPolicy(int32_t slotId, CallTransferInfo &info); 60 int32_t CloseUnFinishedUssdPolicy(int32_t slotId); 61 62 private: 63 std::shared_ptr<CellularCallConnection> cellularCallConnectionPtr_; 64 }; 65 } // namespace Telephony 66 } // namespace OHOS 67 #endif // CALL_SETTING_MANAGER_H 68