• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 };
48 
49 class BluetoothCallTest {
50 public:
51     BluetoothCallTest() = default;
52     ~BluetoothCallTest() = default;
53     int32_t Init();
54     void RunBluetoothCallTest();
55 
56 private:
57     void PrintfUsage();
58     void InitFunMap();
59     using BluetoothCallFunc = void (BluetoothCallTest::*)();
60 
61     void DialCall();
62     void AnswerCall();
63     void RejectCall();
64     void HangUpCall();
65     void GetCallState();
66     void HoldCall();
67     void UnHoldCall();
68     void SwitchCall();
69     void CombineConference();
70     void SeparateConference();
71     void StartDtmf();
72     void StopDtmf();
73     void IsRinging();
74     void HasCall();
75     void IsNewCallAllowed();
76     void IsInEmergencyCall();
77     void SetMute();
78     void MuteRinger();
79     void SetAudioDevice();
80     void GetCurrentCallList();
81 
82     std::map<uint32_t, BluetoothCallFunc> memberFuncMap_;
83 };
84 } // namespace Telephony
85 } // namespace OHOS
86 #endif // CALL_MANAGER_CALLBACK_TEST_H
87