History log of /frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
0c5a59292c20edb36ef3af946c8d74b76776c3a1 23-May-2017 Winson Chung <winsonc@google.com> Fix issue with TV PIP clobbering resize on orientation change.

- When the device rotates due to a test that requests a specific
orientation, the TV PiP logic was resizing the state back to
mDefaultPipBounds, which doesn't change depending on orientation change,
clobbering the bounds in the new orientation that were calculated in WM.
Since TV does not really care about the rotation case, we can just
ignore the configuration changes due to orientation changes for the sake
of passing the common CTS tests across handhelds and TV.

Bug: 38246863
Test: android.server.cts.ActivityManagerPinnedStackTests
Change-Id: Id7988a0b02f14f67908d3202cdd73b186d9fea16
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java
ee69756d542c9e65389e2907c2dc7aa8cca1250d 18-May-2017 Winson Chung <winsonc@google.com> Adding cached value for current user for per-SysUI process components.

- Also ensuring that we don't do additional work for non-current users when
the task stack changes.

Bug: 38390446
Test: Launch Recents in multiple users, ensure that it works and does not
make a binder call to get the current user id

Change-Id: If075675edc3874d809bad30d0aa564a8e59771d3
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java
b502690e2d0a120993279a6fe800ad07dccc8872 03-May-2017 Winson Chung <winsonc@google.com> Updating Overview to work with PiP

- Ensure that an activity that is auto-entering PiP when hitting Overview
does not show up in Overview. This is done by listening for the
onActivityPinned() callback from the system, and remove the pinned task.
- Ensure that we show the PiP task in Overview after it is dismissed, while
Overview is open. This is done by listening for the onActivityUnpinned()
callback from the system and refreshing the task list similar to when
the multi-window mode changes.
- When launching from a PiP activity, or launching back into Overview where
the next task should be PiP, then ensure that we scroll the stack to the
front so that the first task is fully visible.
- Fix two lingering Overview issues, when there are no handlers (ie. with
dynamically registered handlers), ensure that we call pre/post dispatch
callbacks (otherwise it could cause animated events not to work correctly).
Also, ensure that we don't update the dummy stack view TaskStack without
clearing the stack first, since we may be modifying the same stack
that the activity consumed when starting.

Bug: 34185886
Bug: 38207296
Test: Launch PIP activity from hitting Overview in the various ways
described above
Change-Id: I699e655106e6ed7206e163f9d3c15477bbfd52ef
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java
6b991b6e03533c89cb81f76b3fd0e60fa1600327 11-May-2017 Winson Chung <winsonc@google.com> Minor tweak, defer building PiP notification until after transition ends

Bug: 38117789
Test: Enter PIP, ensure the notification is not shown until after transition
Change-Id: Iea4df55a6e9ac86f21fbbf2f967381406920b241
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java
e6385a23d7d7e0628544c9751c59507d1df7885c 03-May-2017 Winson Chung <winsonc@google.com> Workaround launching PiP task with CLEAR_TASK & NEW_TASK flag.

- When launching an activity with CLEAR_TASK and NEW_TASK, the result code
of the start is START_SUCCESS, but we still need to notify SystemUI to
expand the PiP. However, because the PiP transition now waits for the
first draw, this can cause severe jank and delay if the original activity
is a trampoline activity. As a workaround, we immediately move the task
to the fullscreen stack when clearing and restarting the task to ensure
that the new task shows without delay.

Bug: 37501224
Test: Open YT in PIP, launch sub-shortcut from Home

Change-Id: I16bebf19b082f30695e99da1d93bc4adf5e9df0c
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java
34488242f889d4d5889a38f796633b0d1c8b5541 27-Apr-2017 Winson Chung <winsonc@google.com> Fix issue with double tapping PiP

- This is only an issue when double tapping while the menu is visible in
the initial close state. The problem was that in a double tap, the first
tap could trigger a move as the activity is actively resized, which
triggers the input consumer to be re-registered. Then the subsequent
tap will trigger an unexpected expand on touch up, which then can
conflict when the menu gets resized down to the unexpanded state.

For now, when expanding to/from the expanded state, disallow touches
until after the animation ends, like we do in the input consumer touch
handler.

Bug: 37657050
Test: Double tap the PIP when it is unexpanded, ensure that it expands
Change-Id: Ib68bcb80a54a801181f02ff73e7188678a26dd9b
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.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/PipManager.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/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java
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/PipManager.java
664758cf0a1ca22306f14d6c2cb8da7a651fccfa 29-Mar-2017 Winson Chung <winsonc@google.com> Dismiss the PiP if user changes setting while PiP is open.

Bug: 36070720
Test: Open PiP, launch setting, disable PiP for package
Change-Id: Ia193b079d6ae27fc5fb5b1e8950cf42dfdd28450
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java
c81c0ce2e903ae469a532e0537b2f882fd81ec6c 17-Mar-2017 Winson Chung <winsonc@google.com> Showing notification when activity is in PiP.

- Adding callback to SystemUI to be notified which package entered PiP,
and when it leaves PiP.
- Showing a BTW notification on a new PiP-specific channel.

Bug: 36070720
Test: Launch PiP, observe notification, leave PiP, observe no notification
Change-Id: Ibe10298288fe0464d7d136f2571e855f3f5c70ea
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.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/PipManager.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/PipManager.java
d95687c3efd84f34d32e3e1637bb7bd7d1a74021 03-Mar-2017 Winson Chung <winsonc@google.com> Removing check for launched-from package to expand PiP.

Bug: 35946309
Bug: 35927986
Test: android.server.cts.ActivityManagerPinnedStackTests
Change-Id: I71ed03dc664a080e93427c6e18a4c1e7ff99d726
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.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/PipManager.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/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.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/PipManager.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/PipManager.java
734c9c055657c22e2019ca77214e496442e0c52e 24-Jan-2017 Winson Chung <winsonc@google.com> Fixing error calculating the top pinned activity.

- When the menu was open, we were not calculating the correct
top-activity to determine whether to relaunch fullscreen or to show
media controller actions for. Also fixes a bad condition check
where we were setting the expand to fullscreen flag incorrectly.

Bug: 33754261
Test: Open a PIP activity, try to launch it again from launcher while the menu is visible
Change-Id: I3fd3dfe83a017c76cca9709f29c08621b16fb088
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java
97a60d9d00240949b9642c28a34be118469eb727 19-Jan-2017 Winson Chung <winsonc@google.com> Falling back to media session controls.

- If there are no specific actions set by the current PiP activity,
then fall back to actions provided by the current media session.

Test: Start PiP activity with a media session

Change-Id: Iabb33606eec682fa2fa4d1ba065c8b2763023de7
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.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/PipManager.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/PipManager.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/PipManager.java
dc589ac82b5fe2063f4cfd94c8ae26d43d5420a0 11-Nov-2016 Sudheer Shanka <sudheersai@google.com> Update usage of ActivityManagerNative.

- Remove references to ActivityManagerProxy.
- Add isSystemReady to ActivityManager.

Bug: 30977067
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test android.server.cts
adb shell am instrument -e class com.android.server.am.ActivityManagerTest,com.android.server.am.TaskStackChangedListenerTest \
-w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I07390b6124fb1515821f5c0b37baf6ae74adc8fa
/frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.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/PipManager.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/PipManager.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/PipManager.java