mirror of
https://gitee.com/openharmony/window_window_manager
synced 2024-11-27 00:51:35 +00:00
commit
78c0b82e75
@ -53,7 +53,7 @@ public:
|
||||
|
||||
FoldStatus MatchSuperFoldStatusToFoldStatus(SuperFoldStatus superFoldStatus);
|
||||
private:
|
||||
std::atomic<SuperFoldStatus> curState_ = SuperFoldStatus::HALF_FOLDED;
|
||||
std::atomic<SuperFoldStatus> curState_ = SuperFoldStatus::UNKNOWN;
|
||||
|
||||
struct Transition {
|
||||
SuperFoldStatus nextState;
|
||||
@ -75,8 +75,6 @@ private:
|
||||
|
||||
static void DoFoldedToHalfFolded(SuperFoldStatusChangeEvents event);
|
||||
|
||||
static void DoExpandedToKeyboard(SuperFoldStatusChangeEvents event);
|
||||
|
||||
void SetCurrentStatus(SuperFoldStatus curState);
|
||||
|
||||
void HandleDisplayNotify(SuperFoldStatusChangeEvents changeEvent);
|
||||
|
@ -102,8 +102,8 @@ void SuperFoldSensorManager::RegisterHallCallback()
|
||||
|
||||
void SuperFoldSensorManager::UnregisterHallCallback()
|
||||
{
|
||||
int32_t deactivateRet = DeactivateSensor(SENSOR_TYPE_ID_HALL_EXT, &hallUser);
|
||||
int32_t unsubscribeRet = UnsubscribeSensor(SENSOR_TYPE_ID_HALL_EXT, &hallUser);
|
||||
int32_t deactivateRet = DeactivateSensor(SENSOR_TYPE_ID_HALL, &hallUser);
|
||||
int32_t unsubscribeRet = UnsubscribeSensor(SENSOR_TYPE_ID_HALL, &hallUser);
|
||||
if (deactivateRet == SENSOR_SUCCESS && unsubscribeRet == SENSOR_SUCCESS) {
|
||||
TLOGI(WmsLogTag::DMS, "UnRegisterHallCallback success.");
|
||||
}
|
||||
|
@ -110,11 +110,6 @@ void SuperFoldStateManager::DoFoldedToHalfFolded(SuperFoldStatusChangeEvents eve
|
||||
TLOGI(WmsLogTag::DMS, "SuperFoldStateManager::DoFoldedToHalfFolded()");
|
||||
}
|
||||
|
||||
void SuperFoldStateManager::DoExpandedToKeyboard(SuperFoldStatusChangeEvents event)
|
||||
{
|
||||
TLOGI(WmsLogTag::DMS, "SuperFoldStateManager::DoExpandedToKeyboard()");
|
||||
}
|
||||
|
||||
SuperFoldStateManager::SuperFoldStateManager()
|
||||
{
|
||||
AddStateManagerMap(SuperFoldStatus::HALF_FOLDED,
|
||||
@ -142,15 +137,31 @@ SuperFoldStateManager::SuperFoldStateManager()
|
||||
SuperFoldStatus::KEYBOARD,
|
||||
&SuperFoldStateManager::DoKeyboardOn);
|
||||
|
||||
AddStateManagerMap(SuperFoldStatus::EXPANDED,
|
||||
SuperFoldStatusChangeEvents::KEYBOARD_ON,
|
||||
SuperFoldStatus::HALF_FOLDED,
|
||||
&SuperFoldStateManager::DoExpandedToKeyboard);
|
||||
|
||||
AddStateManagerMap(SuperFoldStatus::KEYBOARD,
|
||||
SuperFoldStatusChangeEvents::KEYBOARD_OFF,
|
||||
SuperFoldStatus::HALF_FOLDED,
|
||||
&SuperFoldStateManager::DoKeyboardOff);
|
||||
|
||||
// 开机状态自检
|
||||
AddStateManagerMap(SuperFoldStatus::UNKNOWN,
|
||||
SuperFoldStatusChangeEvents::KEYBOARD_ON,
|
||||
SuperFoldStatus::KEYBOARD,
|
||||
[&](SuperFoldStatusChangeEvents events) {});
|
||||
|
||||
AddStateManagerMap(SuperFoldStatus::UNKNOWN,
|
||||
SuperFoldStatusChangeEvents::ANGLE_CHANGE_HALF_FOLDED,
|
||||
SuperFoldStatus::HALF_FOLDED,
|
||||
[&](SuperFoldStatusChangeEvents events) {});
|
||||
|
||||
AddStateManagerMap(SuperFoldStatus::UNKNOWN,
|
||||
SuperFoldStatusChangeEvents::ANGLE_CHANGE_EXPANDED,
|
||||
SuperFoldStatus::EXPANDED,
|
||||
[&](SuperFoldStatusChangeEvents events) {});
|
||||
|
||||
AddStateManagerMap(SuperFoldStatus::UNKNOWN,
|
||||
SuperFoldStatusChangeEvents::ANGLE_CHANGE_FOLDED,
|
||||
SuperFoldStatus::FOLDED,
|
||||
[&](SuperFoldStatusChangeEvents events) {});
|
||||
}
|
||||
|
||||
SuperFoldStateManager::~SuperFoldStateManager() = default;
|
||||
|
Loading…
Reference in New Issue
Block a user