Commit Graph

143 Commits

Author SHA1 Message Date
TreeHugger Robot
427e41bd07 Merge "Add a function to get the secondary split screen bounds" into pi-dev 2018-04-20 23:27:12 +00:00
Matthew Ng
c603a5012f Add a function to get the secondary split screen bounds
Access through the overview proxy to get the bounds of the secondary
split screen app when split screen is enabled.

Test: manual
Fixes: 77678123
Change-Id: Iabbcf30dc7194ac6fff9b4d7cad8a9fe5ee48a2b
2018-04-20 12:00:57 -07:00
Adrian Roos
a6d6aab0e0 Defer resizing invisible stacks while drag resizing
Works around a source of jank when drag resizing in split
screen mode: instead of immediately resizing the (potentially
numerous) invisible secondary stacks, we defer that until
the user lets go of the handle.

Change-Id: I3b9faa83005fa86185d4e51b2849e3a826b7f6a9
Fixes: 78214347
Test: Open a gazillion (resizeable) tasks. Enter split screen. Drag handle, verify there is no jank
Test: atest RectTest
2018-04-20 15:09:02 +02:00
chaviw
ee947f2ecc Set snapTargetBeforeMinimized to middle target if position is negative
There are cases where the last snapTarget position is negative.
Specifically, it can be negative if the divider was moved up, making the
last position negative off-screen. Instead save the middle SnapTarget,
which is the default, so bounds aren't accidentally calculated with
negative position.

Fixes: 74440003
Test: Bug no longer occurs
Test: Split screen with 3rd party launcher
Test: ActivityManagerSplitScreenTests

Change-Id: Id3261d6e31622a96f71ff80301dd9cc39599b7ec
2018-03-27 17:07:07 -07:00
Adrian Roos
7377f58464 DisplayCutout: make dock divider cutout aware
Fixes an issue where the insets given to SystemUI's dock divider
did not include the display cutout insets, which would lead to the
minimized view being laid out wrong.

Bug: 75277581
Test: Enter landscape, enter splitscreen, press home. Verify that there is no extra space between home and the divider.
Change-Id: I85107f147381aaceb01dfcad329662d54d72bbf7
2018-03-20 16:56:22 +01:00
Winson Chung
2cf6ad832d Removing references to hidden classes in shared lib.
- Restructure assist data receiver to not extend hidden interface
- Restructure animation spec to not use hidden spec class
- Restructure transitions apis to not use graphic buffers
- Remove direct arguments which use hidden animation start listener
- Renaming some methods to be a bit more clear
- Expose AnimateableViewBounds and task stack listener

Bug: 67510855
Test: Sysui and quickstep still build and work
Change-Id: Ibc471c34a725daa3149765960ae0731996ceb854
2017-11-14 12:39:21 -08:00
TreeHugger Robot
27d39bd77e Merge "Add support for minimized mode for right dock side for tablets (1/2)" 2017-11-02 18:43:18 +00:00
Winson Chung
aa35745690 Move more calls to the lib.
- Move the task stack listener wrapper into the shared lib, along with some
  other AM calls.

Bug: 67510855
Test: Launch recents

Change-Id: Icb5ea78ec42d4b76a1c531ce336dd9a3f07a9629
2017-10-31 12:19:45 -07:00
Matthew Ng
f59a4132e8 Add support for minimized mode for right dock side for tablets (1/2)
Tablets have the ability to dock to the right side in landscape. This
change supports minimized mode for right dock side.

Test: run-test CtsActivityManagerDeviceTestCases
android.server.am.ActivityManagerDockedStackTests#
testMinimizedFromEachDockedSide
Change-Id: Ie879bdf7bf74226c0ceda9295f9de2004fd6a9b5
Fixes: 68017311
2017-10-31 11:03:48 -07:00
Winson Chung
2db3557064 Pull out TaskStackListener into its own class.
Bug: 67510855
Test: Code removal
Change-Id: I103ccc690f577dbeba9c3568614d9f4041fff7df
2017-10-13 14:25:26 -07:00
Wale Ogunwale
89be5761bc Removed sys-ui's use of static stack ids.
Test: Existing tests pass
Test: go/wm-smoke
Bug: 64146578
Change-Id: Ia74b363358cbae383e74dbc33fdcbb37191f0419
2017-10-06 16:34:43 -07:00
Wale Ogunwale
68278568de HOME_STACK_ID, ASSISTANT_STACK_ID, and RECENTS_STACK_ID be gone!
Replaced usages with ACTIVITY_TYPE_HOME, ACTIVITY_TYPE_ASSISTANT
and ACTIVITY_TYPE_RECENTS.

