History log of /frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
bca03117fe4e4f912f10eb8b3bb03ad4a5d6e09c 16-Aug-2017 Winson Chung <winsonc@google.com> Double tap to expand PiP.

- Also fix issue with dismiss scrim not clearing when quickly swiping in
the dismiss area and back, due to an incorrect check (menu state NONE
!= menu is not visible).

Bug: 62078042
Test: com.android.systemui.pip.phone.PipTouchStateTest
Test: Double tap PiP to expand it

Change-Id: I96d9ba169feadf0ea8315152fb3a5b2cfb69a2f0
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
bb78744c57eb7083165447d0396959a95d7e6e8d 01-Sep-2017 Winson Chung <winsonc@google.com> Fix issue with PiP menu activity disallowing touches

- On devices where the expanded bounds are the same as the collapsed
bounds, there is no task stack animation and no subsequent animation
end callback, which means that touch state is not reset. Skip
disallowing touches in this state.
- Also fix race causing the PiP menu to ignore touches due to the pinned
animation end callback happening before the menu is first shown.

Bug: 65168767
Test: Tap menu on Ryu, rotate, and try and drag the PiP before the menu
times out

Change-Id: I0b264678aa3300fd4d4e9da5ef3d48a590232ae1
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
04d6fe566b28c5c15a54356204d20c82ffda3c59 16-Aug-2017 Phil Weaver <pweaver@google.com> Check a11y enabled before sending events from PiP

Bug: 64615719
Test: Ran YouTube, issued 'adb shell input keyevent 171',
then plugged in a USB mouse and moved the pointer over
the PiP window. No longer crashes the SystemUI.

Change-Id: Ib28921bdf1e1b2e06aa472340a5733a59702193d
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
0a2f34fd20b8b51c7f291d3dfcfaa3781d1c7ca3 12-Aug-2017 Winson Chung <winsonc@google.com> Workaround the IME dismissing when dragging PiP.

