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

Commit 5156bd3d authored by Julia Tuttle's avatar Julia Tuttle
Browse files

Log false taps to ActivatableNotificationViews

Bug: 330492016
Test: manual: `flexiglass on`, `adb logcat NotificationShelf`, tap notification shelf
Flag: NA
Change-Id: I9f44f02e0ef072dc187b9d83286f3e72475bc621
parent f7578688
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.statusbar.notification.row.ui.viewbinder

import android.util.Log
import android.view.MotionEvent
import android.view.View
import android.view.View.OnTouchListener
@@ -72,7 +73,6 @@ private class TouchHandler(
    var isTouchEnabled = false

    override fun onTouch(v: View, ev: MotionEvent): Boolean {
        val result = false
        if (ev.action == MotionEvent.ACTION_UP) {
            view.setLastActionUpTime(ev.eventTime)
        }
@@ -82,13 +82,22 @@ private class TouchHandler(
        }
        if (ev.action == MotionEvent.ACTION_UP) {
            // If this is a false tap, capture the even so it doesn't result in a click.
            return falsingManager.isFalseTap(FalsingManager.LOW_PENALTY)
            return falsingManager.isFalseTap(FalsingManager.LOW_PENALTY).also {
                if (it) {
                    Log.d(v::class.simpleName ?: TAG, "capturing false tap")
                }
        return result
            }
        }
        return false
    }

    override fun onInterceptTouchEvent(ev: MotionEvent): Boolean = false

    /** Use [onTouch] instead. */
    override fun onTouchEvent(ev: MotionEvent): Boolean = false

    companion object {
        private const val TAG = "ActivatableNotificationViewBinder"
    }
}