Test: go/wm-smoke
Test: Existing tests pass.
Bug: 64146578
Change-Id: I62c55c99df86dba8c9ba9d9986049de1b1083234
2017-09-27 21:08:10 -07:00
Winson Chung
ef48ae837f Merge "Minimal change to ensure that position is last saved when docking." into oc-mr1-dev am: 1ca7d06313
am: 4726b4e8dc

Change-Id: I3264b0a59ab9ff1b4b1d9ac0e66236e83c1bacd6
2017-09-27 19:50:07 +00:00
Winson Chung
37b202492e Minimal change to ensure that position is last saved when docking.
- When a task is docked from Recents, the last position is never updated
  if the user never touches the divider.  Ensure that the default dock
  snap target is saved in this case as well.

Bug: 66903645
Test: Dock a task from Recents, go home, and hit recents
Change-Id: Ia229d2ba0eee792424fb9e9c043320cec71695dc
2017-09-27 09:59:28 -07:00
Wale Ogunwale
d5efc1fd0d Delete unused interface IAM.swapDockedAndFullscreenStack()
Deleting so I don't have to convert to the new windowing model later.

Test: Existing test pass.
Change-Id: I6adbe11348e3f01f4e32d8b404b6399d5eff7152
2017-09-19 13:07:39 -07:00
Matthew Ng
597bcbb122 Avoid saving position before minimizing when in transition
Changed to save snap targets instead of positions when divider is
attached to window and after any stopdragged animations occur.

Test: manual - split 2 apps, rotate screen, hold home launch assistant,
click keyboard, hold device back to portrait and press home
Fixes: 64977831
Change-Id: If47a04742b812eed3be0d08a243d4226515308b5
2017-09-08 17:44:45 -07:00
Matthew Ng
d411f6cd6b Adding back recents grow in split screen
There was a regression where recents stopped growing when in split
screen and bottom app has less height than top. Then when pressing
recents button it would go into recents on bottom split and divider
would move to the center.

Test: manual - split with 2 apps, lower divider, press recents button
Fixes: 62431729
Change-Id: I3cacb4e4bd38a17602415ebee4e24a517115bbdd
2017-08-28 15:34:30 -07:00
Winson Chung
94bbf483e3 Merge "Minimal change to ensure events are propagated to the right DividerView." into oc-dev am: b1cdc17dfb
am: ebc74796e4

Change-Id: Id4818ff5e203cb2aa40079ed7af24c4b84a957ba
2017-06-13 01:45:31 +00:00
Winson Chung
60fa647427 Minimal change to ensure events are propagated to the right DividerView.
- The RecentsDrawnEvent sent when Recents is first drawn can be racey, if
  it is sent before the configuration change in Divider is dispatched, then
  it will be posted for the old DividerView, which prior to ag/2363241 was
  still sending the correct resize calls (the animation is independent of
  the view).  For now, we register the event handler in Divider, and
  instead proxy it to the current view when it is posted.

Bug: 62528361
Test: go/wm-smoke
Test: Play a movie in Play Movies, ensure the activity is resized

Change-Id: I665b0c6af55dea0db1916f5b041589bf72da3baf
2017-06-12 16:10:52 -07:00
Wale Ogunwale
d034fec9cf Merge "Don't allow removed DividerView to resize stack" into oc-dev am: d7427d5d90
am: b4f383c26e

Change-Id: Ibded63bebba40bc29978dee2717dd61a36d609a9
2017-06-06 18:08:49 +00:00
Wale Ogunwale
15ba1515a8 Don't allow removed DividerView to resize stack
If a divider view is removed or in the process of been removed, then it
should no longer have any influence on the size of stacks.

Fixes: 62273599
Test: go/wm-smoke
Test: enter split-screen and make sure recents is visible, lock and
unlock the device and verify things look fine.

