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

Commit 94d58152 authored by Liran Binyamin's avatar Liran Binyamin Committed by Android (Google) Code Review
Browse files

Merge "API for whether Bubbles can show notifications" into main

parents 5e6846e7 9e287a35
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -2719,6 +2719,15 @@ public class BubbleController implements ConfigurationChangeListener,
                    () -> BubbleController.this.onSensitiveNotificationProtectionStateChanged(
                            sensitiveNotificationProtectionActive));
        }

        @Override
        public boolean canShowBubbleNotification() {
            // in bubble bar mode, when the IME is visible we can't animate new bubbles.
            if (BubbleController.this.isShowingAsBubbleBar()) {
                return !BubbleController.this.mBubblePositioner.getIsImeVisible();
            }
            return true;
        }
    }

    /**
+5 −0
Original line number Diff line number Diff line
@@ -324,6 +324,11 @@ public class BubblePositioner {
        return 0;
    }

    /** Returns whether the IME is visible. */
    public boolean getIsImeVisible() {
        return mImeVisible;
    }

    /** Sets whether the IME is visible. **/
    public void setImeVisible(boolean visible, int height) {
        mImeVisible = visible;
+9 −0
Original line number Diff line number Diff line
@@ -296,6 +296,15 @@ public interface Bubbles {
    void onSensitiveNotificationProtectionStateChanged(
            boolean sensitiveNotificationProtectionActive);

    /**
     * Determines whether Bubbles can show notifications.
     *
     * <p>Normally bubble notifications are shown by Bubbles, but in some cases the bubble
     * notification is suppressed and should be shown by the Notifications pipeline as regular
     * notifications.
     */
    boolean canShowBubbleNotification();

    /**
     * A listener to be notified of bubble state changes, used by launcher to render bubbles in
     * its process.