History log of /frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
401f78e822898f8cec9f9cbf50e570e9972c006e 16-Jun-2017 Winson Chung <winsonc@google.com> Fixing issue with PiP aspect ratio being clobbered.

- We should only initialize the initial aspect ratio to the default
aspect ratio once, instead of when the resources are reloaded.
Otherwise, they will be clobbered when the configuration changes.
This is a regression from ag/2295004.

Bug: 62702553
Test: Set PiP aspect ratio from landscape-locked activity, ensure that
it stays in that aspect ratio after the pip menu dismisses.

Change-Id: Id82f9081c25c7d6482cf7bcf0268fedb9068eabe
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
a71febe2aaa2796cde538aa21c3e2ff006e7d3f3 22-May-2017 Winson Chung <winsonc@google.com> Fix issue with aspect ratio not applying correctly when PIP is expanded

- The current code always used the default min edge size to calculate the
PIP bounds when the aspect ratio changes, so if a PIP app sets the aspect
ratio in response to the an action, the bounds would be resized down
incorrectly.
- This CL fixes the issue with current aspect ratio not being initialized
correctly, and also ensures that SystemUI always updates the min edge
size when expanding the PIP.

Bug: 38324839
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: go/wm-smoke

Change-Id: Ida0f68b2f8f93f9bf1915dda8762a156704d4709
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
027f4753bcdbef5a830ed877f974701727e98d19 12-May-2017 Wale Ogunwale <ogunwale@google.com> Fixed exceptions during test tearDown

- Acquire WM lock when tearing down test. Prevent the handler thread
from modifying state at the same time.
- Don't set surface boundaries on window states without a surface
control.
- Avoid exception if process can read screen-edge-insets for Pip.

Change-Id: If4a2438032866eaec84ed79c30c1d716e0f89758
Fixes: 38113905
Test: this is it!
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
ef4dc81d508a44b321581db7c2098701da53494d 11-Apr-2017 Winson Chung <winsonc@google.com> Tightening up rotation behavior for PIP (3/3)

- Fixing up edge case when SysUI resizing conflicts with updating the
display rotation bounds. When an interaction causes both a display
rotation and a resize from SystemUI, we should defer the resize animation
until the rotation has been propagated to SystemUI, otherwise the bounds
used will be incorrect.

Bug: 36879891
Test: android.server.cts.ActivityManagerPinnedStackTests
Change-Id: Ife1b7ab0c2f1f11f33cbc9614778ff49a28c79f6
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
32c566fe6e4fca9f41a027352f2ef431342ac3fc 12-Apr-2017 Winson Chung <winsonc@google.com> Fixing missing movement bounds notification to SystemUI.

- When WM updates from a configuration change, ensure that we update the
pinned stack controller even if there is currently no pinned stack.
- Also finish the menu activity once an activity is unpinned.

Bug: 36879891
Test: android.server.cts.ActivityManagerPinnedStackTests
Change-Id: I789945c1783693cf4b4e3d6663548c8669784001
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
40a5f935acea488086ea1b6df7d5d09e74ea518f 14-Apr-2017 Winson Chung <winsonc@google.com> Fixing animating bounds regression.

- Prior to ag/1954388, we used getAnimatingBounds() to get the final target
bounds if animating or the current otherwise, but since we needed the
target bounds to calculate the window scale even after the animation
completes, the clearing of mBoundsAnimationTarget was removed.

This inadvertently broke the check in getAnimatingBounds() from ever
returning the current bounds (as it's never empty)! This CL fixes the
issue, and renames the related methods to better reflect what they are
doing going forward.

This caused a regression when calculating and notifying SysUI of the
movement bounds, which was never the current bounds, but the default
bounds. Leading the IME change to trigger the PIP to move down.

Bug: 37242422
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: Source hint rect animation still works

Change-Id: I532b0928ebfeaf95e9754a0254306af6fbb35833
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
19953caad316a6afc6446bb268bdc062a3f5ab90 11-Apr-2017 Winson Chung <winsonc@google.com> Tightening up rotation behavior for PIP (2/3)

- Change BoundsAnimationController to be more consistent:
1) Ensure that on animation end is always called even when cancelled to
ensure animation start/end parity in the callbacks
2) Ensure that setPinnedStackSize() is only called between start/end
3) Prevent calling setPinnedStackSize() to the final bounds if the
animation is cancelled
- With that, we add a flag to cancel the current bounds animation when a
rotation happens while the bounds are animating. In addition, we also
add a check from AM to WM before applying the resize during the animation
in the case where WM sends the bounds to AM, but AM lock is held while
updating the exact stack bounds (once that finishes the old stale bounds
would have been applied)
- In addition, we can then move the handling of the of the rotation to the
config change update in WM, if we handle it before the other checks.

