Commit Graph

7440 Commits

Author SHA1 Message Date
Robert Carr
a8fe43f09c Ensure SurfaceView requests WM relayout when size changes.
In the case of scaled SurfaceViews with a fixed size.
It is possible for the surface layout size to change
without a change to the surface size or position. In this
case we need to inform the window manager so it can update
frames and scaling. This has presented in Camera and required
workarounds such as changing the fixed surface size to trigger
an update (leading to visual artifacts).

Bug:23974105
Change-Id: I195aa0832907c32874b294101b56e198e853dce5
2015-10-07 11:24:31 -07:00
Skuhne
980ee47ffe Resolving incorrect rendering of content while resize
The staged content bounds need to be set by the content renderer
and not by the resize thread.

Bug: 24671393
Change-Id: I8f84ec01a4ac6c1e783cc6208ca77ca6c01ba838
2015-10-06 13:52:17 -07:00
Chong Zhang
a42521ca0a Merge "Make window callbacks non static member of ViewRootImpl" 2015-10-06 18:56:13 +00:00
Chong Zhang
dcee1dea6b Make window callbacks non static member of ViewRootImpl
Move add/removeWindowCallbacks to onAttachedToWindow/onDetachedFromWindow.

There might be more than one windows in an app process, the window
callbacks need to be per window, not global.

bug: 24679461
Change-Id: I216ff27b2a41ecfe7399a8161df362bebc0ac96a
2015-10-06 10:29:55 -07:00
Chet Haase
4164e6a8da Merge "Enable activity rendering during window animations" 2015-10-05 22:27:02 +00:00
Chet Haase
9c45041105 Enable activity rendering during window animations
A change was made back in ICS that prevents the view hierarchy from rendering
during window animations. Specifically, it allows the hierarchy to render once (to draw
the results of its first layout), but further drawing is suppressed at the
ViewRoot/performTraversals level until the window animation is complete.

This change was introduced to avoid jank problems that were resulting from
thrashing the GPU by issuing drawing commands from multiple processes simultaneously,
and limited the number of rendering processes to mainly the system server (and
possibly the System UI), which allowed window animations to be much smoother.

This fix contributed to another source of jank, however, in which applications
which attempt to animate when they first appear will not render any frames of
animations until the window animation is done, resulting is a snapping to the resulting
state once the window animations are complete.

Meanwhile, hardware has gotten faster and GPUs have gotten better, and it is time to
revisit this logic. This change disables the earlier fix and allows view hierarchies
to draw normally, regardless of whether window animations are taking place.

Issue #22232939 Remove flag that prevents drawing during window animations

Change-Id: I4c960180771ff09a7088abd77b437586e835a991
2015-10-05 14:58:17 -07:00
Filip Gruszczynski
14418daa09 Fix recents crashing during docked stack resize.
Whether acitvity window should be preserved during the relaunch is
controlled by the activity manager and the existence of
non-client-decor should not affect it. For example, docked activities
will not have non-client-decor, but we would like to preserve them
anyway.

Bug: 24573657
Change-Id: I5d4852c3b7c26ac3ec1bbc105639f75b67d1d3ad
2015-10-05 10:56:49 -07:00
Toni Barzic
8a20b7021a Merge "[a11y] Add default autoclick delay value to AccessibilityManager" 2015-10-02 19:29:06 +00:00
Skuhne
b816087962 Rendering the window frame with a second thread
Using a multi threaded render node to render the window frame
asynchronously from the application relayout.

Bug: 22527834
Bug: 24400680
Bug: 24459827
Bug: 24409773
Bug: 24537510
Change-Id: I1010fc6a8b6e38424178140afa3ca124433ab7e4
2015-10-02 07:11:45 -07:00
Toni Barzic
f3d78a2fa8 [a11y] Add default autoclick delay value to AccessibilityManager
The goal is to make this value shareable with Settings code (without
adding dependency on com.android.server)

Change-Id: Ic41af575dcf8081de69bdcdb20fba430bcf3257e
2015-10-01 12:26:24 -07:00
Alan Viverette
4d4b9fd78f Merge "Document API-level-specific delegate behavior" 2015-10-01 01:08:53 +00:00
Filip Gruszczynski
0daf2102a2 Fix leaking the first activity while preserving windows.
This is achieved by not having the decor view hold onto the activity
context. Instead, we are wrapping application context, so that we can
have theme support and also have a special instance of window manager
that is aware of the phone window (the same way as activity do).

