Fix trackball interpretation of precision.
The trackball to dpad synthesis was using the MotionEvent's precision field to determine a threshold for movement but the calculations involved did not actually make sense for any value of precision less than 2.0. This worked fine before since the InputReader hardcodes the trackball's precision to 6. Injected trackball events may have a different precision which can result in the thresholds being set inappropriately. For example, it was not possible to move focus by one unit at a time when the precision was set to 1.0. The old code was probably using precision as a way to set a threshold based on the trackball moving by some minimum number of physical ticks, in this case 2. But the code will work just as well if we set an absolute threshold based on distance traveled given that the input system is already expected to normalize the trackball movements before delivering them to the application. So stop using precision. Bug: 8473020 Change-Id: I3c6f7fb1b507f8cf5608b47550e7345fea3352fa
Loading
Please register or sign in to comment