Merge "Fix UDFPS touch coordinates reported to the HAL" into sc-dev am: aa12b6a492
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14925499 Change-Id: Ic6ae1ed629ea4d14b9762d9023fb9e86e6e55068
This commit is contained in:
@@ -405,9 +405,8 @@ public class UdfpsController implements DozeReceiver {
|
|||||||
? event.getPointerId(0)
|
? event.getPointerId(0)
|
||||||
: event.findPointerIndex(mActivePointerId);
|
: event.findPointerIndex(mActivePointerId);
|
||||||
if (idx == event.getActionIndex()) {
|
if (idx == event.getActionIndex()) {
|
||||||
final float x = event.getX(idx);
|
if (isWithinSensorArea(udfpsView, event.getX(idx), event.getY(idx),
|
||||||
final float y = event.getY(idx);
|
fromUdfpsView)) {
|
||||||
if (isWithinSensorArea(udfpsView, x, y, fromUdfpsView)) {
|
|
||||||
if (mVelocityTracker == null) {
|
if (mVelocityTracker == null) {
|
||||||
// touches could be injected, so the velocity tracker may not have
|
// touches could be injected, so the velocity tracker may not have
|
||||||
// been initialized (via ACTION_DOWN).
|
// been initialized (via ACTION_DOWN).
|
||||||
@@ -427,7 +426,8 @@ public class UdfpsController implements DozeReceiver {
|
|||||||
final long sinceLastLog = SystemClock.elapsedRealtime() - mTouchLogTime;
|
final long sinceLastLog = SystemClock.elapsedRealtime() - mTouchLogTime;
|
||||||
if (!isIlluminationRequested && !mGoodCaptureReceived &&
|
if (!isIlluminationRequested && !mGoodCaptureReceived &&
|
||||||
!exceedsVelocityThreshold) {
|
!exceedsVelocityThreshold) {
|
||||||
onFingerDown((int) x, (int) y, minor, major);
|
onFingerDown((int) event.getRawX(), (int) event.getRawY(), minor,
|
||||||
|
major);
|
||||||
Log.v(TAG, "onTouch | finger down: " + touchInfo);
|
Log.v(TAG, "onTouch | finger down: " + touchInfo);
|
||||||
mTouchLogTime = SystemClock.elapsedRealtime();
|
mTouchLogTime = SystemClock.elapsedRealtime();
|
||||||
mPowerManager.userActivity(SystemClock.uptimeMillis(),
|
mPowerManager.userActivity(SystemClock.uptimeMillis(),
|
||||||
|
|||||||
Reference in New Issue
Block a user