commit | 8791a0ee0a83a490a187cd1711f6627a41790e09 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Wed Aug 18 21:30:32 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Aug 18 21:30:32 2021 +0000 |
tree | dd1f82501187d4b3b964a175bd24995f54f7a01c | |
parent | 68f1458dfe41df0e9e9590816a6535771b0dc05c [diff] | |
parent | e7c5730804ae448d63c3cd41dce6230775dcbe2f [diff] |
Merge "Tilt scale correction for certain resolutions" am: 9365dde616 am: f6814fa098 am: 3f2d493099 am: e7c5730804 Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1753368 Change-Id: Ib19b24397cf92c8481af62c783f2649ecb8d34cb
diff --git a/services/inputflinger/reader/mapper/TouchInputMapper.cpp b/services/inputflinger/reader/mapper/TouchInputMapper.cpp index af02844..a9f0247 100644 --- a/services/inputflinger/reader/mapper/TouchInputMapper.cpp +++ b/services/inputflinger/reader/mapper/TouchInputMapper.cpp
@@ -896,6 +896,13 @@ mTiltXScale = M_PI / 180; mTiltYScale = M_PI / 180; + if (mRawPointerAxes.tiltX.resolution) { + mTiltXScale = 1.0 / mRawPointerAxes.tiltX.resolution; + } + if (mRawPointerAxes.tiltY.resolution) { + mTiltYScale = 1.0 / mRawPointerAxes.tiltY.resolution; + } + mOrientedRanges.haveTilt = true; mOrientedRanges.tilt.axis = AMOTION_EVENT_AXIS_TILT;