Commit Graph

8265 Commits

Author SHA1 Message Date
John Reck
8bcd5bc5b0 Merge "Fix currentAnimationTimeMillis to use vsync time" into nyc-mr1-dev 2016-08-08 21:49:04 +00:00
Muyuan Li
36ca72c6c2 Prevents screenshot layer from dismissing IME.
Add code to adjustWindowLw to force the flag
FLAG_NOT_FOCUSABLE to be set for layer type
TYPE_SCREENSHOT.

Bug: 30485483
Change-Id: I11725eb89fda59b6d50fa1700845cdfe9ffb930b
2016-08-06 20:49:51 -07:00
Yohei Yukawa
dd228fbb4d Make sure IME focus is synced to View focus
This CL fixes an edge case that my previous CL [1] forgot to handle.

The goal of my previous CL was to avoid InputMethodManager from getting
confused by a false focus-in event from temporarily detached Views.
However, my CL forgot to take care of the case where the temporarily
detached View is still focused even after the temporary detach mode is
done.

The bad news is that such a situation is relatively easy to trigger by
having a ListView that has EditText as follows, which seems to be
known to be a common technique in Android developer community to put an
EditText in a ListView.
  ListView#listView.addHeaderView(new EditText(context), null, true);

If the ListView is initialized as above, and the EditText has input
focus, View focus and IME focus start to disagree immediatelly after the
ListView's layout is re-evaluated.  This is really easy to trigger, for
example just by dismissing the IME window.

In summary, the root cause is that InputMethodManager#focusIn(View) is
now always ignored as long as the View is temporarily detached, under an
assumption that IMM#focusIn(View) will be called back again with a View
that is not temporarily detached when everything is stable.  Hence the
fix is to do so by hooking up View#dispatchFinishTemporaryDetach() to
call IMM#focusIn(View) again when the View is actually focused in the
final state.

 [1]: Ia79bbd8468f768d546354382b47b39dd31ef7bb5
      a4ed0cfcb6

Bug: 30022872
Bug: 30578745
Bug: 30706985
Change-Id: Iecbdb00dcef8c72e4f7b31035c9bf0f4a40a578f
2016-08-05 15:38:55 -07:00
Adrian Roos
c49dfaf4d6 Merge changes from topic 'smooth_unlock' into nyc-mr1-dev
* changes:
  Keyguard: Improve trusted unlock while occluded
  Keyguard: Refactoring for improving trusted unlock while occluded
2016-08-05 18:37:29 +00:00
John Reck
a2acb4f077 Fix currentAnimationTimeMillis to use vsync time
Bug: 30674719
Change-Id: I71f51eea971e43cbe85bb0713a1c457a1b3243b3
2016-08-05 09:16:06 -07:00
Adrian Roos
d88eb2693b Keyguard: Refactoring for improving trusted unlock while occluded
- Adds a trusted signal from Keyguard to PhoneWindowManager
- Allows PhoneWindowManager to exempt DISMISS_KEYGUARD windows from force hiding
- Allows PhoneWindowManager to dismiss Keyguard while occluded

Bug: 27410215
Change-Id: I3ad490b64a5805b6f3888a9f37fcfbdd0116395e
2016-08-05 00:04:07 +00:00
John Reck
3c2587f26e Fix NPE in TextureView
Bug: 30651595
Change-Id: Ic6cc2a1598de173aaadb4061562236a563a662b3
2016-08-04 07:55:38 -07:00
Sergei Vasilinetc
ba3d4f6ea1 Merge "TextureView: destroy layer on destroyHardwareResources event" into nyc-mr1-dev 2016-08-03 21:54:10 +00:00
sergeyv
1c16c37d86 TextureView: destroy layer on destroyHardwareResources event
bug:30468770
Change-Id: I5174808e3fa6e4a87e3522246522c4e6d7ee2c3c
2016-08-02 15:40:27 -07:00
Yigit Boyar
828d4ff61d Merge "Target API check for margin params fix" into nyc-mr1-dev 2016-08-02 20:41:08 +00:00
Yigit Boyar
2dd20a61e9 Target API check for margin params fix
Prior to N, our widgets were not converting MarginLayoutParams
properly between ViewGroups. The fix intrudced some issues in
older apps as the broken conversion code would hide developer
errors. This CL guards the change with a target API check so
that we don't affect older apps.

