Skip to content

Commit

Permalink
Document that DownloadService needs notification permissions
Browse files Browse the repository at this point in the history
Starting with Android 13 (API 33) an app needs to request the
permission to post notifications or notifications are suppressed.
This change documents this in the class level JavaDoc of the
`DownloadService`.

Issue: #10884
PiperOrigin-RevId: 501346908
(cherry picked from commit 055ed77)
  • Loading branch information
marcbaechinger authored and christosts committed Jan 25, 2023
1 parent b1b9c12 commit fc4415b
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,16 @@
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import org.checkerframework.checker.nullness.qual.RequiresNonNull;

/** A {@link Service} for downloading media. */
/**
* A {@link Service} for downloading media.
*
* <p>Apps with target SDK 33 and greater need to add the {@code
* android.permission.POST_NOTIFICATIONS} permission to the manifest and request the permission at
* runtime before starting downloads. Without that permission granted by the user, notifications
* posted by this service are not displayed. See <a
* href="https://developer.android.com/develop/ui/views/notifications/notification-permission">the
* official UI guide</a> for more detailed information.
*/
public abstract class DownloadService extends Service {

/**
Expand Down

0 comments on commit fc4415b

Please sign in to comment.