Commit Graph

8578 Commits

Author SHA1 Message Date
Eino-Ville Talvala
b13b6bd20e android.view.Surface: Add parceling warning am: f005f5ed88
am: 286b1a83e4

Change-Id: I799dca3ed9da618ec88b8d554520aba649918d94
2016-08-30 17:57:12 +00:00
Eino-Ville Talvala
286b1a83e4 android.view.Surface: Add parceling warning
am: f005f5ed88

Change-Id: Id2c772873fbf98653e751036790484d0fbf7bb16
2016-08-30 17:50:12 +00:00
Jorim Jaggi
c5bafe26cb Add animation when unoccluding windows (1/2) am: 6626f54e65
am: 314c05db45

Change-Id: I0e9d85e8f90d00fe835c0622438ac5b6afd2b52d
2016-08-30 02:33:24 +00:00
Eino-Ville Talvala
f005f5ed88 android.view.Surface: Add parceling warning
Surface is parcelled partly in java, partly in native, and any fields
added in java have to be accounted for in the native side as well.

Add a warning to avoid issues in the future

Bug: 31162160
Change-Id: I48ca1bc3eea29f1ac3d3065f6defb6ed2be4052a
2016-08-29 17:51:23 -07:00
Jorim Jaggi
314c05db45 Add animation when unoccluding windows (1/2)
am: 6626f54e65

Change-Id: I09be1e1b7d830067c354c6cdfd940deafa027a22
2016-08-30 00:25:52 +00:00
Jorim Jaggi
6626f54e65 Add animation when unoccluding windows (1/2)
Before there was a jump-cut when a window that was occluding Keyguard
was going away, leading to an ugly flicker. To fix this, we do the
following.

- Always show windows with FLAG_SHOW_WHEN_LOCKED above lockscreen, even
if they don't "match" the currently occluding app (which is null in the
animation case)
- Move wallpaper behind last window that is not hidden by policy, so the
window doesn't get occluded by the wallpaper.
- Add a flag in the setOccluded call whether to animate or not. SystemUI
then plays a nice animation when it's set.
- Override the animation to always be the animation that happens when we
exit a window which is revealing the wallpaper behind, to make it
consistent with the home screen case.

Fixes: 30829255
Change-Id: Ib3fe20fc9003a0f9f291c974740f044ed8707e75
2016-08-29 14:15:33 -07:00
Pablo Ceballos
658f26634f Fail createVirtualDisplay with single-buffered Surface am: aff2f94939
am: d387b20dcb

Change-Id: I8d438809f79ac8b333acaadc14f751f4282b93d7
2016-08-29 18:08:29 +00:00
Pablo Ceballos
d387b20dcb Fail createVirtualDisplay with single-buffered Surface
am: aff2f94939

Change-Id: I5cfcbd0352240d7ac2a9bb0804896cae5396450e
2016-08-29 17:59:07 +00:00
Pablo Ceballos
23784fd6d9 Merge "Fail createVirtualDisplay with single-buffered Surface" into nyc-mr1-dev 2016-08-29 17:42:00 +00:00
Adam Powell
393279da8f Fixes for ImageView drawable visibility dispatch am: 06f9eb8b62 am: fd86f7fdfd
am: ee2f4d890e

Change-Id: I8cb5a6e2ffc7a62cf6fe68176482cdaefc596ecc
2016-08-27 01:31:07 +00:00
Adam Powell
ee2f4d890e Fixes for ImageView drawable visibility dispatch am: 06f9eb8b62
am: fd86f7fdfd

Change-Id: I155ed970c7f58895419778f01eebc5babb141c33
2016-08-27 01:25:05 +00:00
Adam Powell
fd86f7fdfd Fixes for ImageView drawable visibility dispatch
am: 06f9eb8b62

Change-Id: I8b7d8c73f0a718963a191fd5460517e5a7445974
2016-08-27 01:19:28 +00:00
Chong Zhang
818b7218c5 DO NOT MERGE -- Only use saved surface if started by launcher or moved to front am: 813be138ae am: 9f92bc2602
am: 8673e303a7

