Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca8e7c5f authored by Makoto Onuki's avatar Makoto Onuki Committed by Automerger Merge Worker
Browse files

Merge "Clean up setForegroundServiceBehavior()" into sc-dev am: b5ddeefc

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14518585

Change-Id: I4ef72e32bd38d5559e1b327c0d5bfd713fddec5e
parents 8c4b5d4c b5ddeefc
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -174,6 +174,7 @@ public class Notification implements Parcelable
     */
    public static final @ServiceNotificationPolicy int FOREGROUND_SERVICE_DEFERRED = 2;

    @ServiceNotificationPolicy
    private int mFgsDeferBehavior;

    /**
@@ -4614,9 +4615,9 @@ public class Notification implements Parcelable
         * foreground service.  By default, the system can choose to defer
         * visibility of the notification for a short time after the service is
         * started.  Pass
         * {@link Notification#FOREGROUND_SERVICE_IMMEDIATE BEHAVIOR_IMMEDIATE_DISPLAY}
         * {@link Notification#FOREGROUND_SERVICE_IMMEDIATE FOREGROUND_SERVICE_IMMEDIATE}
         * to this method in order to guarantee that visibility is never deferred.  Pass
         * {@link Notification#FOREGROUND_SERVICE_DEFERRED BEHAVIOR_DEFERRED_DISPLAY}
         * {@link Notification#FOREGROUND_SERVICE_DEFERRED FOREGROUND_SERVICE_DEFERRED}
         * to request that visibility is deferred whenever possible.
         *
         * <p class="note">Note that deferred visibility is not guaranteed.  There
@@ -4624,13 +4625,13 @@ public class Notification implements Parcelable
         * service's associated Notification immediately even when the app has used
         * this method to explicitly request deferred display.</p>
         * @param behavior One of
         * {@link Notification#FOREGROUND_SERVICE_DEFAULT BEHAVIOR_DEFAULT},
         * {@link Notification#FOREGROUND_SERVICE_IMMEDIATE BEHAVIOR_IMMEDIATE_DISPLAY},
         * or {@link Notification#FOREGROUND_SERVICE_DEFERRED BEHAVIOR_DEFERRED_DISPLAY}
         * {@link Notification#FOREGROUND_SERVICE_DEFAULT FOREGROUND_SERVICE_DEFAULT},
         * {@link Notification#FOREGROUND_SERVICE_IMMEDIATE FOREGROUND_SERVICE_IMMEDIATE},
         * or {@link Notification#FOREGROUND_SERVICE_DEFERRED FOREGROUND_SERVICE_DEFERRED}
         * @return
         */
        @NonNull
        public Builder setForegroundServiceBehavior(int behavior) {
        public Builder setForegroundServiceBehavior(@ServiceNotificationPolicy int behavior) {
            mN.mFgsDeferBehavior = behavior;
            return this;
        }