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

Commit 3c77aff5 authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz Committed by Android (Google) Code Review
Browse files

Merge "[RONs] Define Progress Thumb Icon for EnRouteStyle" into main

parents 0fcc8818 288bfec6
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)}.
@@ -3052,6 +3063,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) {
@@ -11015,6 +11028,9 @@ public class Notification implements Parcelable
        @Nullable
        private CharSequence mLargeIconSubText = null;
        @Nullable
        private Icon mProgressThumbIcon = null;
        public EnRouteStyle() {
        }
@@ -11058,6 +11074,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
         */
@@ -11069,7 +11104,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);
        }
        /**
@@ -11080,6 +11116,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);
        }
        /**
@@ -11090,6 +11127,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);
        }
        /**
@@ -11101,6 +11140,10 @@ public class Notification implements Parcelable
            if (mOverlayIcon != null) {
                mOverlayIcon.convertToAshmem();
            }
            if (mProgressThumbIcon != null) {
                mProgressThumbIcon.convertToAshmem();
            }
        }
        /**