Bug: 30378230
Change-Id: I215281d261b553c3b4cedcd29ea0a861df809471
2016-08-02 11:27:18 -07:00
TreeHugger Robot
0d8f164cde Merge "Fix FrameMetricsObserver crash" into nyc-mr1-dev 2016-08-02 18:06:08 +00:00
Phil Weaver
41e185e73b Merge "Reduce extra a11y events when alpha changes." into nyc-mr1-dev 2016-08-02 16:54:43 +00:00
John Reck
65ddb154c7 Fix FrameMetricsObserver crash
Bug: 30587465

Someday maybe the technology will exist to
allow sharing a simple constant between
Java and C++, but today is not that day.

Change-Id: I17694746cb8712058133cd5ea10c47b9909f740b
2016-08-02 09:38:26 -07:00
Svetoslav Ganov
a2f247e6a6 Merge "Revert "Prevent apps to overlay other apps via toast windows"" into nyc-mr1-dev 2016-08-02 01:56:10 +00:00
Svetoslav Ganov
2fc661a453 Revert "Prevent apps to overlay other apps via toast windows"
bug:30150688

This reverts commit dc24f937b0.

Change-Id: Id7e8ddbf82ab426f55a5296791f1e8ebb61514bc
2016-08-02 01:55:01 +00:00
Phil Weaver
9937f81ac6 Reduce extra a11y events when alpha changes.
Changes in alpha only matter if they affect visibility,
so only 0 <-> nonzero changes are worth reporting. Report
them as subtree changes, as visibility affects subviews.

Not reporting every change greatly reduces the number of
event reported when alpha is animated.

Bug: 30183085
Change-Id: I905d53aa81ca8248b3aed86a91842ef499f303a8
2016-08-01 17:41:19 -07:00
Svetoslav Ganov
fea7cfce8b Merge "Prevent apps to overlay other apps via toast windows" into nyc-mr1-dev 2016-08-01 18:48:11 +00:00
Svet Ganov
dc24f937b0 Prevent apps to overlay other apps via toast windows
It was possible for apps to put toast type windows
that overlay other apps which toast winodws aren't
removed after a timeout.

Now for apps targeting SDK greater than N MR1 to add a
toast window one needs to have a special token. The token
is added by the notificatoion manager service only for
the lifetime of the shown toast and is then removed
including all windows associated with this token. This
prevents apps to add arbitrary toast windows.

Since legacy apps may rely on the ability to directly
add toasts we mitigate by allowing these apps to still
add such windows for unlimited duration if this app is
the currently focused one, i.e. the user interacts with
it then it can overlay itself, otherwise we make sure
these toast windows are removed after a timeout like
a toast would be.

We don't allow more that one toast window per UID being
added at a time which prevents 1) legacy apps to put the
same toast after a timeout to go around our new policy
of hiding toasts after a while; 2) modern apps to reuse
the passed token to add more than one window; Note that
the notification manager shows toasts one at a time.

bug:30150688

Change-Id: Icc8f8dbd060762ae1a7b1720e96c5afdb8aff3fd
2016-08-01 11:46:02 -07:00
Agnieszka Madurska
9801935b95 Merge "Ignore padding for drawing round scrollbars." into nyc-mr1-dev 2016-07-27 21:36:55 +00:00
Aga Madurska
c283507246 Ignore padding for drawing round scrollbars.
This change is needed to correctly cope eg. with list views
which introduce header and footer view through additional
list view padding.

See ag/1221005 for details.

Bug:30420573
Change-Id: I7c9c0ce2b5ba85429b7921c42e4f97e139814e17
2016-07-27 22:22:11 +01:00
Adrian Roos
25582f21cd Merge "ViewRootImpl: Initialize sysui visibility" into nyc-mr1-dev 2016-07-27 18:39:17 +00:00
Michael Wright
1df0020f2d Merge "Actually compare supported color modes." into nyc-mr1-dev 2016-07-27 13:14:04 +00:00
Adrian Roos
1b2bf00098 ViewRootImpl: Initialize sysui visibility
Fixes a bug where the sysui visibility flags
were not dispatched when they changed if the
visibility changes the first time to a zero
value.

