1c7afe287Sopenharmony_ci/*
2c7afe287Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd.
3c7afe287Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4c7afe287Sopenharmony_ci * you may not use this file except in compliance with the License.
5c7afe287Sopenharmony_ci * You may obtain a copy of the License at
6c7afe287Sopenharmony_ci *
7c7afe287Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0
8c7afe287Sopenharmony_ci *
9c7afe287Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10c7afe287Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11c7afe287Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12c7afe287Sopenharmony_ci * See the License for the specific language governing permissions and
13c7afe287Sopenharmony_ci * limitations under the License.
14c7afe287Sopenharmony_ci */
15c7afe287Sopenharmony_ci
16c7afe287Sopenharmony_ci#ifndef OHOS_CLOUD_OAID_REMOTE_CONFIG_OBSERVER_MANAGER_H
17c7afe287Sopenharmony_ci#define OHOS_CLOUD_OAID_REMOTE_CONFIG_OBSERVER_MANAGER_H
18c7afe287Sopenharmony_ci
19c7afe287Sopenharmony_ci#include <shared_mutex>
20c7afe287Sopenharmony_ci
21c7afe287Sopenharmony_ci#include "singleton.h"
22c7afe287Sopenharmony_ci#include "oaid_iremote_config_observer.h"
23c7afe287Sopenharmony_ci
24c7afe287Sopenharmony_cinamespace OHOS {
25c7afe287Sopenharmony_cinamespace Cloud {
26c7afe287Sopenharmony_ciclass OaidObserverManager {
27c7afe287Sopenharmony_ci    DECLARE_DELAYED_SINGLETON(OaidObserverManager)
28c7afe287Sopenharmony_cipublic:
29c7afe287Sopenharmony_ci    int32_t RegisterObserver(const sptr<IRemoteConfigObserver>& observer);
30c7afe287Sopenharmony_ci
31c7afe287Sopenharmony_ci    void OnUpdateOaid(const std::string& oaid);
32c7afe287Sopenharmony_ci
33c7afe287Sopenharmony_ciprivate:
34c7afe287Sopenharmony_ci   sptr<IRemoteConfigObserver> observer_;
35c7afe287Sopenharmony_ci   std::shared_mutex observerMutex_;
36c7afe287Sopenharmony_ci};
37c7afe287Sopenharmony_ci} // namespace HaCloud
38c7afe287Sopenharmony_ci} // namespace OHOS
39c7afe287Sopenharmony_ci#endif // OHOS_CLOUD_HA_REMOTE_CONFIG_OBSERVER_MANAGER_H