Merge "TouchInputMapper: Use default viewport for PointerController" am: 69f1479abe

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1319647

Change-Id: I378e82dc2c6f1fe8506c7639f5c5244828589ea9
This commit is contained in:
Treehugger Robot 2020-06-08 17:02:28 +00:00 committed by Automerger Merge Worker
commit 49990b462a

View file

@ -771,7 +771,11 @@ void TouchInputMapper::configureSurface(nsecs_t when, bool* outResetNeeded) {
(mDeviceMode == DEVICE_MODE_DIRECT && mConfig.showTouches)) {
if (mPointerController == nullptr || viewportChanged) {
mPointerController = getPolicy()->obtainPointerController(getDeviceId());
mPointerController->setDisplayViewport(mViewport);
// Set the DisplayViewport for the PointerController to the default pointer display
// that is recommended by the configuration before using it.
std::optional<DisplayViewport> defaultViewport =
mConfig.getDisplayViewportById(mConfig.defaultPointerDisplayId);
mPointerController->setDisplayViewport(defaultViewport.value_or(mViewport));
}
} else {
mPointerController.clear();