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

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

Merge "Interface for providing SysuiProxy" into main

parents 759f48e5 d1b02b39
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@ import java.util.function.IntConsumer;
 * The controller manages addition, removal, and visible state of bubbles on screen.
 */
public class BubbleController implements ConfigurationChangeListener,
        RemoteCallable<BubbleController> {
        RemoteCallable<BubbleController>, Bubbles.SysuiProxy.Provider {

    private static final String TAG = TAG_WITH_CLASS_NAME ? "BubbleController" : TAG_BUBBLES;

@@ -706,6 +706,7 @@ public class BubbleController implements ConfigurationChangeListener,
        return mBubbleIconFactory;
    }

    @Override
    public Bubbles.SysuiProxy getSysuiProxy() {
        return mSysuiProxy;
    }
@@ -732,8 +733,7 @@ public class BubbleController implements ConfigurationChangeListener,
            if (mStackView == null) {
                mStackView = new BubbleStackView(
                        mContext, this, mBubbleData, mSurfaceSynchronizer,
                        mFloatingContentCoordinator,
                        mMainExecutor);
                        mFloatingContentCoordinator, this, mMainExecutor);
                mStackView.onOrientationChanged();
                if (mExpandListener != null) {
                    mStackView.setExpandListener(mExpandListener);
+6 −3
Original line number Diff line number Diff line
@@ -206,6 +206,7 @@ public class BubbleStackView extends FrameLayout
            };
    private final BubbleController mBubbleController;
    private final BubbleData mBubbleData;
    private final Bubbles.SysuiProxy.Provider mSysuiProxyProvider;
    private StackViewState mStackViewState = new StackViewState();

    private final ValueAnimator mDismissBubbleAnimator;
@@ -875,12 +876,14 @@ public class BubbleStackView extends FrameLayout
    public BubbleStackView(Context context, BubbleController bubbleController,
            BubbleData data, @Nullable SurfaceSynchronizer synchronizer,
            FloatingContentCoordinator floatingContentCoordinator,
            Bubbles.SysuiProxy.Provider sysuiProxyProvider,
            ShellExecutor mainExecutor) {
        super(context);

        mMainExecutor = mainExecutor;
        mBubbleController = bubbleController;
        mBubbleData = data;
        mSysuiProxyProvider = sysuiProxyProvider;

        Resources res = getResources();
        mBubbleSize = res.getDimensionPixelSize(R.dimen.bubble_size);
@@ -2090,7 +2093,7 @@ public class BubbleStackView extends FrameLayout

        hideCurrentInputMethod();

        mBubbleController.getSysuiProxy().onStackExpandChanged(shouldExpand);
        mSysuiProxyProvider.getSysuiProxy().onStackExpandChanged(shouldExpand);

        if (wasExpanded) {
            stopMonitoringSwipeUpGesture();
@@ -3034,7 +3037,7 @@ public class BubbleStackView extends FrameLayout
        if (mExpandedBubble == null || mExpandedBubble.getExpandedView() == null) {
            mManageMenu.setVisibility(View.INVISIBLE);
            mManageMenuScrim.setVisibility(INVISIBLE);
            mBubbleController.getSysuiProxy().onManageMenuExpandChanged(false /* show */);
            mSysuiProxyProvider.getSysuiProxy().onManageMenuExpandChanged(false /* show */);
            return;
        }
        if (show) {
@@ -3048,7 +3051,7 @@ public class BubbleStackView extends FrameLayout
            }
        };

        mBubbleController.getSysuiProxy().onManageMenuExpandChanged(show);
        mSysuiProxyProvider.getSysuiProxy().onManageMenuExpandChanged(show);
        mManageMenuScrim.animate()
                .setInterpolator(show ? ALPHA_IN : ALPHA_OUT)
                .alpha(show ? BUBBLE_EXPANDED_SCRIM_ALPHA : 0f)
+7 −0
Original line number Diff line number Diff line
@@ -321,6 +321,13 @@ public interface Bubbles {

    /** Callback to tell SysUi components execute some methods. */
    interface SysuiProxy {

        /** Provider interface for {@link SysuiProxy}. */
        interface Provider {
            /** Returns {@link SysuiProxy}. */
            SysuiProxy getSysuiProxy();
        }

        void isNotificationPanelExpand(Consumer<Boolean> callback);

        void getPendingOrActiveEntry(String key, Consumer<BubbleEntry> callback);
+1 −1
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ class BubbleViewInfoTest : ShellTestCase() {
                mock<BubbleProperties>())

        bubbleStackView = BubbleStackView(context, bubbleController, bubbleData,
                surfaceSynchronizer, FloatingContentCoordinator(), mainExecutor)
                surfaceSynchronizer, FloatingContentCoordinator(), bubbleController, mainExecutor)
        bubbleBarLayerView = BubbleBarLayerView(context, bubbleController)
    }