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

Commit f6427ebf authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Add Notification.hasPromotableCharacteristics to public API

Change-Id: Ia889ca135cd28f64a5d7728aacfcb32134a1860a
Flag: android.app.api_rich_ongoing
Test: atest NotificationTest
Bug: 337261753
parent b3aa045d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6482,6 +6482,7 @@ package android.app {
    method public String getSortKey();
    method public long getTimeoutAfter();
    method public boolean hasImage();
    method @FlaggedApi("android.app.api_rich_ongoing") public boolean hasPromotableCharacteristics();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.media.AudioAttributes AUDIO_ATTRIBUTES_DEFAULT;
    field public static final int BADGE_ICON_LARGE = 2; // 0x2
+7 −5
Original line number Diff line number Diff line
@@ -3221,7 +3221,6 @@ public class Notification implements Parcelable
    /**
     * @hide
     */
    @FlaggedApi(Flags.FLAG_UI_RICH_ONGOING)
    public boolean containsCustomViews() {
        return contentView != null
                || bigContentView != null
@@ -3235,7 +3234,6 @@ public class Notification implements Parcelable
    /**
     * @hide
     */
    @FlaggedApi(Flags.FLAG_UI_RICH_ONGOING)
    public boolean hasTitle() {
        return extras != null
                && (!TextUtils.isEmpty(extras.getCharSequence(EXTRA_TITLE))
@@ -3245,7 +3243,7 @@ public class Notification implements Parcelable
    /**
     * @hide
     */
    @FlaggedApi(Flags.FLAG_UI_RICH_ONGOING)
    @FlaggedApi(Flags.FLAG_API_RICH_ONGOING)
    public boolean hasPromotableStyle() {
        final Class<? extends Style> notificationStyle = getNotificationStyle();
@@ -3257,9 +3255,13 @@ public class Notification implements Parcelable
    }
    /**
     * @hide
     * Returns whether the notification has all the characteristics that make it eligible for
     * {@link #FLAG_PROMOTED_ONGOING}. This method does not factor in other criteria such user
     * preferences for the app or channel. If this returns true, it does not guarantee that the
     * notification will be assigned FLAG_PROMOTED_ONGOING by the system, but if this returns false,
     * it will not.
     */
    @FlaggedApi(Flags.FLAG_UI_RICH_ONGOING)
    @FlaggedApi(Flags.FLAG_API_RICH_ONGOING)
    public boolean hasPromotableCharacteristics() {
        return isColorizedRequested()
                && isOngoingEvent()