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

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

Merge "[RONs] Remove Stable from StableId for Step/Segment" into main

parents 85350319 a15af6dc
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -6882,19 +6882,19 @@ package android.app {
  public static final class Notification.ProgressStyle.Segment {
    ctor public Notification.ProgressStyle.Segment(int);
    method @ColorInt public int getColor();
    method public int getId();
    method public int getLength();
    method public int getStableId();
    method @NonNull public android.app.Notification.ProgressStyle.Segment setColor(@ColorInt int);
    method @NonNull public android.app.Notification.ProgressStyle.Segment setStableId(int);
    method @NonNull public android.app.Notification.ProgressStyle.Segment setId(int);
  }
  public static final class Notification.ProgressStyle.Step {
    ctor public Notification.ProgressStyle.Step(int);
    method @ColorInt public int getColor();
    method public int getId();
    method public int getPosition();
    method public int getStableId();
    method @NonNull public android.app.Notification.ProgressStyle.Step setColor(@ColorInt int);
    method @NonNull public android.app.Notification.ProgressStyle.Step setStableId(int);
    method @NonNull public android.app.Notification.ProgressStyle.Step setId(int);
  }
  public abstract static class Notification.Style {
+25 −25
Original line number Diff line number Diff line
@@ -11199,7 +11199,7 @@ public class Notification implements Parcelable
     */
    @FlaggedApi(Flags.FLAG_API_RICH_ONGOING)
    public static class ProgressStyle extends Notification.Style {
        private static final String KEY_ELEMENT_STABLE_ID = "stableId";
        private static final String KEY_ELEMENT_ID = "id";
        private static final String KEY_ELEMENT_COLOR = "colorInt";
        private static final String KEY_SEGMENT_LENGTH = "length";
        private static final String KEY_STEP_POSITION = "position";
@@ -11626,7 +11626,7 @@ public class Notification implements Parcelable
                    final Bundle bundle = new Bundle();
                    bundle.putInt(KEY_SEGMENT_LENGTH, segment.getLength());
                    bundle.putInt(KEY_ELEMENT_STABLE_ID, segment.getStableId());
                    bundle.putInt(KEY_ELEMENT_ID, segment.getId());
                    bundle.putInt(KEY_ELEMENT_COLOR, segment.getColor());
                    segments.add(bundle);
@@ -11647,11 +11647,11 @@ public class Notification implements Parcelable
                        continue;
                    }
                    final int stableId = segmentBundle.getInt(KEY_ELEMENT_STABLE_ID);
                    final int id = segmentBundle.getInt(KEY_ELEMENT_ID);
                    final int color = segmentBundle.getInt(KEY_ELEMENT_COLOR,
                            Notification.COLOR_DEFAULT);
                    final Segment segment = new Segment(length)
                            .setStableId(stableId).setColor(color);
                            .setId(id).setColor(color);
                    segments.add(segment);
                }
@@ -11672,7 +11672,7 @@ public class Notification implements Parcelable
                    final Bundle bundle = new Bundle();
                    bundle.putInt(KEY_STEP_POSITION, step.getPosition());
                    bundle.putInt(KEY_ELEMENT_STABLE_ID, step.getStableId());
                    bundle.putInt(KEY_ELEMENT_ID, step.getId());
                    bundle.putInt(KEY_ELEMENT_COLOR, step.getColor());
                    steps.add(bundle);
@@ -11693,10 +11693,10 @@ public class Notification implements Parcelable
                    if (position < 0) {
                        continue;
                    }
                    final int stableId = segmentBundle.getInt(KEY_ELEMENT_STABLE_ID);
                    final int id = segmentBundle.getInt(KEY_ELEMENT_ID);
                    final int color = segmentBundle.getInt(KEY_ELEMENT_COLOR,
                            Notification.COLOR_DEFAULT);
                    final Step step = new Step(position).setStableId(stableId).setColor(color);
                    final Step step = new Step(position).setId(id).setColor(color);
                    steps.add(step);
                }
            }
@@ -11712,7 +11712,7 @@ public class Notification implements Parcelable
         */
        public static final class Segment {
            private int mLength;
            private int mStableId = 0;
            private int mId = 0;
            @ColorInt
            private int mColor = Notification.COLOR_DEFAULT;
@@ -11735,19 +11735,19 @@ public class Notification implements Parcelable
            }
            /**
             * Gets the stable id of this Segment.
             * Gets the id of this Segment.
             *
             * @see #setStableId
             * @see #setId
             */
            public int getStableId() {
                return mStableId;
            public int getId() {
                return mId;
            }
            /**
             * Optional ID used to uniquely identify the element across updates.
             */
            public @NonNull Segment setStableId(int stableId) {
                mStableId = stableId;
            public @NonNull Segment setId(int id) {
                mId = id;
                return this;
            }
@@ -11777,13 +11777,13 @@ public class Notification implements Parcelable
                if (this == o) return true;
                if (o == null || getClass() != o.getClass()) return false;
                Segment segment = (Segment) o;
                return mLength == segment.mLength && mStableId == segment.mStableId
                return mLength == segment.mLength && mId == segment.mId
                        && mColor == segment.mColor;
            }
            @Override
            public int hashCode() {
                return Objects.hash(mLength, mStableId, mColor);
                return Objects.hash(mLength, mId, mColor);
            }
        }
@@ -11797,7 +11797,7 @@ public class Notification implements Parcelable
        public static final class Step {
            private int mPosition;
            private int mStableId;
            private int mId;
            @ColorInt
            private int mColor = Notification.COLOR_DEFAULT;
@@ -11823,17 +11823,17 @@ public class Notification implements Parcelable
            /**
             * Optional ID used to uniqurely identify the element across updates.
             * Optional ID used to uniquely identify the element across updates.
             */
            public int getStableId() {
                return mStableId;
            public int getId() {
                return mId;
            }
            /**
             * Optional ID used to uniqurely identify the element across updates.
             * Optional ID used to uniquely identify the element across updates.
             */
            public @NonNull Step setStableId(int stableId) {
                mStableId = stableId;
            public @NonNull Step setId(int id) {
                mId = id;
                return this;
            }
@@ -11863,13 +11863,13 @@ public class Notification implements Parcelable
                if (this == o) return true;
                if (o == null || getClass() != o.getClass()) return false;
                Step step = (Step) o;
                return mPosition == step.mPosition && mStableId == step.mStableId
                return mPosition == step.mPosition && mId == step.mId
                        && mColor == step.mColor;
            }
            @Override
            public int hashCode() {
                return Objects.hash(mPosition, mStableId, mColor);
                return Objects.hash(mPosition, mId, mColor);
            }
        }
    }