Change-Id: I79aca82be8a7013328b78e82f508c4ed9fa48a4a
2017-06-06 08:31:17 -07:00
TreeHugger Robot
412652b001 Merge "Unminimize to save divider position after rotation" 2017-06-02 21:39:51 +00:00
TreeHugger Robot
8cb56d9082 Merge "Allow force resize message activity to be resumed" into oc-dev 2017-06-02 15:55:38 +00:00
Andrii Kulian
d5020c15b9 Allow force resize message activity to be resumed
"Activity may not work with split-screen" message is not showing
because the overlay activity is not allowed to resume without
user action.

Bug: 36205249
Test: Launch an activity with target SDK < 25, enable split-screen
Test: go/wm-smoke
Change-Id: Ic796f4449df1307c75ca5445cbffab218f0f8ae3
2017-06-01 18:26:13 -07:00
Matthew Ng
ca3168bd9e Unminimize to save divider position after rotation
Holds the divider ratio in the divider state to persist after
configuration change while minimized. After unminimizing past
a configuration change, the previous position will estimate to
the closest snap target.

Test: manual - minimize, rotate, unminimize
Fixes: 34395958
Change-Id: I6ceffb9f5018b8009069f0aa0085f263d8982319
2017-05-31 20:48:54 +00:00
TreeHugger Robot
ddd5458092 Merge "Do not set the divider pos during adjust ime and minimized interaction" into oc-dev 2017-05-31 02:22:33 +00:00
Matthew Ng
f3589c7a22 Do not set the divider pos during adjust ime and minimized interaction
When launching an app in splitscreen with while ime is up will trigger
an animation that is trying to minimize the docked stack (this bug is
tracked in b/36603383) with the end result in incorrect bounds for the
docked and fullscreen tasks (leaving visual glitches in their apps).
This was caused by setting the divider position while there was
interaction with the minimized state. Therefore ignore setting divider
while adjusting for ime and minimized interaction for the tasks to end
with the correct bounds.

Fixes: 38428386
Test: manual - dock something in split screen, use the launcher search
to bring up ime, launch any app (like gmail)
Change-Id: Ic3547b02a39f40698db07d1c0946e0991b69f5d3
2017-05-30 11:42:41 -07:00
TreeHugger Robot
9c4b6d3bff Merge "DividerView choreographer set earlier to avoid null exception" into oc-dev 2017-05-27 01:29:47 +00:00
Matthew Ng
a10a9db792 DividerView choreographer set earlier to avoid null exception
DividerView sometimes gets attached (after created) after minimized mode
has triggered and therefore causes choreographer to trigger a null
exception. So put it in the constructor to avoid this issue.

Change-Id: Iad32fa42ab2bc60bde4ac0be8f8eac8b55de40ae
Fixes: 38017227
Test: manual - hard to repro, keep rotating screen while minimized
2017-05-23 15:00:56 -07:00
TreeHugger Robot
5b49464dc6 Merge "Fixed unminimizing during battery saving mode" into oc-dev 2017-05-23 17:44:13 +00:00
Matthew Ng
04f34304fb Fixed unminimizing during battery saving mode
Added code to restore docked stack to the position before minimized
state when no animation duration is specified. Battery mode skips
animations and therefore it provides no animation duration.

Change-Id: Ica4e4497b90d6b99c9c2c78b5e27365fe35b37ce
Test: manual
Fixes: 36768431
2017-05-18 16:16:33 -07:00
Jorim Jaggi
ef496ea80d Optimize App -> Recents
- Use same strategy to draw thumbnail bitmap by moving
startActivity off from the main thread and start caching the future
when AM is busy executing startActivity.
- Move some binder calls off the main thread.
- Add some trace points for better analysis in the future.
- Make toggleRecentApps asynchronous so we don't have to wait on
the next app-vsync - it's totally not needed.

Test: com.android.apptransition.tests.LatencyTests

Fixes: 32668632
Change-Id: Id6483e26e9d6c1e319bceaa8268da976cedfbca3
Merged-In: I15db41f2e821779972ab3b430033c70aa1dfd907
2017-05-17 14:16:57 +02:00
TreeHugger Robot
8902bbe4e3 Merge changes I7b5504d0,I10c263dc into oc-dev
* changes:
  Get rid of a lot of binder calls
  Fix recents entry delay