Change-Id: I4d6c990ca493b144f24c75e95b4ff18c4c0a029c
Fixes: 30259249
2016-07-26 14:27:37 -07:00
Michael Wright
16ae042351 Actually compare supported color modes.
Also, provide an equals implemenation for HdrCapabilities.

Bug: 30311415
Bug: 30367543
Change-Id: Ib8b9c9283519ae9baa48ecfecb8035848a9b29f0
2016-07-26 18:18:53 +01:00
Aga Madurska
8cc883de9e Use correct bounds for scroll bar rendering.
Bug:30001373
Change-Id: I20c77a2d97096bda451c3a871fd6be7ad699b047
2016-07-26 17:07:28 +01:00
TreeHugger Robot
eaa6d6b2c9 Merge "Avoid destroying TextureView surfaces for onStop" into nyc-mr1-dev 2016-07-26 00:06:45 +00:00
Chris Craik
391d560402 Avoid destroying TextureView surfaces for onStop
bug:30238922

TextureViews will hold onto their backing surfaces, which will allow
them to resume gracefully when the app's surfaces are saved.

Now only resources that are destroyed for onStop are DisplayLists.

Change-Id: Ia768ba9ffc4497c26aa3a5b101a0f5fa1a258b9c
2016-07-25 15:30:00 -07:00
Agnieszka Madurska
8ec317e220 Merge "Add support for round scroll bars to View.java" into nyc-mr1-dev 2016-07-25 16:31:36 +00:00
Aga Madurska
b19d0f9800 Add support for round scroll bars to View.java
Change-Id: If94a29d68cee504f7d31519b96f7b4b8a3af6bfa
2016-07-25 16:14:55 +01:00
Chong Zhang
e86da3bc62 Merge "Clean up surfaces when app is resumed without being stopped." into nyc-mr1-dev 2016-07-22 17:07:45 +00:00
TreeHugger Robot
5baca59226 Merge "Add View reveal on focus hint" into nyc-mr1-dev 2016-07-21 21:05:36 +00:00
Chong Zhang
45e6d2dc8b Clean up surfaces when app is resumed without being stopped.
When quickly toggling between two apps, app could be resumed while
it's stopping but not yet stopped. Upon resuming, it could have
surfaces that's marked mDestroying and waiting for the stopped
to be destroyed.

We need to dispose these surfaces properly. If the window is already
removed, we destroy them. Otherwise, clear mDestroying flag so that
the window is ready to be used again. Leaving mDestroying=true makes
the window ineligible for certain things such as receiving wallpaper.

bug: 30255354
Change-Id: Id881653550595ab8e702d6950949bf202ac5a0d9
2016-07-21 10:17:39 -07:00
Adam Powell
7ec3fb3947 Add View reveal on focus hint
Provide a way for views to signal that they would prefer not
to have their parents scroll or otherwise rearrange when they
request focus to try to show the full focused view to the user.
In some cases this can be disruptive to the UX.

As of now, framework views do not respect this hint and custom
views such as those found in currently deployed support libs
don't either. The policy is left open to ViewParent subclasses
that implement requestChildFocus.

Bug 30256922

Change-Id: I55194de888fe2b8129be9a9aa21aa5e18cbb8296
2016-07-20 17:42:10 -07:00
TreeHugger Robot
f8bc27d968 Merge "Rename color transform to color mode and persist the value." into nyc-mr1-dev 2016-07-20 17:21:35 +00:00
Phil Weaver
890202bde4 Suppress exceptions for corner-case a11y events.
Apps are told to query AccessibilityManager#isEnabled before
calling sendAccessibilityEvent. If accessibility is disabled
between the two calls, an app can crash. We can guarantee that
this won't happen on a process's main thread, but guaranteeing
it for all threads is messier. Rather than add the complexity
of tracking the state for all threads, only log an error in the
corner case that an accessibility event is requested on a
thread that doesn't have the process's main looper.

Bug: 28985452
Change-Id: I8369deefd83b0a6b04936ddfce55c53147756f1f
2016-07-19 16:44:28 -07:00
Michael Wright
1c9977b762 Rename color transform to color mode and persist the value.
Also, standardize on a set of possible modes for the displays to
enter and separate the configuration of the color mode from the
configuration of the display mode.

Bug: 29044347

