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

Commit f6c04504 authored by András Kurucz's avatar András Kurucz Committed by Automerger Merge Worker
Browse files

Merge "Rename Bubble#isClearable to isDismissable" into tm-qpr-dev am: f51c21d8 am: c8a3511d

parents 762ba5b2 c8a3511d
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ public class Bubble implements BubbleViewProvider {
    private Icon mIcon;
    private boolean mIsBubble;
    private boolean mIsTextChanged;
    private boolean mIsClearable;
    private boolean mIsDismissable;
    private boolean mShouldSuppressNotificationDot;
    private boolean mShouldSuppressNotificationList;
    private boolean mShouldSuppressPeek;
@@ -181,7 +181,7 @@ public class Bubble implements BubbleViewProvider {
    @VisibleForTesting(visibility = PRIVATE)
    public Bubble(@NonNull final String key, @NonNull final ShortcutInfo shortcutInfo,
            final int desiredHeight, final int desiredHeightResId, @Nullable final String title,
            int taskId, @Nullable final String locus, boolean isClearable, Executor mainExecutor,
            int taskId, @Nullable final String locus, boolean isDismissable, Executor mainExecutor,
            final Bubbles.BubbleMetadataFlagListener listener) {
        Objects.requireNonNull(key);
        Objects.requireNonNull(shortcutInfo);
@@ -190,7 +190,7 @@ public class Bubble implements BubbleViewProvider {
        mKey = key;
        mGroupKey = null;
        mLocusId = locus != null ? new LocusId(locus) : null;
        mIsClearable = isClearable;
        mIsDismissable = isDismissable;
        mFlags = 0;
        mUser = shortcutInfo.getUserHandle();
        mPackageName = shortcutInfo.getPackage();
@@ -248,8 +248,8 @@ public class Bubble implements BubbleViewProvider {
    }

    @Hide
    public boolean isClearable() {
        return mIsClearable;
    public boolean isDismissable() {
        return mIsDismissable;
    }

    /**
@@ -533,7 +533,7 @@ public class Bubble implements BubbleViewProvider {
            mDeleteIntent = entry.getBubbleMetadata().getDeleteIntent();
        }

        mIsClearable = entry.isClearable();
        mIsDismissable = entry.isDismissable();
        mShouldSuppressNotificationDot = entry.shouldSuppressNotificationDot();
        mShouldSuppressNotificationList = entry.shouldSuppressNotificationList();
        mShouldSuppressPeek = entry.shouldSuppressPeek();
@@ -612,7 +612,7 @@ public class Bubble implements BubbleViewProvider {
     * Whether this notification should be shown in the shade.
     */
    boolean showInShade() {
        return !shouldSuppressNotification() || !mIsClearable;
        return !shouldSuppressNotification() || !mIsDismissable;
    }

    /**
@@ -877,7 +877,7 @@ public class Bubble implements BubbleViewProvider {
        pw.print("  desiredHeight: "); pw.println(getDesiredHeightString());
        pw.print("  suppressNotif: "); pw.println(shouldSuppressNotification());
        pw.print("  autoExpand:    "); pw.println(shouldAutoExpand());
        pw.print("  isClearable:   "); pw.println(mIsClearable);
        pw.print("  isDismissable: "); pw.println(mIsDismissable);
        pw.println("  bubbleMetadataFlagListener null: " + (mBubbleMetadataFlagListener == null));
        if (mExpandedView != null) {
            mExpandedView.dump(pw);
+2 −2
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ internal class BubbleDataRepository(
                    b.title,
                    b.taskId,
                    b.locusId?.id,
                    b.isClearable
                    b.isDismissable
            )
        }
    }
@@ -206,7 +206,7 @@ internal class BubbleDataRepository(
                                entity.title,
                                entity.taskId,
                                entity.locus,
                                entity.isClearable,
                                entity.isDismissable,
                                mainExecutor,
                                bubbleMetadataFlagListener
                        )
+6 −6
Original line number Diff line number Diff line
@@ -38,18 +38,18 @@ public class BubbleEntry {
    private StatusBarNotification mSbn;
    private Ranking mRanking;

    private boolean mIsClearable;
    private boolean mIsDismissable;
    private boolean mShouldSuppressNotificationDot;
    private boolean mShouldSuppressNotificationList;
    private boolean mShouldSuppressPeek;

    public BubbleEntry(@NonNull StatusBarNotification sbn,
            Ranking ranking, boolean isClearable, boolean shouldSuppressNotificationDot,
            Ranking ranking, boolean isDismissable, boolean shouldSuppressNotificationDot,
            boolean shouldSuppressNotificationList, boolean shouldSuppressPeek) {
        mSbn = sbn;
        mRanking = ranking;

        mIsClearable = isClearable;
        mIsDismissable = isDismissable;
        mShouldSuppressNotificationDot = shouldSuppressNotificationDot;
        mShouldSuppressNotificationList = shouldSuppressNotificationList;
        mShouldSuppressPeek = shouldSuppressPeek;
@@ -115,9 +115,9 @@ public class BubbleEntry {
        return mRanking.canBubble();
    }

    /** @return true if this notification is clearable. */
    public boolean isClearable() {
        return mIsClearable;
    /** @return true if this notification can be dismissed. */
    public boolean isDismissable() {
        return mIsDismissable;
    }

    /** @return true if {@link Policy#SUPPRESSED_EFFECT_BADGE} set for this notification. */
+1 −1
Original line number Diff line number Diff line
@@ -28,5 +28,5 @@ data class BubbleEntity(
    val title: String? = null,
    val taskId: Int,
    val locus: String? = null,
    val isClearable: Boolean = false
    val isDismissable: Boolean = false
)
+3 −5
Original line number Diff line number Diff line
@@ -43,9 +43,7 @@ private const val ATTR_DESIRED_HEIGHT_RES_ID = "hid"
private const val ATTR_TITLE = "t"
private const val ATTR_TASK_ID = "tid"
private const val ATTR_LOCUS = "l"

// TODO rename it to dismissable to follow NotificationEntry namings
private const val ATTR_CLEARABLE = "d"
private const val ATTR_DISMISSABLE = "d"

/**
 * Writes the bubbles in xml format into given output stream.
@@ -87,7 +85,7 @@ private fun writeXmlEntry(serializer: XmlSerializer, bubble: BubbleEntity) {
        bubble.title?.let { serializer.attribute(null, ATTR_TITLE, it) }
        serializer.attribute(null, ATTR_TASK_ID, bubble.taskId.toString())
        bubble.locus?.let { serializer.attribute(null, ATTR_LOCUS, it) }
        serializer.attribute(null, ATTR_CLEARABLE, bubble.isClearable.toString())
        serializer.attribute(null, ATTR_DISMISSABLE, bubble.isDismissable.toString())
        serializer.endTag(null, TAG_BUBBLE)
    } catch (e: IOException) {
        throw RuntimeException(e)
@@ -147,7 +145,7 @@ private fun readXmlEntry(parser: XmlPullParser): BubbleEntity? {
            parser.getAttributeWithName(ATTR_TITLE),
            parser.getAttributeWithName(ATTR_TASK_ID)?.toInt() ?: INVALID_TASK_ID,
            parser.getAttributeWithName(ATTR_LOCUS),
            parser.getAttributeWithName(ATTR_CLEARABLE)?.toBoolean() ?: false
            parser.getAttributeWithName(ATTR_DISMISSABLE)?.toBoolean() ?: false
    )
}

Loading