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

Commit cf8f1b2a authored by Mady Mellor's avatar Mady Mellor
Browse files

API review: annotate everything

Fixes: 126698822
Fixes: 126699172
Fixes: 126701240
Test: none - this is all annotations; existing test pass (atest NotificationTest)
Change-Id: Ia3bc14922fb6784e287586650a90ea0041b8d992
parent 40e490e2
Loading
Loading
Loading
Loading
+13 −13
Original line number Diff line number Diff line
@@ -5261,7 +5261,7 @@ package android.app {
    method public int describeContents();
    method public boolean getAllowSystemGeneratedContextualActions();
    method public int getBadgeIconType();
    method public android.app.Notification.BubbleMetadata getBubbleMetadata();
    method @Nullable public android.app.Notification.BubbleMetadata getBubbleMetadata();
    method public String getChannelId();
    method public String getGroup();
    method public int getGroupAlertBehavior();
@@ -5478,25 +5478,25 @@ package android.app {
  public static final class Notification.BubbleMetadata implements android.os.Parcelable {
    method public int describeContents();
    method public boolean getAutoExpandBubble();
    method public android.app.PendingIntent getDeleteIntent();
    method @Nullable public android.app.PendingIntent getDeleteIntent();
    method public int getDesiredHeight();
    method public android.graphics.drawable.Icon getIcon();
    method public android.app.PendingIntent getIntent();
    method @NonNull public android.graphics.drawable.Icon getIcon();
    method @NonNull public android.app.PendingIntent getIntent();
    method public boolean getSuppressInitialNotification();
    method @Deprecated public CharSequence getTitle();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.Notification.BubbleMetadata> CREATOR;
  }
  public static class Notification.BubbleMetadata.Builder {
  public static final class Notification.BubbleMetadata.Builder {
    ctor public Notification.BubbleMetadata.Builder();
    method public android.app.Notification.BubbleMetadata build();
    method public android.app.Notification.BubbleMetadata.Builder setAutoExpandBubble(boolean);
    method public android.app.Notification.BubbleMetadata.Builder setDeleteIntent(android.app.PendingIntent);
    method public android.app.Notification.BubbleMetadata.Builder setDesiredHeight(int);
    method public android.app.Notification.BubbleMetadata.Builder setIcon(android.graphics.drawable.Icon);
    method public android.app.Notification.BubbleMetadata.Builder setIntent(android.app.PendingIntent);
    method public android.app.Notification.BubbleMetadata.Builder setSuppressInitialNotification(boolean);
    method @NonNull public android.app.Notification.BubbleMetadata build();
    method @NonNull public android.app.Notification.BubbleMetadata.Builder setAutoExpandBubble(boolean);
    method @NonNull public android.app.Notification.BubbleMetadata.Builder setDeleteIntent(@Nullable android.app.PendingIntent);
    method @NonNull public android.app.Notification.BubbleMetadata.Builder setDesiredHeight(int);
    method @NonNull public android.app.Notification.BubbleMetadata.Builder setIcon(@NonNull android.graphics.drawable.Icon);
    method @NonNull public android.app.Notification.BubbleMetadata.Builder setIntent(@NonNull android.app.PendingIntent);
    method @NonNull public android.app.Notification.BubbleMetadata.Builder setSuppressInitialNotification(boolean);
    method @Deprecated public android.app.Notification.BubbleMetadata.Builder setTitle(CharSequence);
  }
@@ -5521,7 +5521,7 @@ package android.app {
    method @NonNull public android.app.Notification.Builder setAllowSystemGeneratedContextualActions(boolean);
    method @NonNull public android.app.Notification.Builder setAutoCancel(boolean);
    method @NonNull public android.app.Notification.Builder setBadgeIconType(int);
    method @NonNull public android.app.Notification.Builder setBubbleMetadata(android.app.Notification.BubbleMetadata);
    method @NonNull public android.app.Notification.Builder setBubbleMetadata(@Nullable android.app.Notification.BubbleMetadata);
    method @NonNull public android.app.Notification.Builder setCategory(String);
    method @NonNull public android.app.Notification.Builder setChannelId(String);
    method @NonNull public android.app.Notification.Builder setChronometerCountDown(boolean);
+17 −5
Original line number Diff line number Diff line
@@ -3177,6 +3177,7 @@ public class Notification implements Parcelable
     * Returns the bubble metadata that will be used to display app content in a floating window
     * over the existing foreground activity.
     */
    @Nullable
    public BubbleMetadata getBubbleMetadata() {
        return mBubbleMetadata;
    }
@@ -3568,7 +3569,7 @@ public class Notification implements Parcelable
         * collapsed state, the bubble intent will be invoked and displayed.</b>
         */
        @NonNull
        public Builder setBubbleMetadata(BubbleMetadata data) {
        public Builder setBubbleMetadata(@Nullable BubbleMetadata data) {
            mN.mBubbleMetadata = data;
            return this;
        }
@@ -8562,6 +8563,7 @@ public class Notification implements Parcelable
        /**
         * @return the pending intent used to populate the floating window for this bubble.
         */
        @NonNull
        public PendingIntent getIntent() {
            return mPendingIntent;
        }
@@ -8569,6 +8571,7 @@ public class Notification implements Parcelable
        /**
         * @return the pending intent to send when the bubble is dismissed by a user, if one exists.
         */
        @Nullable
        public PendingIntent getDeleteIntent() {
            return mDeleteIntent;
        }
@@ -8583,9 +8586,11 @@ public class Notification implements Parcelable
        public CharSequence getTitle() {
            return "";
        }

        /**
         * @return the icon that will be displayed for this bubble when it is collapsed.
         */
        @NonNull
        public Icon getIcon() {
            return mIcon;
        }
@@ -8654,7 +8659,7 @@ public class Notification implements Parcelable
        /**
         * Builder to construct a {@link BubbleMetadata} object.
         */
        public static class Builder {
        public static final class Builder {

            private PendingIntent mPendingIntent;
            private Icon mIcon;
@@ -8672,7 +8677,8 @@ public class Notification implements Parcelable
             * Sets the intent that will be used when the bubble is expanded. This will display the
             * app content in a floating window over the existing foreground activity.
             */
            public BubbleMetadata.Builder setIntent(PendingIntent intent) {
            @NonNull
            public BubbleMetadata.Builder setIntent(@NonNull PendingIntent intent) {
                if (intent == null) {
                    throw new IllegalArgumentException("Bubble requires non-null pending intent");
                }
@@ -8700,7 +8706,8 @@ public class Notification implements Parcelable
             * If your app produces multiple bubbles, the image should be unique for each of them.
             * </p>
             */
            public BubbleMetadata.Builder setIcon(Icon icon) {
            @NonNull
            public BubbleMetadata.Builder setIcon(@NonNull Icon icon) {
                if (icon == null) {
                    throw new IllegalArgumentException("Bubbles require non-null icon");
                }
@@ -8713,6 +8720,7 @@ public class Notification implements Parcelable
             * {@link #setIntent(PendingIntent)}, this height may not be respected if there is not
             * enough space on the screen or if the provided height is too small to be useful.
             */
            @NonNull
            public BubbleMetadata.Builder setDesiredHeight(int height) {
                mDesiredHeight = Math.max(height, 0);
                return this;
@@ -8729,6 +8737,7 @@ public class Notification implements Parcelable
             * <p>Generally this flag should only be set if the user has performed an action to
             * request or create a bubble.</p>
             */
            @NonNull
            public BubbleMetadata.Builder setAutoExpandBubble(boolean shouldExpand) {
                setFlag(FLAG_AUTO_EXPAND_BUBBLE, shouldExpand);
                return this;
@@ -8745,6 +8754,7 @@ public class Notification implements Parcelable
             * <p>Generally this flag should only be set if the user has performed an action to
             * request or create a bubble.</p>
             */
            @NonNull
            public BubbleMetadata.Builder setSuppressInitialNotification(
                    boolean shouldSupressNotif) {
                setFlag(FLAG_SUPPRESS_INITIAL_NOTIFICATION, shouldSupressNotif);
@@ -8754,7 +8764,8 @@ public class Notification implements Parcelable
            /**
             * Sets an optional intent to send when this bubble is explicitly removed by the user.
             */
            public BubbleMetadata.Builder setDeleteIntent(PendingIntent deleteIntent) {
            @NonNull
            public BubbleMetadata.Builder setDeleteIntent(@Nullable PendingIntent deleteIntent) {
                mDeleteIntent = deleteIntent;
                return this;
            }
@@ -8764,6 +8775,7 @@ public class Notification implements Parcelable
             * <p>Will throw {@link IllegalStateException} if required fields have not been set
             * on this builder.</p>
             */
            @NonNull
            public BubbleMetadata build() {
                if (mPendingIntent == null) {
                    throw new IllegalStateException("Must supply pending intent to bubble");