1 /* 2 * Copyright (C) 2021 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 BLUETOOTH_CALL_TEST_H 17 #define BLUETOOTH_CALL_TEST_H 18 19 #include <map> 20 21 #include "accesstoken_kit.h" 22 #include "token_setproc.h" 23 24 namespace OHOS { 25 namespace Telephony { 26 enum class BluetoothCallFuncCode { 27 TEST_DIAL = 0, 28 TEST_ANSWER, 29 TEST_REJECT, 30 TEST_HANGUP, 31 TEST_GET_CALL_STATE, 32 TEST_HOLD, 33 TEST_UNHOLD, 34 TEST_SWITCH, 35 TEST_COMBINE_CONFERENCE, 36 TEST_SEPARATE_CONFERENCE, 37 TEST_START_DTMF, 38 TEST_STOP_DTMF, 39 TEST_IS_RINGING, 40 TEST_HAS_CALL, 41 TEST_IS_NEW_CALL_ALLOWED, 42 TEST_IS_IN_EMERGENCY_CALL, 43 TEST_SET_MUTED, 44 TEST_MUTE_RINGER, 45 TEST_SET_AUDIO_DEVICE, 46 TEST_GET_CURRENT_CALL_LIST, 47 TEST_KICK_OUT_CONFERENCE, 48 }; 49 50 class BluetoothCallTest { 51 public: 52 BluetoothCallTest() = default; 53 ~BluetoothCallTest() = default; 54 int32_t Init(); 55 void RunBluetoothCallTest(); 56 57 private: 58 void PrintfUsage(); 59 void InitFunMap(); 60 using BluetoothCallFunc = void (BluetoothCallTest::*)(); 61 62 void DialCall(); 63 void AnswerCall(); 64 void RejectCall(); 65 void HangUpCall(); 66 void GetCallState(); 67 void HoldCall(); 68 void UnHoldCall(); 69 void SwitchCall(); 70 void CombineConference(); 71 void SeparateConference(); 72 void KickOutFromConference(); 73 void StartDtmf(); 74 void StopDtmf(); 75 void IsRinging(); 76 void HasCall(); 77 void IsNewCallAllowed(); 78 void IsInEmergencyCall(); 79 void SetMute(); 80 void MuteRinger(); 81 void SetAudioDevice(); 82 void GetCurrentCallList(); 83 84 std::map<uint32_t, BluetoothCallFunc> memberFuncMap_; 85 }; 86 } // namespace Telephony 87 } // namespace OHOS 88 #endif // CALL_MANAGER_CALLBACK_TEST_H 89