Bug: 36879891
Test: android.server.cts.ActivityManagerPinnedStackTests
Change-Id: I62c6df8b349971cc82a7898ae8b26834723faec5
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
bd04196f8dd308c3537f4104570c871ad8595c03 07-Mar-2017 Winson Chung <winsonc@google.com> Updating to new aspect ratio limits.

Bug: 35949789
Test: android.server.cts.ActivityManagerPinnedStackTests
Change-Id: Id47bdee0903744efb6aa3200691cd7817463aa13
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
c95ff8433a40eafa422fdf56b782350153f605dd 21-Mar-2017 Winson Chung <winsonc@google.com> Prevent updating aspect ratio unless it is different.

- The old check of the bounds assumed there was no expanded state, so when
a PiP activity tries to set the aspect ratio from a a menu action, it
will cause an animation to the normal bounds again.

Bug: 36462497
Test: Set aspect ratio in pip action handler
Change-Id: Iba5e9571a3024c8369c2a24d32c2d8f34831ede4
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
34a07f43e483767ceae39a1bcdb621ffc3a577a0 11-Mar-2017 Winson Chung <winsonc@google.com> Fix regression in rotation rect being clobbered.

- We should not be using the tmp rect as it's already being used
by the caller in onTaskStackBoundsChanged().

Test: Rotate device while PiP is up.
Change-Id: I826f6379666c72be505185cd0c101b18a8277177
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
baa7b721dc8ee22f8e5f8c373fe6ab1630446f0f 04-Mar-2017 Winson Chung <winsonc@google.com> Small fixes and tweaks to PiP transition.

- Fixing case where default bounds did not account for ime height
- Ensuring that we using the animating/target bounds when calculating
the new ime-offset bounds
- Tweaking transition interpolators and durations

Bug: 35396882
Test: android.server.cts.ActivityManagerPinnedStackTests
Change-Id: Ia22ea0008d834c47a3f26bf2e1f484c72fae8736
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
a7f69740b5b4d74cd0736b05220d2c8633b07a63 03-Feb-2017 Mady Mellor <madym@google.com> Update how PIP size is determined

- minSize = 108dp
- defaultSmallestEdge = max(23% of screen width, minSize)
- the shortest edge of the PIP should be minSize and the rest scales
according to the aspect ratio
- rather than a default PIP size, use default aspect ratio
- adding expand button
- fitting actions to spec

Fixes: 35358504
Test: manually used test app to try different aspect ratios
Change-Id: Ib6890fb7824889b9edeea7efb5b9771e64fc1514
Signed-off-by: Winson Chung <winsonc@google.com>
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
47f2bf605f13eeccf3dbef8b797226262409b824 17-Feb-2017 Winson Chung <winsonc@google.com> Fix PiP being out of bounds when launched into forced orientation

- Ensure that we use the right bounds when calculating the post-rotation
bounds (it should always be the target bounds)
- Ensure that we update the controller when the task stack bounds change

Bug: 35402420
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testEnterPipToOtherOrientation
Change-Id: Ie0e3fc6a93b4eb6250c60584e80afb029b3c599a
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
55893331fb3c23067ede1463fe06c7bb6519141c 18-Feb-2017 Winson Chung <winsonc@google.com> Ensure we use the fullscreen stack bounds when expanding PiP.

- When in split screen, the PiP needs to animate to the fullscreen stack
bounds when expanding.
- Created PinnedStackWindowController to house pinned-stack specific
logic.

Bug: 35396882
Test: Expand PiP activity while split

Change-Id: If7397843743ce11b676f5566eba90e3442289fec
Signed-off-by: Winson Chung <winsonc@google.com>
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
49affea25bcb669d845672f04b1352871c8aa8f6 17-Feb-2017 Winson Chung <winsonc@google.com> Fix trampoline activities when relaunching PiP

- We should be checking the actual launched-from package since that stores
the source package across trampoline activities

Bug: 35458117
Test: Enter PiP from a trampoline activity, launch again from Launcher
and ensure that it is expanded

Change-Id: Ia0e586e8b21dee63b513bd61a41a24e7da4325e1
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
f1f72f6562244b87f76275fb56c34bf3b0e3cec9 15-Feb-2017 Winson Chung <winsonc@google.com> Apply minimized offset when fetching new aspect ratio bounds.

