From 660ad30b76644bf558b5beaac8be930a4b3af770 Mon Sep 17 00:00:00 2001 From: Prabir Pradhan Date: Thu, 30 Nov 2023 20:02:11 +0000 Subject: Pointer Icon Refactor: Allow presentation mode to be set without display When PointerChoreographer is enabled, each PointerController will have its mode set during construction, and the mode will never change. Allow the mode to be set before the viewport is assigned to it. Bug: 293587049 Test: manual Change-Id: I1329a5635407f4af4c201ab876f540085b3747d7 --- libs/input/PointerController.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libs/input/PointerController.cpp') diff --git a/libs/input/PointerController.cpp b/libs/input/PointerController.cpp index 65e16056c106..bba9c9764eee 100644 --- a/libs/input/PointerController.cpp +++ b/libs/input/PointerController.cpp @@ -218,6 +218,15 @@ void PointerController::setPresentation(Presentation presentation) { mLocked.presentation = presentation; + if (input_flags::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 + // is permanently enabled. The presentation can be set in the constructor. + mCursorController.setStylusHoverMode(presentation == Presentation::STYLUS_HOVER); + return; + } + if (!mCursorController.isViewportValid()) { return; } -- cgit v1.2.3-59-g8ed1b