• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 CELLULAR_CALL_MODULE_SERVICE_UTILS_H
17 #define CELLULAR_CALL_MODULE_SERVICE_UTILS_H
18 
19 #include "iservice_registry.h"
20 #include "singleton.h"
21 
22 #include "ims_call_interface.h"
23 #include "network_state.h"
24 
25 namespace OHOS {
26 namespace Telephony {
27 class ModuleServiceUtils : public std::enable_shared_from_this<ModuleServiceUtils> {
28 public:
29     /**
30      * Get Cs Radio state
31      *
32      * @param slotId
33      * @return bool
34      */
35     bool GetRadioState(int32_t slotId);
36 
37     /**
38      * Get Network State
39      *
40      * @param slotId
41      * @return Network State
42      */
43     PhoneType GetNetworkStatus(int32_t slotId);
44 
45     /**
46      * Get Iso Country Code
47      *
48      * @param slotId
49      * @return Iso Country Code
50      */
51     std::string GetIsoCountryCode(int32_t slotId);
52 
53     /**
54      * Get net work Country Code
55      *
56      * @param slotId
57      * @return Network Country Code
58      */
59     std::string GetNetworkCountryCode(int32_t slotId);
60 
61     /**
62      * Get IMS Domain Registration State
63      *
64      * @param slotId
65      * @return Whether to register
66      */
67     bool GetImsRegistrationState(int32_t slotId);
68 
69     /**
70      * Confirm IMS support UT or not
71      *
72      * @param slotId
73      * @return bool
74      */
75     bool GetImsUtSupportState(int32_t slotId);
76 
77     /**
78      * Get slot info
79      *
80      * @return slot id
81      */
82     std::vector<int32_t> GetSlotInfo();
83 
84     /**
85      * Need to call ImsService
86      *
87      * @return bool
88      */
89     bool NeedCallImsService() const;
90 
91     /**
92      * Get ImsService Remote Object
93      *
94      * @return sptr<ImsInterface>
95      */
96     sptr<ImsCallInterface> GetImsServiceRemoteObject() const;
97 
98     int32_t GetAirplaneMode(bool &airplaneModeOn);
99 
100     int32_t UpdateRadioOn(int32_t slotId);
101 
102     RegServiceState GetCsRegState(int32_t slotId);
103 
104     RegServiceState GetPsRegState(int32_t slotId);
105 };
106 } // namespace Telephony
107 } // namespace OHOS
108 #endif // CELLULAR_CALL_MODULE_SERVICE_UTILS_H
109