aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2024-02-12 17:49:15 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2024-02-12 17:49:15 +0000
commitcf75f4c5a7daf754c8a2b766d3b231093f98b4c4 (patch)
tree56c9356ab2fd03ab2f62a6f62d033cde9409cc99
parentae18ec7bd48e59edbb126cfa1050e673b2927f50 (diff)
parent2aa4c0f7608811412b864b43bb2c0a5b358d7137 (diff)
downloadqemu-emu-33-dev.tar.gz
Merge "foldabe: fix embeded and console mode fold and unfold" into emu-33-devemu-33-dev
-rw-r--r--android/android-ui/modules/aemu-ui-qt/src/android/skin/qt/tool-window.cpp13
-rw-r--r--android/android-ui/modules/aemu-ui-qt/src/android/skin/qt/tool-window.h2
2 files changed, 9 insertions, 6 deletions
diff --git a/android/android-ui/modules/aemu-ui-qt/src/android/skin/qt/tool-window.cpp b/android/android-ui/modules/aemu-ui-qt/src/android/skin/qt/tool-window.cpp
index c9591472ab..835e592053 100644
--- a/android/android-ui/modules/aemu-ui-qt/src/android/skin/qt/tool-window.cpp
+++ b/android/android-ui/modules/aemu-ui-qt/src/android/skin/qt/tool-window.cpp
@@ -898,6 +898,7 @@ void ToolWindow::handleUICommand(QtUICommand cmd,
sUiEmuAgent->sensors->getPhysicalParameter(
PHYSICAL_PARAMETER_POSTURE, &out, 1,
PARAMETER_VALUE_TYPE_CURRENT);
+ applyFoldableQuirk((enum FoldablePostures)posture);
switch ((enum FoldablePostures)posture) {
case POSTURE_OPENED:
ChangeIcon(mToolsUi->change_posture_button,
@@ -1748,20 +1749,20 @@ void ToolWindow::hideRotationButton(bool hide) {
}
}
-void ToolWindow::on_new_posture_requested(int newPosture) {
- if (mLastRequestedFoldablePosture == -1) {
- mLastRequestedFoldablePosture = android_foldable_get_posture();
- }
- mEmulatorWindow->activateWindow();
+void ToolWindow::applyFoldableQuirk(int newPosture) {
const bool is_pixel_fold = android_foldable_is_pixel_fold();
if (is_pixel_fold) {
if (newPosture > 1 && mLastRequestedFoldablePosture == 1 ||
newPosture == 1 && mLastRequestedFoldablePosture > 1) {
startSleepTimer();
}
-
}
mLastRequestedFoldablePosture = newPosture;
+}
+
+void ToolWindow::on_new_posture_requested(int newPosture) {
+ mEmulatorWindow->activateWindow();
+ applyFoldableQuirk(newPosture);
handleUICommand(QtUICommand::CHANGE_FOLDABLE_POSTURE, true);
}
diff --git a/android/android-ui/modules/aemu-ui-qt/src/android/skin/qt/tool-window.h b/android/android-ui/modules/aemu-ui-qt/src/android/skin/qt/tool-window.h
index 9b38b581df..6b4577ba4f 100644
--- a/android/android-ui/modules/aemu-ui-qt/src/android/skin/qt/tool-window.h
+++ b/android/android-ui/modules/aemu-ui-qt/src/android/skin/qt/tool-window.h
@@ -231,6 +231,8 @@ private:
void startSleepTimer();
+ void applyFoldableQuirk(int newPosture);
+
public slots:
void raise();
void switchClipboardSharing(bool enabled);