Skip to content
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

game_activity: Fix pointer_index() always returning 0 #84

Merged
merged 1 commit into from
May 24, 2023

Conversation

sannyun
Copy link
Contributor

@sannyun sannyun commented May 23, 2023

Given AMOTION_EVENT_ACTION_MASK is 0xff and AMOTION_EVENT_ACTION_POINTER_INDEX_MASK is 0xff00, this function always returns 0. Looks like ANDing with AMOTION_EVENT_ACTION_MASK should be removed.

Copy link
Member

@MarijnS95 MarijnS95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, this is also what we do in the NDK (and these APIs look pretty much identical)

https://github.com/rust-mobile/ndk/blob/b3a148e804ce29c78a43131afdac2aecf7f8ab8c/ndk/src/event.rs#L424-L432

Perhaps @rib intended to use self.action on the next line, and instead use action to validate whether the MOTION_ACCESS in one of Up/Down/PointerUp/PointerDown?

@MarijnS95 MarijnS95 changed the title pointer_index always returns 0 game_activity: Fix pointer_index() always returning 0 May 24, 2023
@rib
Copy link
Collaborator

rib commented May 24, 2023

Thanks, yeah this looks wrong. I doubt I was planning to validate the action and probably just made a mistake at the time, oops.

@rib rib merged commit 924e540 into rust-mobile:main May 24, 2023
@sannyun sannyun deleted the pointer_index_fix branch May 25, 2023 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants