1 /*
2  * Copyright (C) 2023 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 NETWORK_SEARCH_INCLUDE_NR_SSB_INFO_H
17 #define NETWORK_SEARCH_INCLUDE_NR_SSB_INFO_H
18 
19 #include "event_handler.h"
20 #include "tel_ril_network_parcel.h"
21 #include "nr_ssb_information.h"
22 
23 namespace OHOS {
24 namespace Telephony {
25 class NetworkSearchManager;
26 class NrSsbInfo {
27 public:
28     NrSsbInfo(std::weak_ptr<NetworkSearchManager> networkSearchManager, int32_t slotId);
29     virtual ~NrSsbInfo() = default;
30     bool FillNrSsbIdInformation(const std::shared_ptr<NrSsbInformation> &nrCellSsbIdsInfo);
31     bool ProcessGetNrSsbId(const AppExecFwk::InnerEvent::Pointer &event);
32 
33 private:
34     bool UpdateNrSsbIdInfo(int32_t slotId, std::shared_ptr<NrCellSsbIds> nrCellSsbIds);
35     std::mutex mutex_;
36     std::shared_ptr<NrCellSsbInfo> nrCellSsbIdsInfo_ = nullptr;
37     std::weak_ptr<NetworkSearchManager> networkSearchManager_;
38 
39     int32_t slotId_ = 0;
40 };
41 } // namespace Telephony
42 } // namespace OHOS
43 #endif // NETWORK_SEARCH_INCLUDE_NR_SSB_INFO_H