Bug: 35091993
Test: Minimize a PiP activity, and then force it to change aspect ratio
Change-Id: I0edafcdefcb68224ca6b476b13819847b6b932d9
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
2a82fe587b850061ace024d2025047554987c10d 02-Feb-2017 Winson Chung <winsonc@google.com> Refactor PiP logic in preparation for expanded state.

- #1: Move logic for handling IME size changes into SysUI, and only rely
on PinnedStackController to provide bounds when first entering
PiP and on rotation
- #2: Doing #1 allows us to move PipMotionHelper to SysUI completely, which
lets us aggregate the animation calls out of PipTouchHandler
- #3: Add proper callbacks to the listeners when the movement bounds
changed from config change, ime change, or aspect ratio change. This
allows SysUI to calculate the associated movement bounds for the
expanded state, and we can then remove the corresponding WM call.
It also means that SysUI is the only thing that needs to know about
the expanded state.
- #4: Fix issue where TV was getting the default bounds, not taking the
aspect ratio when the PiP was entered into account. Doing #3
allows us to report the right bounds.
- #5: Remove dead code related to edge snapping/minimizing now that they
are on by default and associated tuner setting, and controller
callbacks

Test: android.server.cts.ActivityManagerPinnedStackTests (all existing tests pass)

Change-Id: I3ef361bdf8d44094b4c0a11c70ba4db7d697fdec
Signed-off-by: Winson Chung <winsonc@google.com>
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
3b10dcd2cae2c61a8d39d3e562c76c4070e94822 23-Jan-2017 Mady Mellor <madym@google.com> Update PIP minimize to edge gesture

Updates gesture to match prototype:
- If you fling towards the current edge the PIP is on it is minimized
- Dragging far enough to left or right edge minimizes PIP

Test: manual
Change-Id: I56664e16505b461ad37b181cbb89ee4c6e371aa2
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
c2baac059c42765351745f1e2d46b685fe889db7 11-Jan-2017 Winson Chung <winsonc@google.com> Updating picture-in-picture API.

- Consolidating to enterPictureInPictureMode(), the new method will
attempt to put the activity into picture-in-picture mode if the
activity is visible or pausing in a state that would allow us to
pip it. Also consolidate the setting of the PiP aspect ratio and
actions into setPictureInPictureArgs().
- Fixing issue with onPause not completing when moving the
paused activity between stacks while dispatching onPause

Bug: 33692987
Test: android.server.cts.ActivityManagerPinnedStackTests

Change-Id: I3af2365f31a9b95de4a92eae46b77108947b2a49
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
114aeea51677345daca89c392adaef84d4499bd9 10-Jan-2017 Winson Chung <winsonc@google.com> Ensure we account for insets in minimized state.

- When dragging slightly offscreen to minimize the PIP,
ensure that the bounds take the insets into account so
that the user can still interact with the PIP.

Test: Enter PIP in landscape, try to minimize it.

Change-Id: I093a37ba600722d44e50cc68dac77365a2ba062e
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
a29eb98d9fba99528f0809c448daf2ddae37de7e 14-Dec-2016 Winson Chung <winsonc@google.com> Adding support for PIP actions.

- Introduced generic RemoteAction to represents an action
that can be made across processes with an icon and text
description based on a Notification action.
- Modified PinnedStackController to ensure that it notifies
the listeners from the source of truth, this ensures that
SysUI is in the right state if killed and re-registers
itself.

Test: Enable menu & minimize in SystemUI tuner.
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testNumPipActions

Change-Id: I5b5d0cf9de3f06b5687337d59cfb91e17355bdb1
Signed-off-by: Winson Chung <winsonc@google.com>
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
b5c41b786862618b22e532849ddcca48bdc40025 08-Dec-2016 Winson Chung <winsonc@google.com> Adding ability for an app to request auto-enter picture-in-picture.

- If an activity requests that it can auto-enter PIP, then we will trigger
it to enter PIP when the task is effectively being occluded. This does
not affect the activity when the screen is locking, or if it starts new
activities within its own task, or if it finishes itself, or if there is
already a PIP activity.
- Changed setPictureInPictureAspectRatio to also specify the aspect ratio
to use when auto-entering PIP. If the activity is not PIP'ed and has
not requested auto-enter, then the call continues to fail.

Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testAutoEnterPictureInPicture
Test: #testAutoEnterPictureInPictureLaunchActivity
Test: #testAutoEnterPictureInPictureFinish
Test: #testAutoEnterPictureInPictureAspectRatio
Test: #testAutoEnterPictureInPictureOverPip

Change-Id: I6477b6d1f160cf0219d935123bbb505f57ee7a56
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
d5a01599f7c90db0cc9bb11e18883a18660a2a45 12-Nov-2016 Winson Chung <winsonc@google.com> Fixing issue where PIP did not stay minimized after rotation.

