mirror of
https://gitee.com/openharmony/window_window_manager
synced 2025-02-17 14:30:02 +00:00
commit
2ee13cd5f0
@ -5379,7 +5379,7 @@ void ScreenSessionManager::ScbStatusRecoveryWhenSwitchUser(std::vector<int32_t>
|
||||
TLOGE(WmsLogTag::DMS, "unsupport foldStatus: %{public}u", foldStatus);
|
||||
}
|
||||
} else {
|
||||
screenSession->UpdateRotationAfterBoot(true);
|
||||
screenSession->UpdateValidRotationToScb();
|
||||
}
|
||||
auto task = [=] {
|
||||
clientProxy_->SwitchUserCallback(oldScbPids, newScbPid);
|
||||
|
@ -233,6 +233,7 @@ public:
|
||||
bool UpdateAvailableArea(DMRect area);
|
||||
void SetFoldScreen(bool isFold);
|
||||
void UpdateRotationAfterBoot(bool foldToExpand);
|
||||
void UpdateValidRotationToScb();
|
||||
std::shared_ptr<Media::PixelMap> GetScreenSnapshot(float scaleX, float scaleY);
|
||||
void SetDefaultDeviceRotationOffset(uint32_t defaultRotationOffset);
|
||||
|
||||
@ -258,6 +259,7 @@ private:
|
||||
std::function<void(float, float)> updateScreenPivotCallback_ = nullptr;
|
||||
bool isFold_ = false;
|
||||
float currentSensorRotation_ { -1.0f };
|
||||
float currentValidSensorRotation_ { -1.0f };
|
||||
std::vector<uint32_t> hdrFormats_;
|
||||
std::vector<uint32_t> colorSpaces_;
|
||||
MirrorScreenType mirrorScreenType_ { MirrorScreenType::VIRTUAL_MIRROR };
|
||||
|
@ -480,8 +480,9 @@ void ScreenSession::SensorRotationChange(Rotation sensorRotation)
|
||||
void ScreenSession::SensorRotationChange(float sensorRotation)
|
||||
{
|
||||
if (sensorRotation >= 0.0f) {
|
||||
currentSensorRotation_ = sensorRotation;
|
||||
currentValidSensorRotation_ = sensorRotation;
|
||||
}
|
||||
currentSensorRotation_ = sensorRotation;
|
||||
for (auto& listener : screenChangeListenerList_) {
|
||||
listener->OnSensorRotationChange(sensorRotation, screenId_);
|
||||
}
|
||||
@ -677,6 +678,12 @@ void ScreenSession::UpdateRotationAfterBoot(bool foldToExpand)
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenSession::UpdateValidRotationToScb()
|
||||
{
|
||||
TLOGI(WmsLogTag::DMS, "Rotation: %{public}f", currentValidSensorRotation_);
|
||||
SensorRotationChange(currentValidSensorRotation_);
|
||||
}
|
||||
|
||||
sptr<SupportedScreenModes> ScreenSession::GetActiveScreenMode() const
|
||||
{
|
||||
if (activeIdx_ < 0 || activeIdx_ >= static_cast<int32_t>(modes_.size())) {
|
||||
|
@ -497,6 +497,25 @@ HWTEST_F(ScreenSessionTest, UpdateRotationAfterBoot02, Function | SmallTest | Le
|
||||
GTEST_LOG_(INFO) << "UpdateRotationAfterBoot end";
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: UpdateValidRotationToScb
|
||||
* @tc.desc: normal function
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(ScreenSessionTest, UpdateValidRotationToScb, Function | SmallTest | Level2)
|
||||
{
|
||||
GTEST_LOG_(INFO) << "UpdateValidRotationToScb start";
|
||||
ScreenSessionConfig config = {
|
||||
.screenId = 100,
|
||||
.rsId = 101,
|
||||
.name = "OpenHarmony",
|
||||
};
|
||||
sptr<ScreenSession> screenSession = new ScreenSession(config, ScreenSessionReason::CREATE_SESSION_FOR_VIRTUAL);
|
||||
EXPECT_NE(nullptr, screenSession);
|
||||
screenSession->UpdateValidRotationToScb();
|
||||
GTEST_LOG_(INFO) << "UpdateValidRotationToScb end";
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: SetScreenSceneDpiChangeListener
|
||||
* @tc.desc: normal function
|
||||
|
Loading…
x
Reference in New Issue
Block a user