Change-Id: I34d205de8f368df05e068548a69448da397d2e41
2016-08-26 23:40:04 +00:00
Chong Zhang
8673e303a7 DO NOT MERGE -- Only use saved surface if started by launcher or moved to front am: 813be138ae
am: 9f92bc2602

Change-Id: I94e29886a23fc829b4608a908df90746a4d794e5
2016-08-26 23:33:27 +00:00
Chong Zhang
9f92bc2602 DO NOT MERGE -- Only use saved surface if started by launcher or moved to front
am: 813be138ae

Change-Id: Id64071882a0b90212b92234a4d0bdc67f2ee5e1a
2016-08-26 23:28:17 +00:00
Adam Powell
06f9eb8b62 Fixes for ImageView drawable visibility dispatch
Some apps rely on their drawables not getting not-visible hints via
setVisible when the window visibility changes. This manifests as
additional animations, such as crossfading from placeholders when the
window becomes visible again.

Apps should be able to handle this case in the future now that we have
more detailed reporting via onVisibilityAggregated, but to keep
existing apps working as-is, ImageView now operates in a compatibility
mode for targetSdkVersion < N and will only dispatch visibility
signals based on the same triggers used in M. New apps get the more
detailed signals.

Fix a bug where window visibility dispatch via onVisibilityAggregated
would double-dispatch "not visible" when the window is transitioning
from GONE => INVISIBLE or INVISIBLE => GONE.

Make the growing set of compatibility check fields in ImageView
static, matching the pattern from View.

Bug 30216207

Change-Id: I88875260bf6aaa23687c7d51353de8d633383531
2016-08-26 22:59:39 +00:00
Chong Zhang
813be138ae DO NOT MERGE -- Only use saved surface if started by launcher or moved to front
Restrict saved surface to launcher start (ACTION_MAIN&CATEGORY_
LAUNCHER), or there is no intent at all (eg. task being brought to
front). If the intent is something else, likely the app is going
to show some specific page or view, instead of what's left last time.

This solves problems like the launcher shortcuts on DeckClock,
each of them is a different intent and will show one specific
view regardless of last states. Another example is Chrome tab
opened directly by action VIEW to open some URL.

(Note that this doesn't solve the problem with Chrome homescreen
shortcuts, it will still start with saved surface (if Chrome
is already open). This is because the shortcut is a trampoline
activity that starts the real chrome tab activity, but when
the trampoline is started, the whole task is already brought
to front, and ChromeTab could become visible with the task
before we actually start it.)

bug: 31055479
bug: 27747315

Change-Id: Id3e61c61ef516b0edc1f174320f02661222f226b
(cherry picked from commit ad24f96def)
2016-08-26 15:41:58 -07:00
Pablo Ceballos
aff2f94939 Fail createVirtualDisplay with single-buffered Surface
Bug 30106031

Change-Id: I434df329eb3c162dd9ef01245ac5e0da97216e70
2016-08-25 12:06:52 -07:00
Phil Weaver
381e4fdc7c Revert "Dispatch a11y events in separate thread." am: 5de2feab26
am: f0b8302109

Change-Id: I22e5ca5b0ecfd98e89d8546e287be56ec342ce57
2016-08-25 18:15:47 +00:00
Phil Weaver
f0b8302109 Revert "Dispatch a11y events in separate thread."
am: 5de2feab26

Change-Id: I0dcc9172c397dd44888de3295e5a34245b122096
2016-08-25 18:09:50 +00:00
Phil Weaver
1bb2cc8cc3 Merge "Revert "Dispatch a11y events in separate thread."" into nyc-mr1-dev 2016-08-25 18:05:36 +00:00
Phil Weaver
5de2feab26 Revert "Dispatch a11y events in separate thread."
This reverts commit c34649411d.

Dispatching accessibility events in their own thread is causing Chrome and gmail to crash. We've identified two issues: Chrome is allocating strings natively using references that aren't valid outside of their thread, and the text is being set to values that are changed in the UI thread. 

I'm going to resolve these issues on master by making deep copies of the strings, but that change will have its own performance implications.

