summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Abdelrahman Awadalla <blobou@google.com> 2024-09-11 15:05:13 +0000
committer Abdelrahman Awadalla <blobou@google.com> 2024-09-13 09:10:21 +0000
commit428b72dd4dd37262f265f95e0dcb8e5e75d3da2a (patch)
tree8b62c75f2a48efb7e453f404f9bfd94886bc1064
parent814af359a2aae1c022190f77a49b4b6644240031 (diff)
Modify the translation of the orientation on the touchpad visualizer
Instead of translating the value of the orientation from the range [OrientationMinimum, OrientationMaximum] to the range [0, 360], now it is translated from the range [0, OrientationMaximum] to the range [0, 90]. That way it should be more compatible with the OrientationMaximum data given in the HardwareProperties. Test: Build Test: Manual testing Bug: 286551975 Flag: com.android.hardware.input.touchpad_visualizer Change-Id: I2038390221d6468cde64e78a59c7ee958a173734
-rw-r--r--services/core/java/com/android/server/input/debug/TouchpadVisualizationView.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/input/debug/TouchpadVisualizationView.java b/services/core/java/com/android/server/input/debug/TouchpadVisualizationView.java
index 4e6871c77e93..2ed6f44f532e 100644
--- a/services/core/java/com/android/server/input/debug/TouchpadVisualizationView.java
+++ b/services/core/java/com/android/server/input/debug/TouchpadVisualizationView.java
@@ -77,9 +77,8 @@ public class TouchpadVisualizationView extends View {
mTouchpadHardwareProperties.getBottom(), 0, getHeight(),
touchpadFingerState.getPositionY());
- float newAngle = -translateRange(mTouchpadHardwareProperties.getOrientationMinimum(),
- mTouchpadHardwareProperties.getOrientationMaximum(), 0, 360,
- touchpadFingerState.getOrientation());
+ float newAngle = translateRange(0, mTouchpadHardwareProperties.getOrientationMaximum(),
+ 0, 90, touchpadFingerState.getOrientation());
float resX = mTouchpadHardwareProperties.getResX() == 0f ? DEFAULT_RES_X
: mTouchpadHardwareProperties.getResX();