summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorHongwei Wang <hwwang@google.com>2019-09-17 16:42:37 +0000
committerHongwei Wang <hwwang@google.com>2019-09-17 09:48:36 -0700
commit7759895ee6691e8335fa17a16d4ac29ea3eb6190 (patch)
tree1602a2639afb7538a581a3b444af01b3e92c31bb /core/java/android
parent92720e103385f525e9c6383cf755431f3307c8ca (diff)
Revert "Move bounds calculation and snap fraction to SysUI"
This reverts commit e3ff139062e6aac658ac54f5e11b9d22e540d600. Reason for revert: PinnedStackTests#testEnterPictureInPictureDiscardSavedPositionOnFinish flaky Change-Id: I067c94d536b1db94523ef3eec3d443e0dc4cb575
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/IPinnedStackController.aidl18
-rw-r--r--core/java/android/view/IPinnedStackListener.aidl62
2 files changed, 18 insertions, 62 deletions
diff --git a/core/java/android/view/IPinnedStackController.aidl b/core/java/android/view/IPinnedStackController.aidl
index f1d152ba29af..d2dcb568ef6c 100644
--- a/core/java/android/view/IPinnedStackController.aidl
+++ b/core/java/android/view/IPinnedStackController.aidl
@@ -16,8 +16,6 @@
package android.view;
-import android.graphics.Rect;
-
/**
* An interface to the PinnedStackController to update it of state changes, and to query
* information based on the current state.
@@ -32,17 +30,15 @@ interface IPinnedStackController {
oneway void setIsMinimized(boolean isMinimized);
/**
- * @return what WM considers to be the current device rotation.
+ * Notifies the controller of the current min edge size, this is needed to allow the system to
+ * properly calculate the aspect ratio of the expanded PIP. The given {@param minEdgeSize} is
+ * always bounded to be larger than the default minEdgeSize, so the caller can call this method
+ * with 0 to reset to the default size.
*/
- int getDisplayRotation();
+ oneway void setMinEdgeSize(int minEdgeSize);
/**
- * Notifies the controller to actually start the PiP animation.
- * The bounds would be calculated based on the last save reentry fraction internally.
- * {@param destinationBounds} is the stack bounds of the final PiP window
- * and {@param sourceRectHint} is the source bounds hint used when entering picture-in-picture,
- * expect the same bound passed via IPinnedStackListener#onPrepareAnimation.
- * {@param animationDuration} suggests the animation duration transitioning to PiP window.
+ * @return what WM considers to be the current device rotation.
*/
- void startAnimation(in Rect destinationBounds, in Rect sourceRectHint, int animationDuration);
+ int getDisplayRotation();
}
diff --git a/core/java/android/view/IPinnedStackListener.aidl b/core/java/android/view/IPinnedStackListener.aidl
index 806d81e39cca..2da353b1f0ee 100644
--- a/core/java/android/view/IPinnedStackListener.aidl
+++ b/core/java/android/view/IPinnedStackListener.aidl
@@ -16,10 +16,8 @@
package android.view;
-import android.content.ComponentName;
import android.content.pm.ParceledListSlice;
import android.graphics.Rect;
-import android.view.DisplayInfo;
import android.view.IPinnedStackController;
/**
@@ -38,13 +36,18 @@ oneway interface IPinnedStackListener {
/**
* Called when the window manager has detected a change that would cause the movement bounds
* to be changed (ie. after configuration change, aspect ratio change, etc). It then provides
- * the components that allow the listener to calculate the movement bounds itself.
- * The {@param animatingBounds} are provided to indicate the current target bounds of the
- * pinned stack (the final bounds if animating, the current bounds if not),
- * which may be helpful in calculating dependent animation bounds.
+ * the components that allow the listener to calculate the movement bounds itself. The
+ * {@param normalBounds} are also the default bounds that the PiP would be entered in its
+ * current state with the aspect ratio applied. The {@param animatingBounds} are provided
+ * to indicate the current target bounds of the pinned stack (the final bounds if animating,
+ * the current bounds if not), which may be helpful in calculating dependent animation bounds.
+ *
+ * The {@param displayRotation} is provided so that the client can verify when making certain
+ * calls that it will not provide stale information based on an old display rotation (ie. if
+ * the WM has changed in the mean time but the client has not received onMovementBoundsChanged).
*/
- void onMovementBoundsChanged(in Rect animatingBounds, boolean fromImeAdjustment,
- boolean fromShelfAdjustment);
+ void onMovementBoundsChanged(in Rect insetBounds, in Rect normalBounds, in Rect animatingBounds,
+ boolean fromImeAdjustment, boolean fromShelfAdjustment, int displayRotation);
/**
* Called when window manager decides to adjust the pinned stack bounds because of the IME, or
@@ -73,47 +76,4 @@ oneway interface IPinnedStackListener {
* is first registered to allow the listener to synchronized its state with the controller.
*/
void onActionsChanged(in ParceledListSlice actions);
-
- /**
- * Called by the window manager to notify the listener to save the reentry fraction,
- * typically when an Activity leaves PiP (picture-in-picture) mode to fullscreen.
- * {@param componentName} represents the application component of PiP window
- * while {@param bounds} is the current PiP bounds used to calculate the
- * reentry snap fraction.
- */
- void onSaveReentrySnapFraction(in ComponentName componentName, in Rect bounds);
-
- /**
- * Called by the window manager to notify the listener to reset saved reentry fraction,
- * typically when an Activity enters PiP (picture-in-picture) mode from fullscreen.
- * {@param componentName} represents the application component of PiP window.
- */
- void onResetReentrySnapFraction(in ComponentName componentName);
-
- /**
- * Called when the window manager has detected change on DisplayInfo, or
- * when the listener is first registered to allow the listener to synchronized its state with
- * the controller.
- */
- void onDisplayInfoChanged(in DisplayInfo displayInfo);
-
- /**
- * Called by the window manager at the beginning of a configuration update cascade
- * since the metrics from these resources are used for bounds calculations.
- */
- void onConfigurationChanged();
-
- /**
- * Called by the window manager when the aspect ratio is reset.
- */
- void onAspectRatioChanged(float aspectRatio);
-
- /**
- * Called by the window manager to notify the listener to prepare for PiP animation.
- * Internally, the target bounds would be calculated from the given {@param aspectRatio}
- * and {@param bounds}, the saved reentry snap fraction also contributes.
- * Caller would wait for a IPinnedStackController#startAnimation callback to actually
- * start the animation, see details in IPinnedStackController.
- */
- void onPrepareAnimation(in Rect sourceRectHint, float aspectRatio, in Rect bounds);
}