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#ifndef FOLD_STATUS_MANAGER 17#define FOLD_STATUS_MANAGER 18 19#include "singleton.h" 20#include "display_manager.h" 21#include "display_info.h" 22 23namespace OHOS { 24namespace Telephony { 25class FoldStatusManager { 26 DECLARE_DELAYED_SINGLETON(FoldStatusManager) 27public: 28 void RegisterFoldableListener(); 29 void UnregisterFoldableListener(); 30 static bool IsSmallFoldDevice(); 31 class FoldStatusListener : public Rosen::DisplayManager::IFoldStatusListener { 32 public: 33 FoldStatusListener() = default; 34 ~FoldStatusListener() override = default; 35 DISALLOW_COPY_AND_MOVE(FoldStatusListener); 36 37 /** 38 * @param FoldStatus uint32_t; UNKNOWN = 0, EXPAND = 1, FOLDED = 2, HALF_FOLD = 3; 39 */ 40 void OnFoldStatusChanged(Rosen::FoldStatus foldStatus) override; 41 }; 42 43 Rosen::FoldStatus mOldFoldStatus; 44 45private: 46 sptr<Rosen::DisplayManager::IFoldStatusListener> foldStatusListener_; 47}; 48} // namespace Telephony 49} // namespace OHOS 50#endif // TELEPHONY_DISTRIBUTED_CALL_MANAGER_H 51