• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 OHOS_ROSEN_SINGLE_DISPLAY_FOLD_STATE_SENSOR_MANAGER_H
17 #define OHOS_ROSEN_SINGLE_DISPLAY_FOLD_STATE_SENSOR_MANAGER_H
18 
19 #include "dm_common.h"
20 #include "fold_screen_controller/fold_screen_policy.h"
21 #include "fold_screen_controller/sensor_fold_state_manager/sensor_fold_state_manager.h"
22 
23 namespace OHOS {
24 namespace Rosen {
25 class SingleDisplaySensorFoldStateManager : public SensorFoldStateManager {
26 public:
27     SingleDisplaySensorFoldStateManager();
28     virtual ~SingleDisplaySensorFoldStateManager();
29 
30     void HandleAngleChange(float angle, int hall, sptr<FoldScreenPolicy> foldScreenPolicy) override;
31     void HandleHallChange(float angle, int hall, sptr<FoldScreenPolicy> foldScreenPolicy) override;
32     void RegisterApplicationStateObserver() override;
33 
34 private:
35     FoldStatus GetNextFoldState(float angle, int hall);
36     void UpdateSwitchScreenBoundaryForLargeFoldDevice(float, int);
37     int allowUserSensorForLargeFoldDevice = 0;
38 };
39 } // namespace Rosen
40 } // namespace OHOS
41 #endif