androidx / androidx/media

Allow passing in notification channel name & description as strings on DownloadService

Open
#609 1 comment 0 reactions 1 assignee View on GitHub

@marcbaechinger is already working on this.

Since Sep 4, 2023.

enhancement low priority
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Use case description

We'd like to make use of the DownloadService and take advantage of the ability to have the Service itself create the Notification Channel for us, but can't rely on string resources for notification channel name & description.

Proposed solution

Add an additional constructor to DownloadService that rather than taking in a String resource for channel name and description, would take String or CharSequence instead. This way implementors can use their own localization mechanism, not having to give up on this feature and rely on creating the notification channel themselves.

Proposed constructor

 protected DownloadService(
      int foregroundNotificationId,
      long foregroundNotificationUpdateInterval,
      @Nullable String channelId,
      String channelName,
      String chanelDescription)
Alternatives considered

Currently the only option to circumvent this inconvenience is to use the simpler cosntructor:

protected DownloadService(
      int foregroundNotificationId, long foregroundNotificationUpdateInterval)

and to create the notfiication channel separately.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.