Since we were bit almost immediately by an unexpected result of this change, and I need to erode its benefit by making deep copies, I think it's a bad bet to push it into MR1.

Bug: 31042124
Change-Id: I6f5c225a9197036db43fd0ac6008447b22617525
2016-08-25 16:31:25 +00:00
Alan Viverette
54131127e8 Clean up VideoView, SurfaceView constructors am: 768ca7d19b
am: 9af5e5b31b

Change-Id: Ic017d3855d81b3a6fbc72fd4c256f55584e453da
2016-08-24 18:43:53 +00:00
Alan Viverette
9af5e5b31b Clean up VideoView, SurfaceView constructors
am: 768ca7d19b

Change-Id: Ia3ff40a2c6dbbb2a725bc6306401de3cd662ba33
2016-08-24 18:31:38 +00:00
Alan Viverette
16b8941dba Merge "Clean up VideoView, SurfaceView constructors" into nyc-mr1-dev 2016-08-24 18:17:04 +00:00
Ned Burns
312a7289dc DO NOT MERGE Cherry-Pick: Add ViewConfiguration.getScaledScrollFactor()
am: a5b41c88ec

Change-Id: I89907ec2fa66229a77f959d8b3459211a4cd0da0
2016-08-23 18:16:55 +00:00
Ned Burns
b8e74df82d Merge "DO NOT MERGE Cherry-Pick: Add ViewConfiguration.getScaledScrollFactor()" into cw-f-dev 2016-08-23 17:52:58 +00:00
Adam Powell
7cc5539a03 Only dispatch window visibility aggregation for targetSdk >= N am: 64e1ba4398 am: 02abbe8d4c
am: ca3a267478

Change-Id: I906793dda8f825882b562ab39822274cb5a0a1c7
2016-08-23 16:39:52 +00:00
Adam Powell
ca3a267478 Only dispatch window visibility aggregation for targetSdk >= N am: 64e1ba4398
am: 02abbe8d4c

Change-Id: I66f8610e52f2aaf06b02fa8d369692fc2f89ee17
2016-08-23 15:33:49 +00:00
Teng-Hui Zhu
0b1ef056cc Correctly report the transparent region am: f8da30dc65
am: 94a2f7e6fd

Change-Id: Ice979b549a74f1e8e59210f2b7c7e5a6f141b9f6
2016-08-23 15:15:06 +00:00
Teng-Hui Zhu
94a2f7e6fd Correctly report the transparent region
am: f8da30dc65

Change-Id: I2fa623c2893a6cea96843f78d46fe753913b6f4d
2016-08-23 14:45:55 +00:00
Adam Powell
02abbe8d4c Only dispatch window visibility aggregation for targetSdk >= N
am: 64e1ba4398

Change-Id: Id2d00bc0ae66cdfca11e34b8f1465e4ce19243dc
2016-08-23 00:17:14 +00:00
Tenghui Zhu
f05765e3c4 Merge "Correctly report the transparent region" into nyc-mr1-dev 2016-08-22 21:56:37 +00:00
Adam Powell
64e1ba4398 Only dispatch window visibility aggregation for targetSdk >= N
Some existing apps treat drawable visibility notifications as a signal
to crossfade from a placeholder to the new image for the purposes of
scrolling onscreen via a recycling collection view or similar. Since
dispatchVisibilityAggregated is now called for window visibility
changes and ImageView informs its drawable of the visiblity change,
the extra call triggers a repeat fade-in in some existing apps when
you return them to visibility.

These apps should pay attention to the second parameter of
Drawable#setVisible, which signals that animations should not restart
in response to a visibility change. Updating to targetSdkVersion=24+
will enable the new behavior.

Bug 30216207

Change-Id: I27ce9f09bc7544863f7f7980c273650949db21cc
2016-08-22 17:47:09 +00:00
Phil Weaver
31f764496f Dispatch a11y events in separate thread. am: c34649411d
am: d4847f282d

Change-Id: I0e55dfc4563418ebe30a690fa2348a8093187fde
2016-08-19 23:08:51 +00:00
Phil Weaver
d4847f282d Dispatch a11y events in separate thread.
am: c34649411d

