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

Commit 8b1c3365 authored by Mady Mellor's avatar Mady Mellor Committed by Automerger Merge Worker
Browse files

Merge "Fix tests - needed a reasonable max set in bubble positioner" into sc-dev am: 4de2f908

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15002365

Change-Id: Ibbf649e9a2713b694da2719fdc14d7e5de4e83ed
parents 958a05c7 4de2f908
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -288,6 +288,7 @@ public class BubblesTest extends SysuiTestCase {

        // TODO: Fix
        mPositioner = new TestableBubblePositioner(mContext, mWindowManager);
        mPositioner.setMaxBubbles(5);
        mBubbleData = new BubbleData(mContext, mBubbleLogger, mPositioner, syncExecutor);

        TestableNotificationInterruptStateProviderImpl interruptionStateProvider =
+1 −0
Original line number Diff line number Diff line
@@ -233,6 +233,7 @@ public class NewNotifPipelineBubblesTest extends SysuiTestCase {
        when(mZenModeController.getConfig()).thenReturn(mZenModeConfig);

        mPositioner = new TestableBubblePositioner(mContext, mWindowManager);
        mPositioner.setMaxBubbles(5);
        mBubbleData = new BubbleData(mContext, mBubbleLogger, mPositioner, syncExecutor);

        TestableNotificationInterruptStateProviderImpl interruptionStateProvider =
+12 −0
Original line number Diff line number Diff line
@@ -22,9 +22,11 @@ import android.graphics.Insets;
import android.graphics.Rect;
import android.view.WindowManager;

import com.android.wm.shell.R;
import com.android.wm.shell.bubbles.BubblePositioner;

public class TestableBubblePositioner extends BubblePositioner {
    private int mMaxBubbles;

    public TestableBubblePositioner(Context context,
            WindowManager windowManager) {
@@ -33,5 +35,15 @@ public class TestableBubblePositioner extends BubblePositioner {
        updateInternal(Configuration.ORIENTATION_PORTRAIT,
                Insets.of(0, 0, 0, 0),
                new Rect(0, 0, 500, 1000));
        mMaxBubbles = context.getResources().getInteger(R.integer.bubbles_max_rendered);
    }

    public void setMaxBubbles(int max) {
        mMaxBubbles = max;
    }

    @Override
    public int getMaxBubbles() {
        return mMaxBubbles;
    }
}