Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +4 −2 Original line number Diff line number Diff line Loading @@ -710,6 +710,7 @@ public class BubbleController implements ConfigurationChangeListener, @VisibleForTesting public void setLauncherHasBubbleBar(boolean launcherHasBubbleBar) { if (launcherHasBubbleBar == mLauncherHasBubbleBar) return; ProtoLog.d(WM_SHELL_BUBBLES, "setLauncherHasBubbleBar=%b", launcherHasBubbleBar); mLauncherHasBubbleBar = launcherHasBubbleBar; if (mLauncherHasBubbleBar) { setUpBubbleViewsForMode(); Loading Loading @@ -2962,7 +2963,6 @@ public class BubbleController implements ConfigurationChangeListener, pw.print(prefix); pw.println(" bubbleStateListenerSet= " + (mBubbleStateListener != null)); pw.print(prefix); pw.println(" stackViewSet= " + (mStackView != null)); pw.print(prefix); pw.println(" layerViewSet= " + (mLayerView != null)); pw.print(prefix); pw.println(" isImeVisible= " + mBubblePositioner.isImeVisible()); pw.println(); mBubbleData.dump(pw); Loading @@ -2974,9 +2974,11 @@ public class BubbleController implements ConfigurationChangeListener, pw.println(); mImpl.mCachedState.dump(pw); pw.println(); mBubbleTransitions.mTaskViewTransitions.dump(pw); mBubblePositioner.dump(pw); } /** Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java +22 −7 Original line number Diff line number Diff line Loading @@ -25,7 +25,6 @@ import android.graphics.Insets; import android.graphics.PointF; import android.graphics.Rect; import android.graphics.RectF; import android.view.Surface; import android.view.WindowManager; import androidx.annotation.NonNull; Loading @@ -38,6 +37,8 @@ import com.android.wm.shell.shared.bubbles.BubbleBarLocation; import com.android.wm.shell.shared.bubbles.BubbleDropTargetBoundsProvider; import com.android.wm.shell.shared.bubbles.DeviceConfig; import java.io.PrintWriter; /** * Keeps track of display size, configuration, and specific bubble sizes. One place for all * placement and positioning calculations to refer to. Loading Loading @@ -68,7 +69,6 @@ public class BubblePositioner implements BubbleDropTargetBoundsProvider { private Context mContext; private DeviceConfig mDeviceConfig; private Rect mScreenRect; private @Surface.Rotation int mRotation = Surface.ROTATION_0; private Insets mInsets; private boolean mImeVisible; /** Loading Loading @@ -132,12 +132,12 @@ public class BubblePositioner implements BubbleDropTargetBoundsProvider { public void update(DeviceConfig deviceConfig) { mDeviceConfig = deviceConfig; ProtoLog.d(WM_SHELL_BUBBLES, "update positioner: " + "rotation=%d insets=%s largeScreen=%b " + "insets=%s largeScreen=%b " + "smallTablet=%b isBubbleBar=%b bounds=%s", mRotation, deviceConfig.getInsets(), deviceConfig.isLargeScreen(), deviceConfig.getInsets(), deviceConfig.isLargeScreen(), deviceConfig.isSmallTablet(), mShowingInBubbleBar, deviceConfig.getWindowBounds()); updateInternal(mRotation, deviceConfig.getInsets(), deviceConfig.getWindowBounds()); updateInternal(deviceConfig.getInsets(), deviceConfig.getWindowBounds()); } /** Returns the device config being used. */ Loading @@ -146,7 +146,7 @@ public class BubblePositioner implements BubbleDropTargetBoundsProvider { } @VisibleForTesting public void updateInternal(int rotation, Insets insets, Rect bounds) { public void updateInternal(Insets insets, Rect bounds) { BubbleStackView.RelativeStackPosition prevStackPosition = null; if (mRestingStackPosition != null && mScreenRect != null && !mScreenRect.equals(bounds)) { // Save the resting position as a relative position with the previous bounds, at the Loading @@ -154,7 +154,6 @@ public class BubblePositioner implements BubbleDropTargetBoundsProvider { prevStackPosition = new BubbleStackView.RelativeStackPosition(getRestingPosition(), getAllowableStackPositionRegion(1)); } mRotation = rotation; mInsets = insets; mScreenRect = new Rect(bounds); Loading Loading @@ -1045,4 +1044,20 @@ public class BubblePositioner implements BubbleDropTargetBoundsProvider { } return bounds; } /** Description of current positioner state. */ void dump(PrintWriter pw) { pw.println("BubblePositioner state:"); pw.println(" mScreenRect= " + mScreenRect); pw.println(" mPositionRect= " + mPositionRect); pw.println(" mInsets= " + mInsets); pw.println(" mImeVisible= " + mImeVisible); pw.println(" mImeHeight= " + mImeHeight); pw.println(" mMaxBubbles= " + mMaxBubbles); pw.println(" mRestingStackPosition= " + mRestingStackPosition); pw.println(" mShowingInBubbleBar= " + mShowingInBubbleBar); pw.println(" mBubbleBarLocation= " + mBubbleBarLocation); pw.println(" mBubbleBarTopOnScreen= " + mBubbleBarTopOnScreen); pw.println(); } } libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/TestableBubblePositioner.java +1 −3 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.wm.shell.bubbles; import android.content.Context; import android.content.res.Configuration; import android.graphics.Insets; import android.graphics.Rect; import android.view.WindowManager; Loading @@ -31,8 +30,7 @@ public class TestableBubblePositioner extends BubblePositioner { WindowManager windowManager) { super(context, windowManager); updateInternal(Configuration.ORIENTATION_PORTRAIT, Insets.of(0, 0, 0, 0), updateInternal(Insets.of(0, 0, 0, 0), new Rect(0, 0, 500, 1000)); mMaxBubbles = context.getResources().getInteger(R.integer.bubbles_max_rendered); } Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/animation/ExpandedAnimationControllerTest.java +1 −3 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Insets; import android.graphics.PointF; Loading Loading @@ -67,8 +66,7 @@ public class ExpandedAnimationControllerTest extends PhysicsAnimationLayoutTestC mPositioner = new BubblePositioner(getContext(), getContext().getSystemService(WindowManager.class)); mPositioner.updateInternal(Configuration.ORIENTATION_PORTRAIT, Insets.of(0, 0, 0, 0), mPositioner.updateInternal(Insets.of(0, 0, 0, 0), new Rect(0, 0, 500, 1000)); BubbleStackView stackView = mock(BubbleStackView.class); Loading packages/SystemUI/multivalentTests/src/com/android/systemui/wmshell/TestableBubblePositioner.java +1 −3 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.systemui.wmshell; import android.content.Context; import android.content.res.Configuration; import android.graphics.Insets; import android.graphics.Rect; import android.view.WindowManager; Loading @@ -33,8 +32,7 @@ public class TestableBubblePositioner extends BubblePositioner { WindowManager windowManager) { super(context, windowManager); updateInternal(Configuration.ORIENTATION_PORTRAIT, Insets.of(0, 0, 0, 0), updateInternal(Insets.of(0, 0, 0, 0), new Rect(0, 0, 500, 1000)); mMaxBubbles = context.getResources().getInteger(R.integer.bubbles_max_rendered); } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +4 −2 Original line number Diff line number Diff line Loading @@ -710,6 +710,7 @@ public class BubbleController implements ConfigurationChangeListener, @VisibleForTesting public void setLauncherHasBubbleBar(boolean launcherHasBubbleBar) { if (launcherHasBubbleBar == mLauncherHasBubbleBar) return; ProtoLog.d(WM_SHELL_BUBBLES, "setLauncherHasBubbleBar=%b", launcherHasBubbleBar); mLauncherHasBubbleBar = launcherHasBubbleBar; if (mLauncherHasBubbleBar) { setUpBubbleViewsForMode(); Loading Loading @@ -2962,7 +2963,6 @@ public class BubbleController implements ConfigurationChangeListener, pw.print(prefix); pw.println(" bubbleStateListenerSet= " + (mBubbleStateListener != null)); pw.print(prefix); pw.println(" stackViewSet= " + (mStackView != null)); pw.print(prefix); pw.println(" layerViewSet= " + (mLayerView != null)); pw.print(prefix); pw.println(" isImeVisible= " + mBubblePositioner.isImeVisible()); pw.println(); mBubbleData.dump(pw); Loading @@ -2974,9 +2974,11 @@ public class BubbleController implements ConfigurationChangeListener, pw.println(); mImpl.mCachedState.dump(pw); pw.println(); mBubbleTransitions.mTaskViewTransitions.dump(pw); mBubblePositioner.dump(pw); } /** Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java +22 −7 Original line number Diff line number Diff line Loading @@ -25,7 +25,6 @@ import android.graphics.Insets; import android.graphics.PointF; import android.graphics.Rect; import android.graphics.RectF; import android.view.Surface; import android.view.WindowManager; import androidx.annotation.NonNull; Loading @@ -38,6 +37,8 @@ import com.android.wm.shell.shared.bubbles.BubbleBarLocation; import com.android.wm.shell.shared.bubbles.BubbleDropTargetBoundsProvider; import com.android.wm.shell.shared.bubbles.DeviceConfig; import java.io.PrintWriter; /** * Keeps track of display size, configuration, and specific bubble sizes. One place for all * placement and positioning calculations to refer to. Loading Loading @@ -68,7 +69,6 @@ public class BubblePositioner implements BubbleDropTargetBoundsProvider { private Context mContext; private DeviceConfig mDeviceConfig; private Rect mScreenRect; private @Surface.Rotation int mRotation = Surface.ROTATION_0; private Insets mInsets; private boolean mImeVisible; /** Loading Loading @@ -132,12 +132,12 @@ public class BubblePositioner implements BubbleDropTargetBoundsProvider { public void update(DeviceConfig deviceConfig) { mDeviceConfig = deviceConfig; ProtoLog.d(WM_SHELL_BUBBLES, "update positioner: " + "rotation=%d insets=%s largeScreen=%b " + "insets=%s largeScreen=%b " + "smallTablet=%b isBubbleBar=%b bounds=%s", mRotation, deviceConfig.getInsets(), deviceConfig.isLargeScreen(), deviceConfig.getInsets(), deviceConfig.isLargeScreen(), deviceConfig.isSmallTablet(), mShowingInBubbleBar, deviceConfig.getWindowBounds()); updateInternal(mRotation, deviceConfig.getInsets(), deviceConfig.getWindowBounds()); updateInternal(deviceConfig.getInsets(), deviceConfig.getWindowBounds()); } /** Returns the device config being used. */ Loading @@ -146,7 +146,7 @@ public class BubblePositioner implements BubbleDropTargetBoundsProvider { } @VisibleForTesting public void updateInternal(int rotation, Insets insets, Rect bounds) { public void updateInternal(Insets insets, Rect bounds) { BubbleStackView.RelativeStackPosition prevStackPosition = null; if (mRestingStackPosition != null && mScreenRect != null && !mScreenRect.equals(bounds)) { // Save the resting position as a relative position with the previous bounds, at the Loading @@ -154,7 +154,6 @@ public class BubblePositioner implements BubbleDropTargetBoundsProvider { prevStackPosition = new BubbleStackView.RelativeStackPosition(getRestingPosition(), getAllowableStackPositionRegion(1)); } mRotation = rotation; mInsets = insets; mScreenRect = new Rect(bounds); Loading Loading @@ -1045,4 +1044,20 @@ public class BubblePositioner implements BubbleDropTargetBoundsProvider { } return bounds; } /** Description of current positioner state. */ void dump(PrintWriter pw) { pw.println("BubblePositioner state:"); pw.println(" mScreenRect= " + mScreenRect); pw.println(" mPositionRect= " + mPositionRect); pw.println(" mInsets= " + mInsets); pw.println(" mImeVisible= " + mImeVisible); pw.println(" mImeHeight= " + mImeHeight); pw.println(" mMaxBubbles= " + mMaxBubbles); pw.println(" mRestingStackPosition= " + mRestingStackPosition); pw.println(" mShowingInBubbleBar= " + mShowingInBubbleBar); pw.println(" mBubbleBarLocation= " + mBubbleBarLocation); pw.println(" mBubbleBarTopOnScreen= " + mBubbleBarTopOnScreen); pw.println(); } }
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/TestableBubblePositioner.java +1 −3 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.wm.shell.bubbles; import android.content.Context; import android.content.res.Configuration; import android.graphics.Insets; import android.graphics.Rect; import android.view.WindowManager; Loading @@ -31,8 +30,7 @@ public class TestableBubblePositioner extends BubblePositioner { WindowManager windowManager) { super(context, windowManager); updateInternal(Configuration.ORIENTATION_PORTRAIT, Insets.of(0, 0, 0, 0), updateInternal(Insets.of(0, 0, 0, 0), new Rect(0, 0, 500, 1000)); mMaxBubbles = context.getResources().getInteger(R.integer.bubbles_max_rendered); } Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/animation/ExpandedAnimationControllerTest.java +1 −3 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Insets; import android.graphics.PointF; Loading Loading @@ -67,8 +66,7 @@ public class ExpandedAnimationControllerTest extends PhysicsAnimationLayoutTestC mPositioner = new BubblePositioner(getContext(), getContext().getSystemService(WindowManager.class)); mPositioner.updateInternal(Configuration.ORIENTATION_PORTRAIT, Insets.of(0, 0, 0, 0), mPositioner.updateInternal(Insets.of(0, 0, 0, 0), new Rect(0, 0, 500, 1000)); BubbleStackView stackView = mock(BubbleStackView.class); Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/wmshell/TestableBubblePositioner.java +1 −3 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.systemui.wmshell; import android.content.Context; import android.content.res.Configuration; import android.graphics.Insets; import android.graphics.Rect; import android.view.WindowManager; Loading @@ -33,8 +32,7 @@ public class TestableBubblePositioner extends BubblePositioner { WindowManager windowManager) { super(context, windowManager); updateInternal(Configuration.ORIENTATION_PORTRAIT, Insets.of(0, 0, 0, 0), updateInternal(Insets.of(0, 0, 0, 0), new Rect(0, 0, 500, 1000)); mMaxBubbles = context.getResources().getInteger(R.integer.bubbles_max_rendered); } Loading