Merge "Fix tests - needed a reasonable max set in bubble positioner" into sc-dev
This commit is contained in:
@@ -287,6 +287,7 @@ public class BubblesTest extends SysuiTestCase {
|
|||||||
|
|
||||||
// TODO: Fix
|
// TODO: Fix
|
||||||
mPositioner = new TestableBubblePositioner(mContext, mWindowManager);
|
mPositioner = new TestableBubblePositioner(mContext, mWindowManager);
|
||||||
|
mPositioner.setMaxBubbles(5);
|
||||||
mBubbleData = new BubbleData(mContext, mBubbleLogger, mPositioner, syncExecutor);
|
mBubbleData = new BubbleData(mContext, mBubbleLogger, mPositioner, syncExecutor);
|
||||||
|
|
||||||
TestableNotificationInterruptStateProviderImpl interruptionStateProvider =
|
TestableNotificationInterruptStateProviderImpl interruptionStateProvider =
|
||||||
|
|||||||
@@ -232,6 +232,7 @@ public class NewNotifPipelineBubblesTest extends SysuiTestCase {
|
|||||||
when(mZenModeController.getConfig()).thenReturn(mZenModeConfig);
|
when(mZenModeController.getConfig()).thenReturn(mZenModeConfig);
|
||||||
|
|
||||||
mPositioner = new TestableBubblePositioner(mContext, mWindowManager);
|
mPositioner = new TestableBubblePositioner(mContext, mWindowManager);
|
||||||
|
mPositioner.setMaxBubbles(5);
|
||||||
mBubbleData = new BubbleData(mContext, mBubbleLogger, mPositioner, syncExecutor);
|
mBubbleData = new BubbleData(mContext, mBubbleLogger, mPositioner, syncExecutor);
|
||||||
|
|
||||||
TestableNotificationInterruptStateProviderImpl interruptionStateProvider =
|
TestableNotificationInterruptStateProviderImpl interruptionStateProvider =
|
||||||
|
|||||||
@@ -22,9 +22,11 @@ import android.graphics.Insets;
|
|||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
|
||||||
|
import com.android.wm.shell.R;
|
||||||
import com.android.wm.shell.bubbles.BubblePositioner;
|
import com.android.wm.shell.bubbles.BubblePositioner;
|
||||||
|
|
||||||
public class TestableBubblePositioner extends BubblePositioner {
|
public class TestableBubblePositioner extends BubblePositioner {
|
||||||
|
private int mMaxBubbles;
|
||||||
|
|
||||||
public TestableBubblePositioner(Context context,
|
public TestableBubblePositioner(Context context,
|
||||||
WindowManager windowManager) {
|
WindowManager windowManager) {
|
||||||
@@ -33,5 +35,15 @@ public class TestableBubblePositioner extends BubblePositioner {
|
|||||||
updateInternal(Configuration.ORIENTATION_PORTRAIT,
|
updateInternal(Configuration.ORIENTATION_PORTRAIT,
|
||||||
Insets.of(0, 0, 0, 0),
|
Insets.of(0, 0, 0, 0),
|
||||||
new Rect(0, 0, 500, 1000));
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user