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

[path_provider] Fix93198: Added getDownloadsDirectory() for Android #4708

Merged
merged 31 commits into from
Aug 30, 2023

Conversation

talhakhan1297
Copy link
Contributor

@talhakhan1297 talhakhan1297 commented Aug 15, 2023

This PR adds the Android implementation for the getDownloadsDirectory() function by making getDownloadsDirectory redirect at the Dart level to getExternalStorageDirectories with the downloads directory constant.

List which issues are fixed by this PR. You must list at least one issue.
Fixes #93198

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@google-cla
Copy link

google-cla bot commented Aug 15, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Contributor

@stuartmorgan stuartmorgan 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 the contribution!

@talhakhan1297
Copy link
Contributor Author

@stuartmorgan I have made the changes, please have a look 🙂.

Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

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

Oops, cleared my own review state on accident.

Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

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

Thanks, just a couple of minor nits.

Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

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

LGTM

@camsim99 for second approval

Copy link
Contributor

@camsim99 camsim99 left a comment

Choose a reason for hiding this comment

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

LGTM!

@stuartmorgan stuartmorgan added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 29, 2023
@auto-submit auto-submit bot merged commit e7d812c into flutter:main Aug 30, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 31, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Aug 31, 2023
flutter/packages@64af59e...e7d812c

2023-08-30 [email protected] [path_provider] Fix93198: Added getDownloadsDirectory() for Android (flutter/packages#4708)
2023-08-30 [email protected] [in_app_purchase] Minor lint cleanup (flutter/packages#4818)
2023-08-30 [email protected] [local_auth] Update to pigeon 11 and remove enum wrappers (flutter/packages#4809)
2023-08-30 [email protected] [image_picker] Fix link in README file. (flutter/packages#4775)
2023-08-30 [email protected] [web] Use new APIs from `dart:ui_web` (flutter/packages#4168)
2023-08-30 [email protected] Roll Flutter from 6c95737 to 1fe2495 (24 revisions) (flutter/packages#4817)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
@reidbaker reidbaker mentioned this pull request Sep 15, 2023
11 tasks
@nirmalraj2000
Copy link

nirmalraj2000 commented Jul 16, 2024

@talhakhan1297 Looks like getDownloadsDirectory() functionality is added to path_provider for android, but still mentioned as not supported in the documentation.

I have tested in android emulator and I was able to get the path. Is that mentioned by mistake in documentation.

Screenshot 2024-07-16 at 4 23 53 PM

@stuartmorgan
Copy link
Contributor

@nirmalraj2000 That was an oversight; I've filed flutter/flutter#151823 to track it. In the future, please use the issue tracker to report issues rather than commenting on old PRs.

auto-submit bot pushed a commit that referenced this pull request Jul 30, 2024
…roid to 2.2.0 (#7181)

This PR bumps minimum required path_provider_android to 2.2.0 and updates supported paths matrix since Downloads directory was added to android implementation in version 2.2.0

Was not sure about version bump: when I ran `update-release-info` with `--version=minimal` it didn't update version. But since readme updated, I believe it is worth new version since not everyone reads readme on GitHub.

Did not add or change any tests since I think that work was done in #4708

*List which issues are fixed by this PR. You must list at least one issue.*
[#151823](flutter/flutter#151823)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: path_provider platform-android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[path_provider] getDownloadsDirectory() doesn't work for iOS and Android.
4 participants