1 /* 2 * Copyright (c) 2024 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 #define LOG_TAG "ScreenManager" 17 #include "screen/screen_manager.h" 18 19 #include "log_print.h" 20 21 namespace OHOS::DistributedData { 22 std::mutex ScreenManager::mutex_; 23 std::shared_ptr<ScreenManager> ScreenManager::instance_ = nullptr; GetInstance()24std::shared_ptr<ScreenManager> ScreenManager::GetInstance() 25 { 26 std::lock_guard<decltype(mutex_)> lock(mutex_); 27 if (instance_ != nullptr) { 28 return instance_; 29 } 30 instance_ = std::make_shared<ScreenManager>(); 31 ZLOGW("no register, new instance!"); 32 return instance_; 33 } 34 RegisterInstance(std::shared_ptr<ScreenManager> instance)35bool ScreenManager::RegisterInstance(std::shared_ptr<ScreenManager> instance) 36 { 37 std::lock_guard<decltype(mutex_)> lock(mutex_); 38 instance_ = std::move(instance); 39 return true; 40 } 41 Subscribe(std::shared_ptr<Observer> observer)42void ScreenManager::Subscribe(std::shared_ptr<Observer> observer) 43 { 44 return; 45 } 46 Unsubscribe(std::shared_ptr<Observer> observer)47void ScreenManager::Unsubscribe(std::shared_ptr<Observer> observer) 48 { 49 return; 50 } 51 BindExecutor(std::shared_ptr<ExecutorPool> executors)52void ScreenManager::BindExecutor(std::shared_ptr<ExecutorPool> executors) 53 { 54 return; 55 } 56 SubscribeScreenEvent()57void ScreenManager::SubscribeScreenEvent() 58 { 59 return; 60 } 61 UnsubscribeScreenEvent()62void ScreenManager::UnsubscribeScreenEvent() 63 { 64 return; 65 } 66 IsLocked()67bool ScreenManager::IsLocked() 68 { 69 return false; 70 } 71 } // namespace OHOS::DistributedData