• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025-2026 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 OHOS_TELEPHONYEXT_STATE_UTILS_H
17 #define OHOS_TELEPHONYEXT_STATE_UTILS_H
18 
19 #include <list>
20 #include <string>
21 #include "cellular_data_client.h"
22 #include "event_handler.h"
23 #include "signal_information.h"
24 #include "network_search_types.h"
25 #include "core_manager_inner.h"
26 
27 namespace OHOS::NetManagerStandard {
28 static constexpr int32_t DEFAULT_SLOT = 0;
29 class StateUtils final {
30 public:
31     StateUtils() = default;
32     ~StateUtils() = default;
33 
34     static int64_t GetNowMilliSeconds();
35     static int64_t GetCurrentSysTimeMs();
36     static int32_t GetDefaultSlotId();
37     static int32_t GetPrimarySlotId();
38     static int32_t GetSlaveCardSlotId();
39     static bool IsValidSlotId(int32_t slotId);
40     static bool IsRoaming(int32_t slotId);
41     static int32_t GetModemIdBySlotId(int32_t slotId);
42     static int32_t GetSlotIdByModemId(int32_t modemId);
43 };
44 }
45 #endif
46