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

Commit 619e2c0d authored by Rhiannon Malia's avatar Rhiannon Malia Committed by Android (Google) Code Review
Browse files

Merge "Adding suppressShowOverApps to TvExtender"

parents 243dbafc 1a083939
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -343,11 +343,13 @@ package android.app {
    method public java.lang.String getChannelId();
    method public android.app.PendingIntent getContentIntent();
    method public android.app.PendingIntent getDeleteIntent();
    method public boolean getSuppressShowOverApps();
    method public boolean isAvailableOnTv();
    method public android.app.Notification.TvExtender setChannel(java.lang.String);
    method public android.app.Notification.TvExtender setChannelId(java.lang.String);
    method public android.app.Notification.TvExtender setContentIntent(android.app.PendingIntent);
    method public android.app.Notification.TvExtender setDeleteIntent(android.app.PendingIntent);
    method public android.app.Notification.TvExtender setSuppressShowOverApps(boolean);
  }

  public final class NotificationChannel implements android.os.Parcelable {
+21 −0
Original line number Diff line number Diff line
@@ -8862,6 +8862,7 @@ public class Notification implements Parcelable
        private static final String EXTRA_CONTENT_INTENT = "content_intent";
        private static final String EXTRA_DELETE_INTENT = "delete_intent";
        private static final String EXTRA_CHANNEL_ID = "channel_id";
        private static final String EXTRA_SUPPRESS_SHOW_OVER_APPS = "suppressShowOverApps";

        // Flags bitwise-ored to mFlags
        private static final int FLAG_AVAILABLE_ON_TV = 0x1;
@@ -8870,6 +8871,7 @@ public class Notification implements Parcelable
        private String mChannelId;
        private PendingIntent mContentIntent;
        private PendingIntent mDeleteIntent;
        private boolean mSuppressShowOverApps;

        /**
         * Create a {@link TvExtender} with default options.
@@ -8889,6 +8891,7 @@ public class Notification implements Parcelable
            if (bundle != null) {
                mFlags = bundle.getInt(EXTRA_FLAGS);
                mChannelId = bundle.getString(EXTRA_CHANNEL_ID);
                mSuppressShowOverApps = bundle.getBoolean(EXTRA_SUPPRESS_SHOW_OVER_APPS);
                mContentIntent = bundle.getParcelable(EXTRA_CONTENT_INTENT);
                mDeleteIntent = bundle.getParcelable(EXTRA_DELETE_INTENT);
            }
@@ -8905,6 +8908,7 @@ public class Notification implements Parcelable

            bundle.putInt(EXTRA_FLAGS, mFlags);
            bundle.putString(EXTRA_CHANNEL_ID, mChannelId);
            bundle.putBoolean(EXTRA_SUPPRESS_SHOW_OVER_APPS, mSuppressShowOverApps);
            if (mContentIntent != null) {
                bundle.putParcelable(EXTRA_CONTENT_INTENT, mContentIntent);
            }
@@ -8997,6 +9001,23 @@ public class Notification implements Parcelable
        public PendingIntent getDeleteIntent() {
            return mDeleteIntent;
        }

        /**
         * Specifies whether this notification should suppress showing a message over top of apps
         * outside of the launcher.
         */
        public TvExtender setSuppressShowOverApps(boolean suppress) {
            mSuppressShowOverApps = suppress;
            return this;
        }

        /**
         * Returns true if this notification should not show messages over top of apps
         * outside of the launcher.
         */
        public boolean getSuppressShowOverApps() {
            return mSuppressShowOverApps;
        }
    }

    /**