- When the IME is shown, skip showing the dismiss scrim in the menu
because starting the activity will cause a window focus change, which
will close the IME (it will still be covered by the dismiss overlay).
This is slightly inconsistent from dragging while the IME is not visible,
but is preferable to having the IME close.
- Also, use the inset bounds to calculate the fraction, which aligns
closer to the dismiss check (which is also based on the display bounds
and not the current (possibly inset) movement bounds.

Bug: 37655837
Test: Drag PIP over IME, ensure that it does not hide the IME.
Change-Id: I86228371effce2d962ab4367497f5b1bf32456ec
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
0a8caa1ccc0897cd40c22d62a945d2b858d0c907 09-Aug-2017 Phil Weaver <pweaver@google.com> Fix source for PiP hover accessibility events

The events were ending up not important for a11y and
with invalid window ids, which prevented TalkBack from
seeing them properly.

Bug: 64428961
Test: Ran YouTube in PiP, now able to select it.
Change-Id: I38ccbf5f2f35ffda255b84f229e98ca23e6b11aa
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
136d1ec894e4bf7ebda5c4d223da566e26afef4e 18-Jul-2017 Winson Chung <winsonc@google.com> Apply static offset to PiP IME adjustment.

Bug: 63581892
Test: Enter PiP, launch an app with a bottom aligned input view and focus
it. Ensure that the PiP is offset sufficiently to see the view.

Change-Id: Ice0d77b25b34d389f604f8154bdf7c866be668e5
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
8ec0e16dbed3ea132ffc09a395eb6f617ccb663c 07-Jul-2017 Winson Chung <winsonc@google.com> Fix issue with PiP touch drift.

- Fix issue with cumulative truncation of positions causing a large x/y
error causing drift. Instead of using the rounded stack position,
keep track of the cumulative delta and apply that on each move.

Bug: 62541932
Test: Pip activity, move around with finger and ensure no drift
Change-Id: Ic7737a6b19672ee8a1d98fd57f84a1d89f4a17e9
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
176f2533a1768755e965b242333dac93ae17d26b 29-Jun-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Adjustments to PIP position while flinging" into oc-dr1-dev
15b29c7bba95b6d8b6288af3f9dfd45efb85be5e 07-Jun-2017 Mady Mellor <madym@google.com> Adjustments to PIP position while flinging

Rather than using a scroller, find the actual edge intercept
based on the trajectory of the fling.

This is done by finding the two points it could intersect with
and checking which point is 'closer' (i.e. would be hit first
by the PIP).

Bias towards using the intersection with the top / bottom edge
if the PIP is being flung along the side it's currently on.

Also increases the maximum time for the fling.

Bug: 35358634
Test: manual - fling PIP around screen while in landscape
and portrait
Change-Id: I26e943a5ddbc726ab86bc11e4271d4db034f3d47
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
9b919413687a4363d9658740fa98dbb780332e55 20-Jun-2017 Winson Chung <winsonc@google.com> Clean up dismiss target when last activity is unpinned.

Bug: 37309693
Test: Enter PIP, drag to show dismiss target, force kill application and
ensure target is hidden.

Change-Id: Ia41f8252e32a2ff3396796562874a6c47777030d
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
53afb853fd4cd72d805eb788bb6cfd14c0f851e6 31-May-2017 Winson Chung <winsonc@google.com> Merge "Fix issue with aspect ratio not applying correctly when PIP is expanded" into oc-dev am: 9c1b222fc1
am: e322d120cc

Change-Id: Ife88f1db852d49c31ddbbd5a6ebbe55f4ae02f51
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/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
194a323963ea7fd91d6d55223a20414ba694e66f 27-May-2017 Phil Weaver <pweaver@google.com> Merge "Stop populating accessibility nodes with events"
651fe9fc2e0a51d6a2123d6d44a6a8b8ed864742 25-May-2017 Phil Weaver <pweaver@google.com> Stop populating accessibility nodes with events

This mostly rolls back ag/710190, which caused
AccessibilityEvents to contain their source nodes. These
nodes were not completely accurate, and populating them
increases the overhead of AccessibilityEvents, particularly
when large numbers of content changes happen. Having the
service reload the node if it needs the update content
should be sufficient. I have fixed several bugs since this
change went in to address issues with the accessibility
cache containing stale data. I think ensuring that the newly
loaded data is up-to-date will fix whatever issues carrying
the node along was intended to fix.

Bug: 33961523
Test: A11y CTS still passes. I also tried TalkBack on a
couple of switch controls, which is where I have previously
seen the most issues with up-to-date announcements.

Change-Id: Ie5a70bb0e89d49255c6a4c1c83d32b755c06902f
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
bb23376439a369d2a4f94abcda6a46dea673a74c 15-May-2017 Winson Chung <winsonc@google.com> Fixing issue with double tapping PiP.

- If a user taps the PiP quickly multiple times, you can hit a case where
you expand the PIP, which triggers the re-registration of the
InputConsumer, but doesn't disable touches until the pinned stack
animation starts. If the user taps in between that time, it can trigger
a resizing of the stack what aborts the expand animation
- Also adding additional debugging logs

Bug: 37657050
Test: Quickly tap the PiP

Change-Id: Ib0088a3aa8e917aca3214c289a0787bdf7e66199
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
8c7dc429b5d37f43c34b49880b26a27b85c0c5cd 10-May-2017 Mady Mellor <madym@google.com> Remove PIP tuner items

Test: Check tuner for items, also try moving PIP around note it doesn't
minimize, also try long drag to dismiss, note it doesn't dismiss
Bug: 37476193

Change-Id: I1ac1abd9c75d40bd84f59dab8aba5cdb98cd59bb
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
79f852e7a784a6c1721fcea0936d98098f9359b9 05-May-2017 Winson Chung <winsonc@google.com> Ensure that we hide the menu without resizing when expanding.

- This should be done when expanding/dismissing from the menu activity,
otherwise the menu state change can cause a stack-resize animation that
clobbers the expand or dismiss animation.

Bug: 37650245
Test: Launch Duo in PIP, end call from notification tray
Change-Id: Ie880715ae7be28a4fe2dd0d294e369b62e776c35
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
b54b65b001dadbc6fef790700819c33c99772333 26-Apr-2017 Winson Chung <winsonc@google.com> Fixing issue with lingering dismiss PiP overlay.

- Always try and remove the dismiss overlay when animating touch ends, or
if the input consumer is unregistered to handle cases where the
interaction is interrupted by the pip animation.

Bug: 37309693
Test: Intermittent, enter pip and try to tap and then tap-drag the PIP
Change-Id: I05f360f1d9d264590725e13eb2cc9254a3f21eef
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
47ba140cbf9faa8c391fc85f4254ade0b4d23357 05-Apr-2017 Mady Mellor <madym@google.com> Add ability to fling to dismiss PIP from anywhere

This is by default turned off and is behind a tuner flag.

Allows the PIP to be dismissed if it is flung towards the bottom center
of the screen and the finger is released within the bottom area of the
screen.

Test: Manual - enable tuner setting, have a PIP, position it at top of
screen, long- fling it towards bottom center of screen, it dismisses.
Bug: 35358628
Change-Id: I2d3d50093f6523c7bb321e0486dab360095a398e
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1e28c8fa337388060dc7f69a835852cab324724d 18-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Adjust some of the timings around animating / showing the dismiss gradient" into oc-dev
5d58d25781a98d738e2d3513c63641307ae5ab0b 18-Apr-2017 Mady Mellor <madym@google.com> Adjust some of the timings around animating / showing the dismiss gradient

Dan wanted longer + linear fade in of the dismiss gradient. Also wanted
fade out to match the timing of 'snap to edge'.

Test: Manual -- move PIP around, observe how gradient fades in / out
Bug: 35358628
Change-Id: I847d96e70184c0093e64a7e2e895a9c5f30fea8b
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
d2ec5a62c70a0593fa021a538912fdf41bb22895 18-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Defer showing pip menu activity until pip animation ends" into oc-dev
6455e500b878b0367a629d6f0e262154116010c0 17-Apr-2017 Wale Ogunwale <ogunwale@google.com> Defer showing pip menu activity until pip animation ends

This was causes additional churn in the system delaying the visibility
of the activity behind the one we are pipping. We now delay starting the
pip menu activity until the enter pip animation is done.
This doesn't fix the real issue where we don't wait for app transition
to be finished before starting pip, but it does make it much harder to
the user to trigger the case. Will do that in a follow-up CL.

Test: manual
Bug: 37420370
Change-Id: Ic0271d693d45c3e414b3abdf0ad24be44ff5ae5c
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.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/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
be4a808b3d0e3c4a8d530d7f6a7b88856ebbb672 13-Apr-2017 Winson Chung <winsonc@google.com> Fix issue where we weren't dismissing the pip menu activity.

- Also don't crash if we get a deferred call to resize the pinned stack
that no longer exists.

Bug: 36049843
Test: Try to pinch and expand pip
Change-Id: I64c42e47c466c641464c4f22a20bded2209e29eb
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
637cd4892213b820c00a2a09959c84c49c50a15e 21-Mar-2017 Mady Mellor <madym@google.com> Show x for short period of time when activity is PIP'd

- Moves dismiss view out of menu container layout and manages the alpha
for it separately (i.e. when animating menu in / out or modifying the
alpha when dragging to dismiss)
- Shows the dismiss view when PIP mode is entered, fades out after
menu time out, on interaction the timeout is reset

Test: Enter PIP, note 'x' that is displayed, tap on it to dismiss the PIP
or don't tap on it and it goes away
Bug: 36900043
Change-Id: Ia596ee60cd9c0d744e459564586ba6a0a9c23d5d
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
87e5d55e98857bd43984c2395660d88ae20efcfc 05-Apr-2017 Winson Chung <winsonc@google.com> Workaround for input ANR, always finish PiP menu activity.

- Always finish the PiP menu activity when the interaction is complete
(either the menu is hidden after showing, or when the user stops
interacting with it and it was shown for the dismiss overlay)
- Fix issue with bounds animation callback not working due to the app
window being removed and not updating the app transition that its
animation "finished"
- Add additional logging throughout to trace PiP animation

Bug: 36877782
Test: Enter PIP, tap to show menu, wait for it to hide, and then use
wired headset button

Change-Id: Ie88ba107d7fffdd182a4063ef4f324b58669d0ad
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2af994ec034040a69e41cc89df7ed6b994aaad89 01-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Ensure we show the PiP menu in response to KEYCODE_WINDOW." into oc-dev
ac52f2892d5c72c26387d510093ddfc741a8a632 30-Mar-2017 Winson Chung <winsonc@google.com> Ensure we show the PiP menu in response to KEYCODE_WINDOW.

Bug: 36687605
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testWindowButtonEntersPip
Change-Id: I0bb35fd666eb6a438e4676267f6726b44bffb3db
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
8565eab156281ac23b3c1df9a05b242483e57ba9 31-Mar-2017 Mady Mellor <madym@google.com> Merge "Update PIP dismiss to show scrim + info text at the bottom of the screen" into oc-dev
60421c9d451afa85abc6621fe97828857012a054 30-Mar-2017 Mady Mellor <madym@google.com> Update PIP dismiss to show scrim + info text at the bottom of the screen

- Rather than testing how far off screen the PIP is, instead tests how far
past the nav bar / on screen bars the PIP is to determine if it is a
dismiss
- When dragging PIP around screen, display info text + scrim at bottom
these are above the PIP in z-order
- On lift up or when PIP is dismissed, info text + scrim also hide
- Alters dismiss animation to use end point on trajectory of finger and
use FlingAnimationUtils when flinging

Test: Drag PIP around screen, notice dismiss scrim + text appear, dismiss
PIP and scrim / text also disappear
Bug: 35358628
Change-Id: Ibc0f6a884903f7d1b3ca2fd5c20647b4acf15a71
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
0f873de5ff40f4cf0be65267cf4fc2af2844bf39 30-Mar-2017 Winson Chung <winsonc@google.com> Tweaking PiP for accessibility.

- Disabling timeout when the PiP menu is invoked via an accessibility event
- Increasing default duration before menu times out and collapses
- Fixing issue where temporary bundle data was being clobbered

Bug: 36103023
Test: Launch PiP activity with accessibility, ensure menu does not time out
Change-Id: I4beda18ef2fb2e2b638b0ff6bac9a71ed1986639
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
73a55f7506f0e5e8d67a58259289ef0b97ccea02 28-Mar-2017 Mady Mellor <madym@google.com> Merge "Fix for edge swipe/fling to minimize"
84a0f8936d0a993576a0da3a1c703e4f9198bfd3 27-Mar-2017 Mady Mellor <madym@google.com> Fix for edge swipe/fling to minimize

- Actually include check for fling
- Base left or right side on starting position instead of current position

Test: Long quick swipe PIP from opposite edge of screen -> no longer minimizes
Bug:35358628
Change-Id: I7cd62b94943afe28b89a8bcb0e0cab58bc0841a9
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2e1387886a13175273fa25f01366baea293e0cf0 27-Mar-2017 Mady Mellor <madym@google.com> Disable PIP minimize and put it behind a tuner item

Test: Have PIP, try to minimize it (does not minimize).
Enable tuner item, have PIP, try to minimize it (success!)
Bug:35358768
Change-Id: Iee9c26055decd06dc27233ff21edb6905eef9d23
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2fbdd3bfde12c6755e184208730cfb76e3066741 22-Mar-2017 Mady Mellor <madym@google.com> Fix PiP dismissing on drag away from bottom and then fling

Adds two flags to watch for movement outside of the starting area of the
gesture, one for dismissing and one for minimizing.

Test: - Have PiP at bottom of screen, drag to top and fling down (does not
dismiss)
- Have PiP at left or right edge of screen, drag PiP to opposite
edge and fling to other side (no longer minimizes)
Bug: 35358628

Change-Id: I007e2c2c688254dbe1abaecdedc28e281278def8
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2824d7c1b32675233221bd30d24b60f2dac2bdd5 16-Mar-2017 Winson Chung <winsonc@google.com> Ensuring that we remove the input consumer after moving expanded PiP

- We re-enable the input consumer once the user starts dragging the
expanded PiP to allow the touch handler to take over, but once we
reset the timer (after showing the menu again), we need to disable
the input consumer so that the menu can get touches again.

Bug: 36266913
Test: Expand PiP, move, click action
Change-Id: I30ebccd165fd764a9a8de8313659c24ecd12aec0
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
81d406104a1661658eba8755de59bf1df575e4c7 11-Mar-2017 Mady Mellor <madym@google.com> Enables drag to dismiss for PiP and adds a dark scrim when dismissing

- Adds a scrim that fades in as the PiP is dragged past the bottom movement
bounds.
- Tweaks the values for minimizing the PiP and dismissing the PiP
- Fixes an issue where the PiP could be minimized in the bottom corners
of the screen

Test: Manual - drag PiP to bottom of screen to dismiss or swipe down on
PiP when it's at the bottom of the screen
Bug: 35358768
Bug: 35358628
Change-Id: Ib4ad5ed7094fef76ea979b46ea7e03d746625d00
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
fe1fa64b0fe14ff4a5a64034bdd9cba4c88b5f49 13-Mar-2017 Winson Chung <winsonc@google.com> Refactoring accessibility class out to own file.

Bug: 34773134
Test: Open PIP, turn on talk back and use it.
Change-Id: I8a73eb7230ee02afd16997513fe19c2f0805d094
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
bd7ae7df281e3fdc5d0cbe1acceb8c0d82ecceb9 11-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Basic accessibility support for picture-in-picture"
f00cd14f17c0acd6bffe78947d32ea0a2900d139 03-Mar-2017 Phil Weaver <pweaver@google.com> Basic accessibility support for picture-in-picture

Exposing actions from the PIP InputConsumer to accessibility,
stripping all actions from a covered PIP app, and adding the
InputConsumer's actions on the PIP app's root view.

We were also using an "undefined" accessibility ID to mean
three different things: a root view, a host view of a virtual
view hierarchy, and a truly undefined view. I've introduced
new values for cases where the id could be defined.

Also gathering all window IDs into one place to reduce the
chance of collisions.

Bug: 34773134
Test: In progress. Current cts passes.
Change-Id: I97269741a292cf406272bf02359c76c396f84640
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
6b9cb3f520864fd088bc3125fb6e2f8383ea5c19 10-Mar-2017 Mady Mellor <madym@google.com> Merge "Add drag down to dismiss pip as a dismiss option"
57d2255cc983b614be61cab86ea8d5cafc03fdec 10-Mar-2017 Mady Mellor <madym@google.com> Add drag down to dismiss pip as a dismiss option

If enabled via flag, when the user drags the PIP past
a threshold at the bottom of the screen, the PIP will
be dismissed. If the PIP is sitting near the bottom
edge and the user flings downwards the PIP will be
dismissed.

Unifies logic to identify for “fling towards edge” for
minimize and dismiss gesture — adds additional logic
to check that the start of the fling gesture was near
that edge. This stops you from accidentally minimizing
or dismissing on a “long fling”.

Test: manual - enable flag, and drag pip to bottom of
screen to dismiss
Bug: 35358628
Change-Id: Iddd66ed2720964d431cddea6173767eb5565b991
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
e7a3d2225c3fcfcac4f7d1055e6ddbcbd55b52a4 09-Mar-2017 Winson Chung <winsonc@google.com> Updating expanded PiP menu.

- Adding consistent scrim behind menu
- Tweaking icon/button sizes
- Updating the expand button depending on the current placement of the PiP
- Better centering of the expand button

Bug: 35358425
Test: Expand pip
Change-Id: I34575bb08d4815f51b6f14f8b0e25b20b9a97320
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.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/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.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/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
d2d909778c3dd67ccbccd5134ef7624059994ca9 28-Feb-2017 Winson Chung <winsonc@google.com> Initial changes to support expanded PiP

- Prior to this CL, the input consumer and size of the PiP was tightly
coupled with the visibility of the menu, but with the expanded state,
the PiP should still move while the menu is visible.

Bug: 35358488
Test: Click on the PiP to expand it

Change-Id: If52208f19af516b2455bde26855c80f44bc9021a
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
85d3998aa39f412f269806114b3e6154ccbee73f 25-Feb-2017 Winson Chung <winsonc@google.com> Prevent PiP movement while the resize animation is running.

- This was causing numerous artifacts when the user starts touching while
transitioning into PiP where the move rects clobber the animating rect.

Bug: 35764922
Test: Try touching the PiP while it is entering or exiting PiP
Change-Id: I5a72b5bea694b01aab401d2bb78a493688a9c655
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
6e35ee1ff5fc065f451e29827bbb089939b24af1 14-Feb-2017 Winson Chung <winsonc@google.com> Removing PiP from SysUI tuner.

Bug: 35143109
Test: Go to tuner, observe
Change-Id: I5c4eadc33a303e7bf7d99aa772296405d39ee251
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
29a786590f273b123efa4bb669c4ae51dd055a00 10-Feb-2017 Winson Chung <winsonc@google.com> Adding PipManager dumps.

Test: adb shell dumpsys activity service com.android.systemui
Change-Id: Id647833f1b4dcb6226517c058d17d1812f022671
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.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/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
de3f962e8a89043827629c3f69d3db2375c48a4b 02-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Update the drag to dismiss UI to be closer to design"
d4e40fb09713f8948ded456ee6cbfa8c2c2c3f81 26-Jan-2017 Mady Mellor <madym@google.com> Update the drag to dismiss UI to be closer to design

Rather than a circular target for drag to dismiss, there is text / icon
as well as a gradient. As the PIP approaches the text / icon they grow
in size. If the PIP is released overtop of the text / icon, it is
dismissed.

Test: Using PIP test app, have a PIP, drag it to dismiss target area.
Change-Id: I339ad14e144dfd61f0e990ba4d2559642a47b141
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
de850bbcaa61c1874b803f2086443febbafd81a4 02-Feb-2017 Jason Monk <jmonk@google.com> Fix leaks in sysui

Add support for testing for PluginManager and TunerService leaks
and add tests for the known leaks and fix them. Also port PluginManager
and TunerService to Dependency to make them easier to handle in
tests.

Test: runtest systemui
Change-Id: I5642539ee24dd72f802905106decd0c87b41b4eb
Fixes: 34846972
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
14fbe141e0990d423b8564c0fc3a786ed26232c0 20-Dec-2016 Winson Chung <winsonc@google.com> Adding initial TRON logging for picture-in-picture.

Bug: 33756317
Test: Run PIP activity
Change-Id: Iad270dfdf6521d4659653a0697effaed4a0d4137
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.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/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3535df26e36df067b8704443e4a660526fe11e22 18-Jan-2017 Winson Chung <winsonc@google.com> Move activity to fullscreen stack when it is relaunched in PIP.

- Only happens when the caller is not from the same package.

Bug: 33754261
Test: Open a PIP activity, try to launch it again from launcher
Change-Id: I3c364ebe31a7626b9133d9c4c1fafc718c2eecf9
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.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/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
929d4f722533fef8d8dc498b2ecf6ac3d0cb66d5 13-Jan-2017 Winson Chung <winsonc@google.com> Add additional guards to ensure input consumer is re-registered.

- Also removing some old code related to menu start, which is already
called when the menu is shown.

Bug: 34240533
Test: Open PIP, ensure that you can drag it after the menu fades out.
Change-Id: Ia16b405f8507f5c3d81fdf4f1049ce9359298672
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
a5acf18dfedaf38d7a66a828a5be918c7e160253 06-Jan-2017 Winson Chung <winsonc@google.com> Updating PIP to match UX

- Updating menu actions to match design, fixing issue where
the actions background would still be visible if there were
no actions
- Enabling tap-to-show-menu, minimizing, snap-to-edge by default,
and removing swipe to dismiss option.
- Making the visible size a fixed value instead of a fraction of
the PIP size

Test: android.server.cts.ActivityManagerPinnedStackTests
Change-Id: Ib767df497ca7bc901c553d35168080f3b737033a
Signed-off-by: Winson Chung <winsonc@google.com>
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
c75ffe8ccb58966753654c5b817507ad11168bca 17-Dec-2016 Winson Chung <winsonc@google.com> Fixing some interaction issues with the PIP menu.

- Due to jank when finishing the PIP menu activity, we handle the
menu visibility explicitly and keep the menu activity around
once triggered (until PIP ends), instead of finishing and
recreating it each time it is invoked. This also gives us the
flexibility to control how the animation looks of both the menu
and individual actions.
- Allow dragging the PIP while the menu activity is showing and
taking input
- Tapping outside of the PIP now hides the menu

Test: Enable the tap-to-interact in the SysUI tuner and drag while
the menu is showing.

Change-Id: Iac74710100d793e6825b00c7c0d71b85fb420fa0
Signed-off-by: Winson Chung <winsonc@google.com>
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.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/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
54f0c655b219054cfcc02d2521158a43fecff374 06-Dec-2016 Winson Chung <winsonc@google.com> Fixing NPE when updating controller state.

- Since registering the pinned stack listener is not synchronous,
defer updating the controller state until the the listener is
registered and we have the controller set.

Bug: 33271221
Test: Run on car_emulator_x86_64-userdebug

Change-Id: Ie122b475122bfd2c4ca6f8e439fefc2443a18a37
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.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/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.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/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.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/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
15504af3f75037b9b94846e55bf706369531d786 03-Nov-2016 Winson Chung <winsonc@google.com> Experiment with allowing tap to break through to interact with the PIP.

Test: Enable SysUI tuner, tap once on PIP to interact with the activity.
This is only experimental behaviour, and
android.server.cts.ActivityManagerPinnedStackTests will be updated
accordingly if we keep this behavior.

Change-Id: I278ab8c360c44718cfcac0fd761f476a875f9b15
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.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/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.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/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
5cd26ff4d9547dc0c775d13943b45daaa050e6b0 24-Oct-2016 Winson Chung <winsonc@google.com> Adding option to swipe to dismiss.

- Adding tuner settings for PIP

Test: Manual, open PIP and swipe offscreen to dismiss

Change-Id: I62f8e4c4b96984b9f266dde5efc3c511cf37f7dd
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
cd1ff64683cf9664d52a153d98863953591d44f8 26-Oct-2016 Winson Chung <winsonc@google.com> Ensure PIP retains bounds on device rotation.

- When device rotates, ensure that the PIP continues to show in the
same aspect ratio, snapped to the same logical snap point.
- Move common snapping code to policy so that it can be shared between
SystemUI and the framework.

Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testPinnedStackInBoundsAfterRotation

Change-Id: I2d9f1a2dc077a55c39acc1ccba982c255e2ff3a4
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
303c6b78b645a9a655e09677e4856269d278a85d 25-Oct-2016 Winson Chung <winsonc@google.com> Fix wrong bounds being used in landscape.

- Ensure we use the right display size when calculating PIP bounds.
- Also update interface to take the display id.

Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testPinnedStackDefaultBounds
Test: #testPinnedStackMovementBounds

Change-Id: I01fd8ba6dee212c29a9a092673ee8f7843e41af6
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
73bc159dcc3e3d32cd6e68f8e72b0e9f9de6a1e9 19-Oct-2016 Winson <winsonc@google.com> Adding PIP logic for phones.

- Adding basic behavior to move PIP window and launch back into
fullscreen, as well as drag it to dismiss.

Test: Deferring CTS tests as this interaction is only temporary and not
final

Change-Id: I5272a045090c20c45b345813d10dc385c3f83221
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java