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:
Linnan Li <lilinnan@xiaomi.corp-partner.google.com>
Loading
Please register or sign in to comment