- Ensure that we reapply the minimized offset after applying the snap
fraction to the rotated bounds
- Fixing small issue where we weren't bottom aligning the PIP when the
visible IME changes size (but is not made invisible)
- Also fixing an issue where the touch gesture continually allowed
swiping offscreen even after dragging the PIP a distance. Now, if no
gesture handles the drag, then the default gesture will disallow
offscreen dragging once it handles the move.
- Shrinking PIP slightly to fit proportions of screen.

Test: Enable minimization in SysUI tuner, put PIP into minimized state,
rotate the screen. This is not final UX and the CTS tests will
be updated to reflect this behavior once it is final.

Change-Id: I15c851a0bcf5f867289bc5ad50d298f82a103308
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
fa7053789f6f874ea1f950826d2471d910114f6e 09-Nov-2016 Winson Chung <winsonc@google.com> Adding experiment for minimized pinned stack.

- Also refactoring the PIP touch handling to be independent gestures

Test: Enable the setting in SystemUI tuner, then drag the PIP slightly
offscreen. This is only experimental behaviour, and
android.server.cts.ActivityManagerPinnedStackTests will be updated
accordingly if we keep this behavior.

Change-Id: I5834971fcbbb127526339e764e7d76b5d22d4707
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
7075d79cabb3c23540bdcbd07b772705a14e932f 11-Nov-2016 Winson Chung <winsonc@google.com> Merge "Adding API for apps to specify their aspect ratio when entering PIP."
84a3834a0c23c4fee4f909f986ba6975a87c807b 09-Nov-2016 Winson Chung <winsonc@google.com> Adding API for apps to specify their aspect ratio when entering PIP.

Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testEnterPipAspectRatio
Test: #testEnterPipExtremeAspectRatios

Change-Id: I9efba942b9a6451dec07428fe1e428ef4a896867
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
b783fd8a0866ad0c18dff333af73e2d49ff2b680 04-Nov-2016 Wale Ogunwale <ogunwale@google.com> Traverse window hierarchy without window list

Added support for to get all windows in the hierarchy without needing
to use WindowList concept which is a very complicated implementation
in the code base.
This implementation walks the hierarchy node by node returns windows
in order to the caller using a callback.

Test: bit FrameworksServicesTests:com.android.server.wm.DisplayContentTests
Change-Id: I2719f7c96f26dad23f91c1c589be88712bd224b8
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
dff5c08bfd5c15f11b71ce953282ed519ff1b290 03-Nov-2016 Winson Chung <winsonc@google.com> Experiment for snapping PIP to closest edge.

Test: Enable in SysUI tuner, drag PIP. This is only experimental to help
figure out what UX we want to keep.

Change-Id: I0d6f2f0c5909d6a76aae4a8fb84c5076f6996fdd
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
47994ccb78b0390c61951e7fec993f8f3233a7a7 03-Nov-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Cleanup dumpstate for CTS tests"
ad5d2846432b38a89df8d3fa7062f761a7c9abd8 02-Nov-2016 Jorim Jaggi <jjaggi@google.com> Cleanup dumpstate for CTS tests

Change-Id: Iefd7f2863b1a2d8974d0cd1c27b1d3b2d3ffbe8e
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
14fefc26d337ac23b6ae8cf0511f94239e1dd875 02-Nov-2016 Winson Chung <winsonc@google.com> Fixing issue with PIP while IME is showing.

- Unifying logic to ensure that the PIP is moved consistently as its
movement bounds are shifted. This is done by adding a snap fraction
which is a fraction relative to one set of movement bounds, and applied
to a new movement bounds. This is flexible to work with all of the
current snap modes being tested.
- Fixing issue where you can drag out of bounds when touching the PIP
before the IME shows.

Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testPinnedStackOffsetForIME
Change-Id: Ie68c1ca599f6196726b8224585974a0972b93701
Signed-off-by: Winson Chung <winsonc@google.com>
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java
655332c641ccb12ee1ae3ce89135ca847fba1abf 31-Oct-2016 Winson Chung <winsonc@google.com> Creating PinnedStackController.

- Creating a PinnedStackController to keep track of the state of the PIP
to prevent changes in the system (ie. IME showing) and user interaction
from clobbering each other.
- Refactoring calls in AM into WM/controller

Test: android.server.cts.ActivityManagerPinnedStackTests

Change-Id: Ie59dfd45d5c54764ba69a589b3b8148845e92cc3
Signed-off-by: Winson Chung <winsonc@google.com>
/frameworks/base/services/core/java/com/android/server/wm/PinnedStackController.java