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

is pause/resume with DownloadManager possible? #25

Open
bernardog opened this issue Jul 23, 2024 · 1 comment
Open

is pause/resume with DownloadManager possible? #25

bernardog opened this issue Jul 23, 2024 · 1 comment

Comments

@bernardog
Copy link

Is this a bug report, a feature request, or a question?

Question.

Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?

The question is specific to Android.

Environment

Environment:
react-native-background-downloader: 3.2.0

Target Platform:
Android API 34

Expected Behavior

I'm looking into pausing and resuming DownloadManager, and I saw the following code and comments in Downloader.java:

  // WAITING FOR THE FIX TO BE MERGED
  // https://android-review.googlesource.com/c/platform/packages/providers/DownloadProvider/+/2089866
  public void pause(long downloadId) {
      // ContentValues values = new ContentValues();
      // values.put(Downloads.Impl.COLUMN_CONTROL, Downloads.Impl.CONTROL_PAUSED);
      // values.put(Downloads.Impl.COLUMN_STATUS,
      // Downloads.Impl.STATUS_PAUSED_BY_APP);
      // downloadManager.mResolver.update(ContentUris.withAppendedId(mBaseUri,
      // ids[0]), values, null, null)
  }

It seems mResolver and mBaseUri are private fields in DownloadManager. If it's the case, even if the bug fix is merged, would we be able to pause/resume DownloadManager? I'm also not sure where the Downloads.Impl... constants come from and if they're accessible to us.

Thanks for the great work!

@Featuredutka
Copy link

+1
Would be nice to have pause/resume functionalities for Android.

Nevertheless - thanks for your work and the library, helped me a lot!

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

No branches or pull requests

2 participants