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

Commit 288bfec6 authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz
Browse files

[RONs] Define Progress Thumb Icon for EnRouteStyle

Bug: 359918677
Test: Presubmit
Flag: android.app.api_rich_ongoing
Change-Id: Ieb176097d658a079ae213ccc5eb6a5233918c5d0
parent 1a67e2cc
Loading
Loading
Loading
Loading
+44 −1
Original line number Diff line number Diff line
@@ -1593,6 +1593,17 @@ public class Notification implements Parcelable
     */
    @FlaggedApi(Flags.FLAG_API_RICH_ONGOING)
    public static final String EXTRA_ENROUTE_LARGE_ICON_SUBTEXT = "android.enrouteLargeIconSubText";
    /**
     * {@link #extras} key: {@link Icon} of an image used as a thumb icon on
     * {@link Notification} progress bar for {@link EnRouteStyle} notifications.
     * This extra is an {@code Icon}.
     * @hide
     */
    @FlaggedApi(Flags.FLAG_API_RICH_ONGOING)
    public static final String EXTRA_ENROUTE_PROGRESS_THUMB_ICON =
            "android.enrouteProgressThumbIcon";
    /**
     * {@link #extras} key: whether the notification should be colorized as
     * supplied to {@link Builder#setColorized(boolean)}.
@@ -3057,6 +3068,8 @@ public class Notification implements Parcelable
        if (Flags.apiRichOngoing()) {
            visitIconUri(visitor, extras.getParcelable(EXTRA_ENROUTE_OVERLAY_ICON, Icon.class));
            visitIconUri(visitor, extras.getParcelable(EXTRA_ENROUTE_PROGRESS_THUMB_ICON,
                Icon.class));
        }
        if (mBubbleMetadata != null) {
@@ -11030,6 +11043,9 @@ public class Notification implements Parcelable
        @Nullable
        private CharSequence mLargeIconSubText = null;
        @Nullable
        private Icon mProgressThumbIcon = null;
        public EnRouteStyle() {
        }
@@ -11073,6 +11089,25 @@ public class Notification implements Parcelable
            return this;
        }
        /**
         * Returns the progress thumb icon.
         * @see EnRouteStyle#setProgressThumbIcon
         */
        @Nullable
        public Icon getProgressThumbIcon() {
            return mProgressThumbIcon;
        }
        /**
         * Optional icon to be used as a progress thumb.
         */
        @NonNull
        public EnRouteStyle setProgressThumbIcon(@Nullable Icon progressThumbIcon) {
            mProgressThumbIcon = progressThumbIcon;
            return this;
        }
         /**
         * @hide
         */
@@ -11084,7 +11119,8 @@ public class Notification implements Parcelable
            final EnRouteStyle enRouteStyle = (EnRouteStyle) other;
            return !Objects.equals(mOverlayIcon, enRouteStyle.mOverlayIcon)
                    || !Objects.equals(mLargeIconSubText, enRouteStyle.mLargeIconSubText);
                    || !Objects.equals(mLargeIconSubText, enRouteStyle.mLargeIconSubText)
                    || !Objects.equals(mProgressThumbIcon, enRouteStyle.mProgressThumbIcon);
        }
        /**
@@ -11095,6 +11131,7 @@ public class Notification implements Parcelable
            super.addExtras(extras);
            extras.putParcelable(EXTRA_ENROUTE_OVERLAY_ICON, mOverlayIcon);
            extras.putCharSequence(EXTRA_ENROUTE_LARGE_ICON_SUBTEXT, mLargeIconSubText);
            extras.putParcelable(EXTRA_ENROUTE_PROGRESS_THUMB_ICON, mProgressThumbIcon);
        }
        /**
@@ -11105,6 +11142,8 @@ public class Notification implements Parcelable
            super.restoreFromExtras(extras);
            mOverlayIcon = extras.getParcelable(EXTRA_ENROUTE_OVERLAY_ICON, Icon.class);
            mLargeIconSubText = extras.getCharSequence(EXTRA_ENROUTE_LARGE_ICON_SUBTEXT);
            mProgressThumbIcon =
                    extras.getParcelable(EXTRA_ENROUTE_PROGRESS_THUMB_ICON, Icon.class);
        }
        /**
@@ -11116,6 +11155,10 @@ public class Notification implements Parcelable
            if (mOverlayIcon != null) {
                mOverlayIcon.convertToAshmem();
            }
            if (mProgressThumbIcon != null) {
                mProgressThumbIcon.convertToAshmem();
            }
        }
        /**