This reverts commit a5ffea3b7d.

Change-Id: I924f4c7ef8f0d20e9174bd7b3e00ec00b44443b9
2015-09-29 16:31:40 -07:00
Alan Viverette
7141cba640 Merge "Clear stack trace from re-thrown inflater exceptions" 2015-09-29 16:25:42 +00:00
Alan Viverette
c687c19418 Document API-level-specific delegate behavior
Change-Id: I49590735f50f12eabadce1f48323a1d4082ea3d2
2015-09-29 11:02:21 -04:00
Filip Gruszczynski
f77a6dbac6 Merge "Refactoring: Delete AppWindowToken.willBeHidden field." 2015-09-27 21:50:49 +00:00
Filip Gruszczynski
8aafd3a81b Refactoring: Delete AppWindowToken.willBeHidden field.
The only time AppWindowToken.willBeHidden is used is for determining
if the app should contribute to calculating orientation. In the same
check AppWindowToken.hiddenRequested will be or-ed with willBeHiden,
so it's enough that hiddenRequested to be set.

The only place where willBeHidden is set, is right before
WMS.setAppVisibility is called, which will set hiddenRequested.
Because of this willBeHidden is unnecessary.

Change-Id: Iea35f39f72e7f0dcd76205ef580f3a74cac72d08
2015-09-26 15:40:58 -07:00
Alan Viverette
8f12481802 Clear stack trace from re-thrown inflater exceptions
We don't need intermediate stack traces for re-thrown inflater
exceptions. Yes, we care that you failed to inflate some class.
No, we don't care how many times you recursed in LayoutInflater
before you got there.

Change-Id: Ie9bba7cebab6cdf73ceead49f080dcf23e0a9f25
2015-09-25 15:17:05 -04:00
Oren Blasberg
ed3912692f Make context menus show as popup menus.
This means that right-clicking/long pressing on a view that is registered for
context menu will show the context menu as a popup menu instead.

Bug: 20016398
Change-Id: I96fea60435fff2f981d288521f490f8ff24ada15
2015-09-25 12:01:01 -07:00
Wale Ogunwale
4f52bc6f78 Batch ACTION_MOVE events to vsync boundries when resizing task
- Created helper class BatchedInputEventReceiver for batching
ACTION_MOVE events to vsync boundries.
- Switched TaskPositioner to use new helper class for input events
so we reduce the number of input events we process per vsync.

Bug: 24375616
Change-Id: I4ee27949b956784fb89d8f190497e4765522c9d3
2015-09-24 14:31:11 -07:00
Filip Gruszczynski
466f321650 Showing docked stack divider window.
When there is docked stack, we want to show a "handle" through which the
user will resize the docked stack. We add it from the system process,
because we want to avoid IPC calls.

