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 crash when opening in-app Camera for the very first time #6139

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

rohit9625
Copy link
Contributor

Description (required)

Fixes #6137

What changes did you make and why?
Previously, the callbacks passed to the checkPermissionAndPerformAction() method were executing on a background Thread, leading to Handler error when trying to show AlertDialog. So, I make them execute in a coroutine on the Main thread.

Tests performed (required)

Tested prodDebug on Samsung A14 with API level 34.

Screenshots (for UI changes only)

Before Fix

Before_Fix.mp4

After Fix

After_Fix.mp4

The PermissionUtils was incorrectly executing permission callbacks on a background thread, leading to a Handler error. Now, it is using Main dispatcher.
@Sujal-Gupta-SG
Copy link
Contributor

Hi @rohit9625
Can you also correct this for the nearby there will be same issue while uploading

@rohit9625
Copy link
Contributor Author

The same method is being used for the nearby as well. Please try pulling from this branch :)

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

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

This seems to fix the problem, thanks! :-)

@nicolas-raoul nicolas-raoul merged commit 9f1fe87 into commons-app:main Jan 17, 2025
1 check passed
@rohit9625 rohit9625 deleted the fix-camera-crash branch January 18, 2025 16:58
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 tapping camera icon in Nearby
3 participants