2017-05-13 12:57:23 +00:00
Jorim Jaggi
ddb449efd9 Get rid of a lot of binder calls
Lead to delays when entering recents.

Test: Open recents
Bug: 32668632
Change-Id: I7b5504d0c11208d9c4d55de2eace6407d186f25c
2017-05-13 12:34:25 +02:00
Matthew Ng
f9989e2304 Fixes divider position after minimizing and unminimizing with ime open
Minimizing with the ime would cause visual glitches with the divider and
unminiming after would set the wrong position leaving graphical errors.
Record the position before minimizing when adjusting for ime and do not
set that position when the ime is still adjusted. Also added animation
for the divider when adjusting for ime.

Bug: 36603383
Test: manual
Change-Id: I456f3a726c62d130dce6c58c2245982e7f46454c
2017-05-09 13:04:49 -07:00
Matthew Ng
678d8577a7 Toggling minimized state with overview moves divider to correct position
When docking any app with overview on the bottom and continuously press
the overview button would not cause the position before minimized
variable to record an incorrect position. Instead only record when not
animating so that the original position is kept. Then after unminimizing
the docked stack, it will return back to the original position that was
recorded.

Change-Id: Ia9da24dcb2a5be1f10be3797007e02b1a1425345
Fixes: 35642296
Test: manual
2017-05-05 19:52:02 +00:00
Andrii Kulian
036e3adce7 Don't put non-resizeable activities on secondary displays
There is a contract that a non-resizeable activity cannot get
a configuration different from the global config (or fullscreen
config on primary display). This CL ensures that for launching on
secondary displays and checks if target display's config matches
the global config.
If a forced-resizeable activity is launched to a secondary display
or there was an attempt to launch a non-resizeable activity that
failed, corresponding toast message will be displayed.

Bug: 36777179
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testLaunchNonResizeableActivityOnSecondaryDisplay
Test: #testLaunchNonResizeableActivityWithSplitScreen
Test: #testMoveNonResizeableActivityToSecondaryDisplay
Change-Id: I5346afe740e78e4e5ba9a9694e97ac60b92663e9
2017-04-20 15:42:07 -07:00
Alan Viverette
51efddbd3b Remove unnecessary casts on calls to findViewById
Just frameworks/ this time. More paths to come.

Bug: 24137209
Test: make -j32
Change-Id: Iff27abd26fa43296ac2fff8f534fc6742d2ae80c
2017-04-14 11:15:50 -04:00
Jorim Jaggi
ed7993b5d1 Introduce android.anim thread in system_server
We create a new thread on which everything is running that
directly impacts window animations, i.e. layout, anim tick and
starting window creation. This is such that any work on
android.display can not lead to jank in the window animation,
specifically lock contention on activity manager lock that blocks
callbacks from android.display into AM can not lead to window
animation jank.

Test: Run animation, take systrace, make sure animation is on
android.anim
Test: AppWindowContainerControllerTestTest: AppWindowContainerControllerTestss
Fixes: 36792959

Change-Id: I5d41419a709b7984724e7053a3afdcc1ffe1aaa2
2017-04-07 22:10:34 +02:00
Jorim Jaggi
d6d6de6da4 Schedule window animations at vsync-sf
Test: Run window animation, make sure it's smooth
Test: Take systrace, make sure it runs at vsync-tick
Test: Move divider, make sure it's still smooth

Change-Id: I1600618e074be811134fe4ccb1dfbd5034820c71
Fixes: 36583867
2017-04-03 15:27:16 +02:00
Matthew Ng
aa2b620cb7 Fixes minimized state to match task and stack bounds for cts test
Fixes minimized state for its task and stack bounds to always match
inline with the cts test that was failing.

This also fixes multiple state issues related to splitting home and
recents into different stacks when recents incorrectly reads home stack
bounds to determine bounds for recents.

Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test
CtsServicesHostTestCases
android.server.cts.ActivityManagerActivityVisibilityTests or
ActivityManagerDockedStackTests
Fixes: 35351074, 35145587
Change-Id: I6417a567e937c647818ff26dc08df463e6ef4257
2017-03-10 16:26:14 -08:00
Matthew Ng
fb692acb64 Longpress overview in minimized mode only for resizable launches (1/2)
Since resizable launchers in minimized mode shows more of the docked
stack than in non-resizable launchers, it will play the same
functionality as split screen where long press overview button will
exit split screen into fullscreen mode.

