Move bounds calculation and snap fraction to SysUI
Major changes in this CL
- Added PipBoundsHandler in SysUI package handles the bounds calculation
and save/restore the snap fraction
- Added IPinnedStackListener.onSaveReentrySnapFraction and
IPinnedStackListener.onResetReentrySnapFration, both called from
PinnedStackController (WM) to SysUI
- Added IPinnedStackListener.onPrepareAnimation, called from WM to
SysUI to notify that an animation for pinned stack is about to happen
- Added IPinnedStackController.startAnimation, called from SysUI to WM
to actually start the pinned stack animation
- Updated tv/PipManager to use PipBoundsHandler as well
Known issues and what's next
- Shelf height is set after the animation is started, therefore one may
notice the PiP window is hovering over the shelf. This is tracked
separatedly by b/139016518
- Bounds calculations still exist in PinnedStackController since
onTaskStackChanged callback requires so. Once we addressed b/139016833
(move rotation bounds calculation to SysUI), they should be all gone.
- Move the pinned stack animation from WM to SysUI and we can furthre
remove IPinnedStackListener.onPrepareAnimation and
IPinnedStackController.startAnimation
More details: go/pip-sysui-migration
Bug: 139015463
Bug: 139015142
Test: atest PinnedStackTests
Test: atest PinnedStackControllerTest
Change-Id: Ib62d8152ecc7b18a671ec403af44cc517612169e
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
index 67fc3e3..43576a4 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
@@ -48,7 +48,6 @@
import android.app.PendingIntent;
import android.content.Context;
import android.content.pm.ActivityInfo;
-import android.content.pm.ParceledListSlice;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.RemoteException;
@@ -61,8 +60,6 @@
import android.util.Pair;
import android.util.SparseSetArray;
import android.view.Display;
-import android.view.IPinnedStackController;
-import android.view.IPinnedStackListener;
import android.view.ViewGroup;
import android.widget.FrameLayout;
@@ -76,6 +73,7 @@
import com.android.systemui.R;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.shared.system.ActivityManagerWrapper;
+import com.android.systemui.shared.system.PinnedStackListenerForwarder;
import com.android.systemui.shared.system.TaskStackChangeListener;
import com.android.systemui.shared.system.WindowManagerWrapper;
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
@@ -993,32 +991,12 @@
}
/** PinnedStackListener that dispatches IME visibility updates to the stack. */
- private class BubblesImeListener extends IPinnedStackListener.Stub {
-
- @Override
- public void onListenerRegistered(IPinnedStackController controller) throws RemoteException {
- }
-
- @Override
- public void onMovementBoundsChanged(Rect insetBounds, Rect normalBounds,
- Rect animatingBounds, boolean fromImeAdjustment, boolean fromShelfAdjustment,
- int displayRotation) throws RemoteException {}
-
+ private class BubblesImeListener extends PinnedStackListenerForwarder.PinnedStackListener {
@Override
public void onImeVisibilityChanged(boolean imeVisible, int imeHeight) {
if (mStackView != null && mStackView.getBubbleCount() > 0) {
mStackView.post(() -> mStackView.onImeVisibilityChanged(imeVisible, imeHeight));
}
}
-
- @Override
- public void onShelfVisibilityChanged(boolean shelfVisible, int shelfHeight)
- throws RemoteException {}
-
- @Override
- public void onMinimizedStateChanged(boolean isMinimized) throws RemoteException {}
-
- @Override
- public void onActionsChanged(ParceledListSlice actions) throws RemoteException {}
}
}