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

Commit 66a2356e authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Enable overflow" into rvc-dev am: 8f24e997 am: 2c3b89e0

Change-Id: I081ce1cdefe4a37ddd3bedf7a276df1227fa286b
parents ef8ebae6 2c3b89e0
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -73,9 +73,6 @@ public class BubbleExperimentConfig {

    private static final String WHITELISTED_AUTO_BUBBLE_APPS = "whitelisted_auto_bubble_apps";

    private static final String ALLOW_BUBBLE_OVERFLOW = "allow_bubble_overflow";
    private static final boolean ALLOW_BUBBLE_OVERFLOW_DEFAULT = false;

    /**
     * When true, if a notification has the information necessary to bubble (i.e. valid
     * contentIntent and an icon or image), then a {@link android.app.Notification.BubbleMetadata}
@@ -130,16 +127,6 @@ public class BubbleExperimentConfig {
        return false;
    }

    /**
     * When true, show a menu when a bubble is long-pressed, which will allow the user to take
     * actions on that bubble.
     */
    static boolean allowBubbleOverflow(Context context) {
        return Settings.Secure.getInt(context.getContentResolver(),
                ALLOW_BUBBLE_OVERFLOW,
                ALLOW_BUBBLE_OVERFLOW_DEFAULT ? 1 : 0) != 0;
    }

    /**
     * If {@link #allowAnyNotifToBubble(Context)} is true, this method creates and adds
     * {@link android.app.Notification.BubbleMetadata} to the notification entry as long as
+4 −15
Original line number Diff line number Diff line
@@ -520,9 +520,6 @@ public class BubbleStackView extends FrameLayout {
    }

    private void setUpOverflow() {
        if (!BubbleExperimentConfig.allowBubbleOverflow(mContext)) {
            return;
        }
        int overflowBtnIndex = 0;
        if (mBubbleOverflow == null) {
            mBubbleOverflow = new BubbleOverflow(mContext);
@@ -733,8 +730,7 @@ public class BubbleStackView extends FrameLayout {
    @Nullable
    Bubble getExpandedBubble() {
        if (mExpandedBubble == null
                || (BubbleExperimentConfig.allowBubbleOverflow(mContext)
                    && mExpandedBubble.getIconView() == mBubbleOverflow.getBtn()
                || (mExpandedBubble.getIconView() == mBubbleOverflow.getBtn()
                    && mExpandedBubble.getKey() == BubbleOverflow.KEY)) {
            return null;
        }
@@ -785,9 +781,6 @@ public class BubbleStackView extends FrameLayout {
    }

    private void updateOverflowBtnVisibility(boolean apply) {
        if (!BubbleExperimentConfig.allowBubbleOverflow(mContext)) {
            return;
        }
        if (mIsExpanded) {
            if (DEBUG_BUBBLE_STACK_VIEW) {
                Log.d(TAG, "Show overflow button.");
@@ -911,8 +904,7 @@ public class BubbleStackView extends FrameLayout {
        float y = event.getRawY();
        if (mIsExpanded) {
            if (isIntersecting(mBubbleContainer, x, y)) {
                if (BubbleExperimentConfig.allowBubbleOverflow(mContext)
                        && isIntersecting(mBubbleOverflow.getBtn(), x, y)) {
                if (isIntersecting(mBubbleOverflow.getBtn(), x, y)) {
                    return mBubbleOverflow.getBtn();
                }
                // Could be tapping or dragging a bubble while expanded
@@ -1645,12 +1637,9 @@ public class BubbleStackView extends FrameLayout {
     * @return the number of bubbles in the stack view.
     */
    public int getBubbleCount() {
        if (BubbleExperimentConfig.allowBubbleOverflow(mContext)) {
            // Subtract 1 for the overflow button which is always in the bubble container.
        // Subtract 1 for the overflow button that is always in the bubble container.
        return mBubbleContainer.getChildCount() - 1;
    }
        return mBubbleContainer.getChildCount();
    }

    /**
     * Finds the bubble index within the stack.