Change-Id: If15fd2a0fcb7077446d1ba6c533acb3028a42039
2015-09-23 14:58:43 -07:00
Chong Zhang
6e533d5379 Merge "Do not do setSurface on window size changes" 2015-09-21 22:09:10 +00:00
Stefan Kuhne
fe1f99c2b2 Merge "MultiThreaded rendering of different renderNodes" 2015-09-21 22:08:30 +00:00
Chong Zhang
23d62fd37d Do not do setSurface on window size changes
Surface should only be invalidated when surface generation changed
(which we're already doing). Window size change doesn't always imply
a surface change. During a drag-resizing action, the window size is
constantly changing but the surface remains the same. setSurface
could take 12ms+ each frame and cause frame drops.

bug: 23793966

Change-Id: Iac0456122e8916cf06b1a7a0940584ab4bf4065d
2015-09-21 13:46:53 -07:00
Skuhne
ea7a7fb75a MultiThreaded rendering of different renderNodes
This is adding the renderer side infrastructure to allow
rendering multiple render nodes with different threads.
This is a pre-step for decoupling a non client decor
resize reder from a content resize render.

Multiple render nodes can be added to be drawn, and to
prevent overdrawing, a content bounds area can be set

Bug: 22527834

Change-Id: Ie7271e20895bf38957e5a84aeefc883e282039ad
2015-09-21 07:18:00 -07:00
Justin Harrison
c0f2bc0f0e am 46db0f22: am 08b00423: am 1f463957: am 91f2123b: Merge "Add support for setting color transforms" into mnc-dr-dev
* commit '46db0f2215ad6e969418d1fedd1578445b46588f':
  Add support for setting color transforms
2015-09-19 18:14:55 +00:00
Justin Harrison
46db0f2215 am 08b00423: am 1f463957: am 91f2123b: Merge "Add support for setting color transforms" into mnc-dr-dev
* commit '08b004233537f625044b3f01e2923b600a9aa77c':
  Add support for setting color transforms
2015-09-19 00:46:19 +00:00
Justin Harrison
1f46395702 am 91f2123b: Merge "Add support for setting color transforms" into mnc-dr-dev
* commit '91f2123b2a6d534372ab9b7c8e6ac0c62cf33ae6':
  Add support for setting color transforms
2015-09-19 00:29:40 +00:00
Michael Wright
58e829f71d Add support for setting color transforms
Bug: 24038268
Change-Id: I05275c906e02eb9e67331f6f909166eb08ad5536
2015-09-18 23:37:28 +00:00
Christine Hallstrom
c4f196b661 am 039fd00f: am 13c23df9: Merge "Manual \'cherry pick\' to fix CTS tests for MediaControllerTest." into cw-e-dev
* commit '039fd00fd2b499a871be8551d80d299120ff5595':
  Manual 'cherry pick' to fix CTS tests for MediaControllerTest.
2015-09-18 22:06:38 +00:00
Christine Hallstrom
2eb7d4761e Manual 'cherry pick' to fix CTS tests for MediaControllerTest.
This is to manually apply a patch of code that should have
propagated to E, but hasn't and is breaking one of the CTS
tests for MediaControllerTest on Nemo.

The original reverted change can be found at ag/723643.

Bug: 24172957
Change-Id: I925ff561a56531ebf9f8d8b4ce56156ae7feb9fc
2015-09-18 21:27:38 +00:00
Alan Viverette
a61214d926 Merge "Send WINDOW_STATE_CHANGE when window becomes visible or gains focus" 2015-09-18 20:42:51 +00:00
Alan Viverette
64bf97ad0a Send WINDOW_STATE_CHANGE when window becomes visible or gains focus
Previously we would only send STATE_CHANGE events when the window was
added and then received input focus.

Bug: 23974711
Change-Id: Ic25ed64e024f69818c34574d7f57413699088d99
2015-09-18 16:42:00 -04:00
Alan Viverette
87c315de10 am c602c577: am 48c7e6f3: am 24ff6823: Merge "prevent unnecessary warning logs caused by View.toString()"
* commit 'c602c577377d7f0d47718f3bfb77afc876f35626':
  prevent unnecessary warning logs caused by View.toString()
2015-09-18 20:27:42 +00:00
Alan Viverette
c602c57737 am 48c7e6f3: am 24ff6823: Merge "prevent unnecessary warning logs caused by View.toString()"
* commit '48c7e6f3dc0462f43657b6003e4ba4021b0544ed':
  prevent unnecessary warning logs caused by View.toString()
2015-09-18 20:19:27 +00:00
Alan Viverette
48c7e6f3dc am 24ff6823: Merge "prevent unnecessary warning logs caused by View.toString()"
* commit '24ff6823c411f794aceaae89b0b029fbf8ef6b29':
  prevent unnecessary warning logs caused by View.toString()
2015-09-18 20:11:44 +00:00
Alan Viverette
24ff6823c4 Merge "prevent unnecessary warning logs caused by View.toString()" 2015-09-18 19:59:20 +00:00
kenzyun_chen
90ebb99b36 prevent unnecessary warning logs caused by View.toString()
If the id is negative, it is not from Resource.
Passing the negative value to getResourcePackageName makes AssetManager dump unnecessary warning logs.
It is reasonable not to get package/type/entry information for the negative id.

The warning logs :
W/ResourceType( 3711): No known package when getting name for resource
number 0x9b010100

Change-Id: Ic89acb4f32205ba5a2fdac61dc14b00ccf251148
2015-09-18 18:30:30 +08:00
Chong Zhang
87975b77bc Merge "Place surface at screen't top-left when doing drag resizing" 2015-09-17 21:57:34 +00:00
Chong Zhang
0275e397f4 Place surface at screen't top-left when doing drag resizing
Instead of letting the client render to (0,0) and moving the surface
around, put the surface at a fixed location, and let the client render
to the screen position within the surface.

This fixes the window shaking problem when resizing by dragging window's
top-left corner. The frame rect used in last draw is lagging window
manager's latest bounds for the window, moving the surface's position
would make the window's bottom-right corner appears moving (while it's
supposed to be stationary).

