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

add an activity check for the permission check #5900

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Donutcheese
Copy link

Description (required)

Fixes #INSERT_ISSUE_NUMBER_HERE

What changes did you make and why?
Added SecurityException Handling:

Wrapped the creation of DownloadManager.Request in a try-catch block to handle SecurityException if storage permission is missing. This prevents the app from crashing when permissions are revoked during download.
Checked for Non-null activity Before Enqueuing:

Added a null check for activity before calling enqueueRequest. This ensures the activity is still valid, especially when permissions are revoked or the activity is recreated.
Enhanced Documentation:

Added detailed doc comments for the class and each method, explaining the purpose and functionality of the code, making it more readable and maintainable.

Tests performed (required)

Tested {build variant, e.g. ProdDebug} on {name of device or emulator} with API level {API level}.
ProdDebug on samsung zflip6, 34 api
Screenshots (for UI changes only)

Need help? See https://support.google.com/android/answer/9075928


Note: Please ensure that you have read CONTRIBUTING.md if this is your first pull request.

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.

1 participant