Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 37c1b992 authored by Linnan Li's avatar Linnan Li Committed by Prabir Pradhan
Browse files

PointerController: Get initial DisplayInfos from SurfaceComposerClient



After the PointerController is created, if SurfaceFlinger hasn't called
back to notify DisplayInfo,the PointerController won't have DisplayInfo,
if the actual display exists and transforms at this time, using the
display touch position will result in the wrong actual display position.

Steps to reproduce the problem.
1. Switch the device to landscape.
2. Execute `adb shell settings put system show_touch 1`.
3. Touch the screen.
4. At this point, you can observe that the screen flashes an incorrect
touch point location.

How to fix it
The addWindowInfosListener method has a parameter to get the initial
position, which we use to get the current DisplayInfo at creation time.
Even though this information would not exist if there were no other
listeners, it doesn't matter here because the InputDispatcher was
created long before the PointerController, and the InputDispatcher
already added a listener, so the DisplayInfo information must exist,
so we don't have to worry about this.

Bug: 313033164
Test: Manual

Change-Id: Ia942c85d1b2204690f69e6a2ba43cfb7542af27c
Signed-off-by: default avatarLinnan Li <lilinnan@xiaomi.corp-partner.google.com>
parent a7bf3505
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment