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 #include "window_manager_lite.h" 17 18 #include <algorithm> 19 #include <cinttypes> 20 21 #include "marshalling_helper.h" 22 #include "window_adapter_lite.h" 23 #include "window_manager_hilog.h" 24 #include "wm_common.h" 25 #include "i_window_checker.h" 26 #include "singleton_delegator.h" 27 28 29 namespace OHOS { 30 namespace Rosen { 31 namespace { 32 constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "WindowManagerLite"}; 33 } 34 WM_IMPLEMENT_SINGLE_INSTANCE(WindowManagerLite)35WM_IMPLEMENT_SINGLE_INSTANCE(WindowManagerLite) 36 37 WindowManagerLite::WindowManagerLite() 38 { 39 } 40 ~WindowManagerLite()41WindowManagerLite::~WindowManagerLite() 42 { 43 std::lock_guard<std::recursive_mutex> lock(mutex_); 44 destroyed_ = true; 45 } 46 GetFocusWindowInfo(FocusChangeInfo & focusInfo)47void WindowManagerLite::GetFocusWindowInfo(FocusChangeInfo& focusInfo) 48 { 49 WLOGFI("Get Focus window info lite"); 50 SingletonContainer::Get<WindowAdapterLite>().GetFocusWindowInfo(focusInfo); 51 } 52 OnRemoteDied()53void WindowManagerLite::OnRemoteDied() 54 { 55 WLOGI("wms is died"); 56 std::lock_guard<std::recursive_mutex> lock(mutex_); 57 if (destroyed_) { 58 WLOGE("Already destroyed"); 59 return; 60 } 61 } 62 63 } // namespace Rosen 64 } // namespace OHOS 65