Test: test was written - adb shell am instrument -w -e class
com.android.androidbvt.SysUIMultiWindowTests
com.android.androidbvt/android.support.test.runner.AndroidJUnitRunner
Fixes: 34892561
Change-Id: I9f957dada1b325b36068d59fa9b2d1fa4912b804
2017-02-03 18:12:54 -08:00
Matthew Ng
e15352e516 Splitscreen for minimized state that works with resizable launchers
If a launcher is resizable, going to minimized mode (dock task and then
press home) would show a cropped height of the task at the top in a
minimized state and the fullscreen stack would show the home launcher
which takes the rest of the remaining height. If the launcher is not
resizable, it will default the original behavior.

To enable this in a launcher, add android:resizeableActivity="true" in
the AndroidManifest.xml in the <application/> tag.

Test: manual - rotating while minimized, minimizing using dragging task
or holding overview nav button, installing resizable launcher with a
non-resizable launcher
Fixes: 32504542
Change-Id: Idf4015b40f9bec81b70f146f0f2d7df8ccfb4cf0
2017-01-26 10:31:50 -08:00
Winson Chung
cbcadc981b Ensure that we always resume task overlay activities if requested.
- Distinguish between task overlays that need to be resumed and
  those that should not.

Bug: 34240533
Test: Open PiP, tap to show menu.
Change-Id: Ibdb54d544c501a492260f02cdc2de40c5c1a66d1
2017-01-12 17:23:18 -08:00
Matthew Ng
8d3728806c Cancels out long press on recents fixed from previous change
This fixes an error from change-id
Ic9c8a5096ce9f30fc1265774ebb82c1356b1221b where the docked state was
not dismissed when long pressing recents. Minimized state is also
handled by not having the second vibration.

Test: manual - tested home screen, minimized, dock and undock the tasks
into multi-window mode
Fixes: 33655754
Fixes: 29927464
Change-Id: I3adedf9d0e1dcd5fe297f7ca8b9cb8faeba8bcb1
2016-12-20 12:08:57 -08:00
Wale Ogunwale
6ce0fb8ddb Fixed issue with ordering of non-app token windows
We tried to fix this issue in I83357975c87c704af9d0702c939ca99984462365
but the fix introduced other problems. So, we are going to have sys-ui
create a separate binder for object for each type of window it adds.
Long term we want to allow one binder object to map to multiple window
tokens on the same display in window manager.

Change-Id: Iee53b8bf95b87f79ab7a1b574a54111c678f7413
Fixes: 33567674
Fixes: 33538278
Test: bit FrameworksServicesTests:com.android.server.wm.DisplayContentTests
2016-12-13 14:24:00 -08:00
Sudheer Shanka
dc589ac82b 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
2016-11-14 11:27:12 -08:00
Tamas Berghammer
383db5ebcc Update package names to work with the proto3 compiler
Bug: b/28974522
Change-Id: I5f3adf4946ee4ba1e09e4f40afe83c151405972a
2016-11-08 14:06:09 +00:00
Jorim Jaggi
3f23c9f36e Merge "Fix split-screen flash issue" am: 6738617652 am: f1fed4de21
am: 4e7407a80e

Change-Id: Ibfef3bd01a54cca64a2f0de197bd9480a7539cd0
2016-10-14 14:24:48 +00:00
Qiushi.Han
9170ca82bd Fix split-screen flash issue
For smaller size screens (such as 720p), in split-screen view,
the size of DividerSnapAlgorithm.mTargets is 3, the divider line
can only stop in the middle.

As the original logic, when tapping recent, it will cause the top-docked
activity to resize, leading to flash in some cases.

To fix this, do not call startDragging in this scenario.

Google issue:
https://code.google.com/p/android/issues/detail?id=224851

Change-Id: Iac58d536ccf668eed67f82418ce2cf90d46670ed
2016-10-10 14:07:39 +08:00