Change-Id: Ie19da4e16b9bc78574545bbba1d44f28ef065b3d
2016-08-19 22:46:13 +00:00
Ned Burns
a5b41c88ec DO NOT MERGE Cherry-Pick: Add ViewConfiguration.getScaledScrollFactor()
This value is used to convert ACTION_SCROLL axis values into raw
pixel distances.

CP of ag/1333603 from master to feldspar-dev. New method is @hide and
@SystemApi in this version. In master, it's part of the new public
API, but feldspar will launch before O.

Change-Id: I5ee73ebcd183c43939ae8aa157e88489e05d4760
2016-08-19 13:19:20 -04:00
Phil Weaver
c34649411d Dispatch a11y events in separate thread.
Moves the IPCs into a separate thread, where they should affect
jank a lot less.

Bug: 30183085
Change-Id: Ib76159d158e7a867e76cdd5c8ea3a318949fcc5b
2016-08-19 09:22:10 -07:00
Yohei Yukawa
8c8477d036 Make View#isTemporarilyDetached() less confusing am: ed841cbdd7
am: 6bc17c7320

Change-Id: Iec61193cd1d1902aa9aad1ad9ac1d6f4944c748b
2016-08-17 19:55:47 +00:00
Yohei Yukawa
6bc17c7320 Make View#isTemporarilyDetached() less confusing
am: ed841cbdd7

Change-Id: I2df97c1babb9fc515295c527a18d9f88546dfad7
2016-08-17 19:49:01 +00:00
Yohei Yukawa
4aa5325ba8 Merge "Make View#isTemporarilyDetached() less confusing" into nyc-mr1-dev 2016-08-17 19:41:40 +00:00
Chong Zhang
9391bc557c Add new window type TYPE_DRAWN_APPLICATION am: fea963edee
am: 5e09ceb641

Change-Id: I955b985c47ca10a17dec6921af0277d1d6a7431d
2016-08-17 18:22:10 +00:00
John Reck
28f4ee5f7b Fix maps resume being blank am: 03df0834e6
am: 08669fff33

Change-Id: If87b076b6c03b7018485ddd4438aeaac7abd1562
2016-08-17 18:04:21 +00:00
Chong Zhang
5e09ceb641 Add new window type TYPE_DRAWN_APPLICATION
am: fea963edee

Change-Id: If7acf1349b87d4be88a9b4f9fbd984bbd4aca8ad
2016-08-17 17:16:18 +00:00
John Reck
08669fff33 Fix maps resume being blank
am: 03df0834e6

Change-Id: Iad93e1b11e74acf2356d59c271892d6741b53fef
2016-08-17 17:14:23 +00:00
Teng-Hui Zhu
f8da30dc65 Correctly report the transparent region
First, we fix the transparent region computation to use the order as the
drawing. Previously, it is using the tree traverse order, not the draw order.

Second, add the y offset for any view with positive z value, this will allow
some space for shadow.

b/30124573

Change-Id: I98d38261ffd346b762651e087cb243e45fed6952
2016-08-16 15:43:47 -07:00
Chong Zhang
f925b8df92 Merge "Add new window type TYPE_DRAWN_APPLICATION" into nyc-mr1-dev 2016-08-16 19:49:29 +00:00
John Reck
03df0834e6 Fix maps resume being blank
Bug: 30889568

Fixes an issue where mLayer didn't have
the mSurface set on it in certain resume
scenarios.

Change-Id: Ib75065d3d75e6141d6cd8f306584f6a569b9907c
2016-08-16 09:44:23 -07:00
Robert Carr
bdbc23bebe Introduce new constant for double tap gesture rotation hint. am: 57d9fbd17f
am: 5f684d92b6

Change-Id: Idf2bb8511e24732018ff59ffbf30f440cb7f9779
2016-08-16 01:44:07 +00:00
Robert Carr
5f684d92b6 Introduce new constant for double tap gesture rotation hint.
am: 57d9fbd17f

Change-Id: I994c15c692ec52160deb3d29b46396802562588a
2016-08-16 01:35:59 +00:00