-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InputEvent for click verification on Android #1181
Comments
Thanks for raising, @taddcrockett First, I wanted to provide some context for why InputEvent (and by extension, onTouchListener) was chosen to verify clicks in the current registerSource API design.
Regarding your question on whether developers can use the API without click verification. If developers wish to use onClickListeners and choose not to use InputEvent to verify click events, the API will treat those click events as views.
|
Regarding a recommended approach for developers that use onClickListener, the following proposal offers an interim strategy as we seek a more effective solution to ensure the authenticity of clicks. Defining an onTouchListener to store the InputEvent of action type MotionEvent.ACTION_DOWN or MotionEvent.ACTION_UP as an instance variable. The instance variable can then be referenced within the onClickListener on the same object. For the onClickListener to keep being invoked, the onTouch method from the onTouchListener must return false, allowing the touch event to continue propagation. Here's an example that demonstrates how this can be achieved:
|
Hello privacy sandbox team. I want to inquire about the usage of InputEvent as part of the registerSource API. I understand that InputEvent is required for validation to ensure that a click came from the system and not bots/other sources. However, my codebase has made extensive use of onClickListener instead of onTouchListener and it would be a difficult and costly migration to use onTouchListener instead.
Do you have recommended approach for using this API for developers that use onClickListener? Click listeners are a basic, ingrained part of Android development used everywhere, and essentially this API is not compatible with that as far as I can tell.
Alternatively, looking at the AOSP https://cs.android.com/android/platform/superproject/main/+/main:packages/modules/Ad[…]=351;drc=ad68ffd12e70704e6cfe2e33af3fed993d78464e;bpv=1;bpt=1 this verification can be disabled. Will you allow consumers of this API to disable click verification and assume the risk of invalid clicks themselves?
The text was updated successfully, but these errors were encountered: