summaryrefslogtreecommitdiff
path: root/emulator
diff options
context:
space:
mode:
authorSergey Prigogin <sprigogin@google.com>2022-02-15 18:23:36 -0800
committerSergey Prigogin <sprigogin@google.com>2022-02-17 00:21:15 +0000
commit839f73ea5b92630585c996e06eb43e525cdd424b (patch)
treeca65c909a20a2531ea5519a18ce8e157d15ad4d9 /emulator
parentfcd33100bbbcffb7653e5574a539b33f06bc4886 (diff)
downloadidea-839f73ea5b92630585c996e06eb43e525cdd424b.tar.gz
Turn off "Auto-rotate screen" while mirroring
Test: later Bug: N/A Change-Id: I7c38872de4c250919074bd7b251b37414eb50379
Diffstat (limited to 'emulator')
-rw-r--r--emulator/screen-sharing-agent/app/src/main/cpp/controller.cc5
-rw-r--r--emulator/screen-sharing-agent/app/src/main/cpp/controller.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/emulator/screen-sharing-agent/app/src/main/cpp/controller.cc b/emulator/screen-sharing-agent/app/src/main/cpp/controller.cc
index 0f06f6bb77c..61e9768087f 100644
--- a/emulator/screen-sharing-agent/app/src/main/cpp/controller.cc
+++ b/emulator/screen-sharing-agent/app/src/main/cpp/controller.cc
@@ -56,7 +56,8 @@ Controller::Controller(int socket_fd)
pointer_helper_(),
motion_event_start_time_(0),
key_character_map_(),
- stay_on_(Settings::Table::GLOBAL, "stay_on_while_plugged_in") {
+ stay_on_(Settings::Table::GLOBAL, "stay_on_while_plugged_in"),
+ accelerometer_rotation_(Settings::Table::SYSTEM, "accelerometer_rotation") {
assert(socket_fd > 0);
}
@@ -105,6 +106,8 @@ void Controller::Initialize() {
// Keep the screen on as long as the device has power.
stay_on_.Set(StringPrintf("%d", BATTERY_PLUGGED_AC | BATTERY_PLUGGED_USB | BATTERY_PLUGGED_WIRELESS).c_str());
+ // Turn off "Auto-rotate screen".
+ accelerometer_rotation_.Set("0");
}
void Controller::Run() {
diff --git a/emulator/screen-sharing-agent/app/src/main/cpp/controller.h b/emulator/screen-sharing-agent/app/src/main/cpp/controller.h
index bcecee7df5d..cf15c4d25b5 100644
--- a/emulator/screen-sharing-agent/app/src/main/cpp/controller.h
+++ b/emulator/screen-sharing-agent/app/src/main/cpp/controller.h
@@ -60,6 +60,7 @@ private:
int64_t motion_event_start_time_;
KeyCharacterMap* key_character_map_;
ScopedSetting stay_on_;
+ ScopedSetting accelerometer_rotation_;
DISALLOW_COPY_AND_ASSIGN(Controller);
};