Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 15a5c5af authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Log when a pointer is rejected

The previous log condition was incorrect.
To simplify the logic, we only need to check whether the set has
changed. When pointers are removed, the suppressed slots will be removed
accordingly. We can guard for this condition by requiring that the new
set of pointers is larger than the previous set.

It's still possible that the new set is smaller in size, and at the same
time, some of the pointers have changed. Such a condition should not
occur in practice because once a slot becomes palm, it should remain a
palm. We can consider improving this logic in the future.

Sample logs:
UnwantedInteractionBlocker: Palm detected, removing pointer ids {0, 1} after 109ms from NotifyMotionArgs(id=258638844, eventTime=7856563228000, deviceId=4, source=TOUCHSCREEN, action=MOVE, pointerCount=2 pointers={0: id=0 x=1847.0 y=729.0, pressure=1.0}, {1: id=1 x=1549.0 y=527.0, pressure=0.4}, flags=0x00000000)

Example dump:
UnwantedInteractionBlocker:
  mPreferStylusOverTouchBlocker:
    mActiveStyli: {}
    mLastTouchEvents: 4:NotifyMotionArgs(id=477963177, eventTime=67984771964000, deviceId=4, source=TOUCHSCREEN, action=MOVE, pointerCount=1 pointers={0: id=0 x=2078.0 y=740.0, pressure=1.0}, flags=0x00000000)
    mDevicesWithMixedToolType: {}
    mCanceledDevices: {}
  mEnablePalmRejection: 1
  isPalmRejectionEnabled (flag value): 1
  mPalmRejectors:
    deviceId = 4:
      mDeviceInfo:
        PalmFilterDeviceInfo(max_x=2559, max_y=1599, x_res=11, y_res=11, major_radius_res=1, minor_radius_res=1, minor_radius_supported=1), touch_major_res=1, touch_minor_res=1
      mSlotState:
        mSlotsByPointerId:
          0:0
        mPointerIdsBySlot:
          0:0
      mSuppressedPointerIds: {}
      mSharedPalmState: SharedPalmDetectionFilterState(
        latest_stylus_touch_time = 0 bogo-microseconds (67984.9 s from now)
        latest_finger_touch_time = -1657600374977818 bogo-microseconds
        active_finger_touches = 1
        active_palm_touches = 0
        latest_palm_touch_time = -1657600427078938 bogo-microseconds
        Now() = 67984909970 bogo-microseconds
      )
      mPalmDetectionFilter:
        NeuralStylusPalmDetectionFilter(
          is_palm_ = 00000000000000000000
          is_delay_ = 00000000000000000000
          strokes_ =
            0 : PalmFilterStroke(
              GetCentroid() = PointF(188.909, 67.2389)
              BiggestSize() = 576
              MaxMajorRadius() = 24
              samples (11 total):
                PalmFilterSample(major=16, minor=16, pressure=0.726562, edge=43.7273, tracking_id=0, point=PointF(188.909, 67.1818), time=-1657600374977818 bogo-microseconds)
                PalmFilterSample(major=17, minor=17, pressure=0.894531, edge=43.7273, tracking_id=0, point=PointF(188.909, 67.1818), time=-1657600374969818 bogo-microseconds)
                PalmFilterSample(major=20, minor=20, pressure=0.996094, edge=43.7273, tracking_id=0, point=PointF(188.909, 67.1818), time=-1657600374961818 bogo-microseconds)
                PalmFilterSample(major=22, minor=22, pressure=0.996094, edge=43.7273, tracking_id=0, point=PointF(188.909, 67.1818), time=-1657600374953818 bogo-microseconds)
                PalmFilterSample(major=22, minor=22, pressure=0.996094, edge=43.7273, tracking_id=0, point=PointF(188.909, 67.2642), time=-1657600374945818 bogo-microseconds)
                PalmFilterSample(major=23, minor=23, pressure=0.996094, edge=43.7273, tracking_id=0, point=PointF(188.909, 67.2727), time=-1657600374937818 bogo-microseconds)
                PalmFilterSample(major=24, minor=24, pressure=0.996094, edge=43.7273, tracking_id=0, point=PointF(188.909, 67.2727), time=-1657600374929818 bogo-microseconds)
                PalmFilterSample(major=24, minor=24, pressure=0.996094, edge=43.7273, tracking_id=0, point=PointF(188.909, 67.2727), time=-1657600374921818 bogo-microseconds)
                PalmFilterSample(major=24, minor=24, pressure=0.996094, edge=43.7273, tracking_id=0, point=PointF(188.909, 67.2727), time=-1657600374913818 bogo-microseconds)
                PalmFilterSample(major=24, minor=24, pressure=0.996094, edge=43.7273, tracking_id=0, point=PointF(188.909, 67.2727), time=-1657600374905818 bogo-microseconds)
                PalmFilterSample(major=24, minor=24, pressure=0.996094, edge=43.7273, tracking_id=0, point=PointF(188.909, 67.2727), time=-1657600374897818 bogo-microseconds)

              samples_seen() = 11
              tracking_id() = 0
              max_sample_count_ = 12
              resample_period_ = 0.008 s
              last_sample_ = PalmFilterSample(major=24, minor=24, pressure=0.996094, edge=43.7273, tracking_id=0, point=PointF(188.909, 67.2727), time=-1657600374895898 bogo-microseconds)
              unscaled_centroid_ = PointF(2078, 739.628)
              unscaled_centroid_sum_error_ = Vector2dF(3.05176e-05, -3.05176e-05)
            )

          previous_report_time_ = -1657600374895898 bogo-microseconds
          active_tracking_ids_ = {0, }
          tracking_ids_count_within_session_ = 1
          tracking_ids = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ]
          palm_filter_dev_info_ = PalmFilterDeviceInfo(max_x=2559, max_y=1599, x_res=11, y_res=11, major_radius_res=1, minor_radius_res=1, minor_radius_supported=1)
        )

Bug: 198472780
Test: logcatcolor | grep -i palm
Merged-In: Idf2c887b0a04a15f5e398d82bff5a6ee8b03fea8
Change-Id: Idf2c887b0a04a15f5e398d82bff5a6ee8b03fea8
(cherry picked from commit 47494efd)
parent 5d673462
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment