summaryrefslogtreecommitdiff
path: root/libs/input/PointerController.cpp
diff options
context:
space:
mode:
author Prabir Pradhan <prabirmsp@google.com> 2024-02-26 21:27:31 +0000
committer Prabir Pradhan <prabirmsp@google.com> 2024-02-26 21:27:31 +0000
commit453e1631c492ff561b3602e03cd3d246131db361 (patch)
treee32b86344d0d2ed420cbc36331ef48ba090fd2ea /libs/input/PointerController.cpp
parent6f918e27d07788d9786029e4961f72fd0bfb9720 (diff)
Read pointer choreographer flag at boot
In native code, we are sometimes reading the enable_pointer_choreographer flag value at boot, and sometimes later during runtime. Since DeviceConfig flag values can change at runtime, the flag values loaded later can sometimes change, resulting in an unexpected state where some code relies on the boot-time value and others on the "current" value. While we should have been using read-only flags in the first place, we cannot convert existing flags to be read-only. So to increase consistency within native code, change all reads of the enable_pointer_choreographer flag to happen at boot. Bug: 324534774 Test: Presubmit Change-Id: Id31496d987e2647fc1176dbdbba67bd6e4443aa1
Diffstat (limited to 'libs/input/PointerController.cpp')
-rw-r--r--libs/input/PointerController.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/input/PointerController.cpp b/libs/input/PointerController.cpp
index f84107e8792c..f9dc5fac7e21 100644
--- a/libs/input/PointerController.cpp
+++ b/libs/input/PointerController.cpp
@@ -41,6 +41,8 @@ namespace android {
namespace {
+static const bool ENABLE_POINTER_CHOREOGRAPHER = input_flags::enable_pointer_choreographer();
+
const ui::Transform kIdentityTransform;
} // namespace
@@ -224,7 +226,7 @@ void PointerController::setPresentation(Presentation presentation) {
mLocked.presentation = presentation;
- if (input_flags::enable_pointer_choreographer()) {
+ if (ENABLE_POINTER_CHOREOGRAPHER) {
// When pointer choreographer is enabled, the presentation mode is only set once when the
// PointerController is constructed, before the display viewport is provided.
// TODO(b/293587049): Clean up the PointerController interface after pointer choreographer