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

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

Merge "Make the BubbleBar flag dynamic in wmshell." into main

parents d8f754d9 1426a8ea
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -512,6 +512,7 @@ public class BubbleController implements ConfigurationChangeListener,
     * <p>If bubble bar is supported, bubble views will be updated to switch to bar mode.
     */
    public void registerBubbleStateListener(Bubbles.BubbleStateListener listener) {
        mBubbleProperties.refresh();
        if (canShowAsBubbleBar() && listener != null) {
            // Only set the listener if we can show the bubble bar.
            mBubbleStateListener = listener;
@@ -529,6 +530,7 @@ public class BubbleController implements ConfigurationChangeListener,
     * will be updated accordingly.
     */
    public void unregisterBubbleStateListener() {
        mBubbleProperties.refresh();
        if (mBubbleStateListener != null) {
            mBubbleStateListener = null;
            setUpBubbleViewsForMode();
+3 −0
Original line number Diff line number Diff line
@@ -29,4 +29,7 @@ interface BubbleProperties {
     * When this is `false`, bubbles will be floating.
     */
    val isBubbleBarEnabled: Boolean

    /** Refreshes the current value of [isBubbleBarEnabled]. */
    fun refresh()
}
+8 −2
Original line number Diff line number Diff line
@@ -22,6 +22,12 @@ import android.os.SystemProperties
object ProdBubbleProperties : BubbleProperties {

    // TODO(b/256873975) Should use proper flag when available to shell/launcher
    override val isBubbleBarEnabled =
    private var _isBubbleBarEnabled =
            SystemProperties.getBoolean("persist.wm.debug.bubble_bar", false)

    override val isBubbleBarEnabled = _isBubbleBarEnabled

    override fun refresh() {
        _isBubbleBarEnabled = SystemProperties.getBoolean("persist.wm.debug.bubble_bar", false)
    }
}
+3 −0
Original line number Diff line number Diff line
@@ -2262,5 +2262,8 @@ public class BubblesTest extends SysuiTestCase {
        public boolean isBubbleBarEnabled() {
            return mIsBubbleBarEnabled;
        }

        @Override
        public void refresh() {}
    }
}