-
Notifications
You must be signed in to change notification settings - Fork 767
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(android): get external files directory for Android 10+ #317
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm -- later tonight I'll try to give it an actual test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From google docs:
Starting in November 2021, app updates will be required to target API level 30 or above
What needs to release this fix? any help?
Last call for reviews. This PR will be merged in tomorrow (JST). |
As stated in issue apache#325, it looks like PR apache#317 missed a spot in the corrections it was making. This commit adds that fix to the missed location.
Platforms affected
Android
Motivation and Context
To resolve mounted storage for Android 11.
Android 11 (API 30) has deprecated the method
Environment.getExternalStorageDirectory()
.Description
This PR has replaced the
Environment.getExternalStorageDirectory()
usage withcontext.getExternalFilesDir(null)
.Per Android documentation,
getExternalFilesDir
is one of the suggested alternative solutions.PR also includes a little bit of refactoring to remove code duplication that related to the calling of
getExternalStorageDirectory
, nowgetExternalFilesDir
.Testing
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)