bug: 23793966

Change-Id: Ideb152fc48502f8e9672235f10b044889235e7df
2015-09-17 14:49:58 -07:00
Alan Viverette
3609ec6818 Merge "Clear accessibility focus when hierarchy is removed" 2015-09-17 21:05:16 +00:00
Vladislav Kaznacheev
03b56c228a Merge "Handle content URI permissions on drop" 2015-09-17 20:41:44 +00:00
Alan Viverette
2371276e7d Clear accessibility focus when hierarchy is removed
Bug: 24127950
Change-Id: I428347fe6275bbeaa273793fac889d3f415324b8
2015-09-17 13:43:01 -04:00
Wale Ogunwale
61b009e059 Don't crop home activity windows to stack bounds.
We crop windows to their stack bounds when the docked stack
exists. We don't want to do this for the home activity since
the docked stack isn't visible when the home activity is visible.

Change-Id: Ibb3157dabbb6c979358ddc2098a01c6ddf6540e8
2015-09-16 22:23:47 -07:00
Vladislav Kaznacheev
ede5f5480e Handle content URI permissions on drop
Change-Id: I846071f01ecd1eff8e3a54a1806e68e1a4b335d2
2015-09-16 17:35:10 -07:00
Filip Gruszczynski
a59ac9cd64 Preserve window during resize triggered relaunches.
This changes application code behavior when the activity relaunches due
to configuration change. It only applies to scenarios, where the
configuration change was triggered by a user generated resize of an
activity (i.e. user drags a corner of an activity and thus changes its
size).

Preserving a window means that we will keep the decor view and non
client decor view around, but remove all children views when the
activity gets destroyed. When the activity gets created again, it will
attach its new content to the preserved view hierarchy. Mind, we
actually recreate application side Window object, since some of its
features might changed, but we retain its elevation (to not trigger
relayout with new layout params).

Preserving the window also means that we don't call the window manager
service to remove and later add the window. Instead, we continue using a
single window state throughout the resize operation.

Change-Id: Ie3d2878ed09c99ff343044bfe7a29a0ba07a265e
2015-09-14 15:59:32 -07:00
Alan Viverette
73f6d60543 Include window type in relevant BadTokenExceptions
Bug: 23980921
Change-Id: Idb0f2d1fd0fd0c8525c6566c538c4cc6b5bb148b
2015-09-14 16:01:19 -04:00
Chong Zhang
8e89b31a62 Move window moving and resizing handling to WindowManager
- add a startMoving API to initiate a window move from app, once
  the move starts WindowManager will take over the event handling.

- detect touch events along window's outside border and start
  a resize if necessary

Change-Id: Ic7e8baba34e0aa27a43173e044ffb46e93e219e0
2015-09-11 17:15:19 -07:00
Nick Armstrong-Crews
3a5a8c741b Remove @hide for KEYCODE_SOFT_SLEEP.
Change-Id: I56a6da9faeafb26145e1d9ad82a16df46320c24e
2015-09-09 10:10:58 -07:00
Alan Viverette
c6c28731e5 Merge "Invalidate when Drawable.setState() returns true" 2015-09-08 14:08:19 +00:00
Nick Armstrong-Crews
9fb0b5b12c am 13d2fa50: am 740cf71c: am 56ecfcce: Handle KEYCODE_SOFT_SLEEP from Ungaze.
* commit '13d2fa50b0815c63d2d289c27d8edacf1ace01eb':
  Handle KEYCODE_SOFT_SLEEP from Ungaze.
2015-09-08 05:38:30 +00:00