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

Fix a crash that occurs when the password input field visibility state changes and an accessibility service is enabled running Android 7 (API level 25) and below #8071

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

muqeeta96
Copy link
Contributor

@muqeeta96 muqeeta96 commented Aug 18, 2024

This pull request addresses a critical issue: our app crashes when the password visibility state changes while an accessibility service is enabled, particularly on devices running Android 7 (API level 25) and below. The crash stems from an interaction between accessibility services and Jetpack Compose and how these components handle accessibility events.

This issue is documented in ticket #7705, and it has also been recognized as a broader issue on Google's end, as detailed in this Google Issue Tracker.

Fixes #7705

Copy link
Member

@cketti cketti left a comment

Choose a reason for hiding this comment

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

Thanks for working on this ❤️

In my tests the app didn't crash on Android 8 and above. So I think this work-around can be limited to Android 7 (and below, since I wasn't able to get Talkback working in emulators prior to Android 7.1).

Unfortunately, this change currently only fixes the password input in the server settings screens. It doesn't fix the password input in the automatic account setup flow. The work-around should probably be moved further down. I think the TextFieldOutlinedPassword implementations are a good place for it.

@muqeeta96
Copy link
Contributor Author

Ok. I will make the changes today.

Copy link
Member

@cketti cketti left a comment

Choose a reason for hiding this comment

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

Thanks for updating the pull request 👍

There's some code style violations. You should be able to automatically fix them using gradlew spotlessApply.

Please rewrite the history of your branch to be based on the current state of the main branch and only contains one commit with your change. This will make it easier for us to merge your change. If you need help with that, please let me know.

Comment on lines 139 to 140
* and an accessibility service is enabled. It prevents the crash by clearing and
* resetting the semantics of the composable.
Copy link
Member

Choose a reason for hiding this comment

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

The comment needs to be updated to reflect the new code. It should probably also include a link to the relevant Google issue: https://issuetracker.google.com/issues/348232635

@muqeeta96
Copy link
Contributor Author

I mistakenly merge it. But now I fixed it with a rebase and pushed it.

@muqeeta96 muqeeta96 reopened this Aug 27, 2024
@muqeeta96 muqeeta96 changed the title Fix a crash that occurs when the password input field visibility state changes and an accessibility service is enabled Fix a crash that occurs when the password input field visibility state changes and an accessibility service is enabled running Android 7 (API level 25) and below Aug 27, 2024
Copy link
Member

@cketti cketti left a comment

Choose a reason for hiding this comment

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

I changed the magic number 25 to Build.VERSION_CODES.N_MR1 to fix the last remaining detekt issue.

@cketti cketti merged commit aa9ca29 into thunderbird:main Aug 28, 2024
2 checks passed
@cketti
Copy link
Member

cketti commented Aug 28, 2024

Thank you 👍

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.

Crash when unmasking a password field (v. 6.800 from GitHub)
3 participants