Change-Id: I6af0a7d1f11bc72d4cefc380f115c1fb00788864
2016-07-18 19:49:18 +01:00
Vladislav Kaznacheev
7fe1f798bf Always return valid ClipDescription for ACTION_DRAG_EXITED
Bug: 30148704
Change-Id: I5f5cbb35a343e6ef61bed9ff92e3921a4ecce0c0
2016-07-14 17:15:02 -07:00
Chris Banes
6487312544 Merge "Read translation and elevation attributes as floats" into nyc-mr1-dev 2016-07-14 09:11:05 +00:00
Phil Weaver
0aaf427550 Behave if the same view gets a11y focus twice.
In some corner cases, ViewRootImpl#setAccessibilityFocus
can be called twice for the same view. Make sure we're
actually changing views before clearing accessibility focus
to avoid inconsistent state.

Bug: 29637593
Change-Id: I5dc6f05bdeaec55c352417bfca92c11bd03c3c10
(cherry picked from commit da4692774c)
2016-07-13 21:26:16 +00:00
Chong Zhang
185131442b Merge "Revert changes to force layout after insets changes" into nyc-mr1-dev 2016-07-13 19:39:08 +00:00
Chong Zhang
75eccbd0ff Revert changes to force layout after insets changes
Alternative fix for b/29391054 ag/1152795 sends an MOVE message to
client which also force a layout, so we no longer need to force
it after the insets change in the traversal.

Reverting the following two related fixes as it does more
measures than necessary.

bug: 29391054
bug: 29533997
bug: 29634368

Revert "Fix layout issue after insets changed"

This reverts commit 76fdbb72c9.

Revert "Do a forceLayout if pending insets is changed after relayout window"

This reverts commit 71f2c31469.
2016-07-13 19:24:04 +00:00
Chris Banes
b20891b08a Read translation and elevation attributes as floats
Since they're recorded as floats, we should keep the
precision from the attribute values.

BUG: 30109000
Change-Id: I07e6a3ff771198bcb24d32e3dd06a79f10e51a7e
2016-07-13 13:55:01 +00:00
Zak Cohen
b4d4ce31ab Merge "Adds a screenshot wallpaper method to WallpaperManagerService." into nyc-mr1-dev 2016-07-13 10:15:02 +00:00
Vladislav Kaznacheev
9ac6a460c8 Fix docs for View.DRAG_FLAG_GLOBAL
am: 9a44eaec53

Change-Id: I82786f107815361b73655b92dc4e54ee255296d9
2016-07-13 00:08:50 +00:00
Vladislav Kaznacheev
9a44eaec53 Fix docs for View.DRAG_FLAG_GLOBAL
Document that cross-app drags only involve apps compiled for API 24 or later.

Bug: 30076806
Change-Id: Ia630f4623c23d787b52692ff1f6475408cefa177
2016-07-12 15:24:48 -07:00
Zak Cohen
3683fb1e1d Adds a screenshot wallpaper method to WallpaperManagerService.
Bug: 29963541

Change-Id: If0a574004f8bddf1ba170587a8187253fe045ef4
2016-07-12 17:18:36 +00:00
Vladislav Kaznacheev
78004643e1 Merge \"Fix docs for DragEvent\" into nyc-dev
am: b6fa207c67

Change-Id: I7acfd89bb3cd51273007d8dc7b899ae6b95c7937
2016-07-11 23:26:31 +00:00
Vladislav Kaznacheev
3067bc69d9 Fix docs for DragEvent
Document that getClipDescription() and getLocaState() do not return valid data
when getAction() == DragEvent.ACTION_DRAG_ENDED.

Bug: 30016099
Change-Id: Id98fe8c5d6f052fc51c8c9e8d55329e162bd96b1
2016-07-11 13:52:22 -07:00
Tim Murray
33eb07f575 Add new mode for SCHED_FIFO on UI and RenderThreads.
Add a new mode, controlled by sys.use_fifo_ui property, that enables the
top app's UI and RenderThread to be SCHED_FIFO. This eliminates almost
all jank due to scheduling competition with non-UI critical
threads. This mode may not be suitable for all devices.

bug 24503801

Change-Id: I7b8a31830ad80f7efa00236928d5476998ed4e00
2016-07-07 12:55:31 -07:00