Commit Graph

8368 Commits

Author SHA1 Message Date
Eino-Ville Talvala
ca7f4217b8 Docs: Note that a Surface acts like a weak reference
am: c4faf0cb13

Change-Id: I8466ddcfc3fc99d62dfc842ef84cb0c0663db5e1
2016-09-17 00:35:31 +00:00
Eino-Ville Talvala
c4faf0cb13 Docs: Note that a Surface acts like a weak reference
This causes frequent programming errors, when developers assume
that holding onto a Surface will keep its associated SurfaceTexture,
ImageReader, etc, also alive.

Bug: 31551063
Test: m offline-sdk-docs, manual viewing of result
Change-Id: I5fb5bb3e3c80c7d5d735417b1697e0fe9a62fc46
2016-09-16 22:58:11 +00:00
Gopal Krishna Shukla
22b21403db Remove synchronization from getCurrentInputMethodSubtype()
am: d33c07550f

Change-Id: I83b3e185e66c383c714c66850d8fee34e13cd74a
2016-09-16 17:38:52 +00:00
Gopal Krishna Shukla
d33c07550f Remove synchronization from getCurrentInputMethodSubtype()
getCurrentInputMethodSubtype() acquires InputManagerService.mMethodMap
within its body. There seems to be no reason for holding
InputMethodManager.mH to call getCurrentInputMethodSubtype(). Holding mH
can cause potential deadlock b/w two threads acquiring mH and mMethodMap
in different orders.

Bug: 31247871
Bug: 31273203
Bug: b.android.com/218423
Change-Id: I20cf2c20f49b1b02c0f7a18257b49d4bcc081b5d
2016-09-15 23:20:05 -07:00
Vladislav Kaznacheev
8778333a04 Update JavaDoc for DragEvent.getLocalState am: 048f3bfaf0 am: fa05df640f
am: c9bab3001f

Change-Id: I81da9817c076b587372888b17bbda71118fb6138
2016-09-09 18:53:17 +00:00
Vladislav Kaznacheev
c9bab3001f Update JavaDoc for DragEvent.getLocalState am: 048f3bfaf0
am: fa05df640f

Change-Id: I535a5218bec2f5cf0ea9fa83aaa92ab70f05fcdd
2016-09-09 18:47:41 +00:00
Vladislav Kaznacheev
fa05df640f Update JavaDoc for DragEvent.getLocalState
am: 048f3bfaf0

Change-Id: I72bec54ac999ebce5779062ddc5effd1bb4d61ce
2016-09-09 18:42:34 +00:00
Vladislav Kaznacheev
048f3bfaf0 Update JavaDoc for DragEvent.getLocalState
Explicitly state that "local state" is local to the window
which has started the drag operation.

Bug: 31372686
Change-Id: Idbea7586c4e74097362067fa90390b97744181bb
2016-09-08 16:37:23 -07:00
Alan Viverette
55768028fd Change density for the correct user
am: df3a7cab8f

Change-Id: I4f4dfaa8f9035cdd4939d1d40e66ebac51811f73
2016-09-08 21:13:39 +00:00
TreeHugger Robot
c779cdc560 Merge "Change density for the correct user" into nyc-mr1-dev 2016-09-08 21:07:01 +00:00
Mark Lu
303fc8f54d docs: fix grammar mistake in TextureView am: e8691d19cb am: c657eed270
am: c76ea3d727

Change-Id: I81b1b747ad06a78ca6a56fc1d281adf45aa0921b
2016-09-07 23:42:13 +00:00
Mark Lu
c76ea3d727 docs: fix grammar mistake in TextureView am: e8691d19cb
am: c657eed270

Change-Id: Ie27e53ef83f31dc528df7db8973e6484d1b53230
2016-09-07 23:35:43 +00:00
Mark Lu
c657eed270 docs: fix grammar mistake in TextureView
am: e8691d19cb

Change-Id: I857deef5cf08c9cdaf0d6e8e99449e688bec5ba5
2016-09-07 23:29:20 +00:00
Robert Carr
d0c9771e49 SurfaceView: Correct coordinate space in windowPositionLostRT.
am: 3387913237

Change-Id: I7f28aab013bd6fe213a90e293664cc59ee6d23cf
2016-09-07 19:25:20 +00:00
Robert Carr
3387913237 SurfaceView: Correct coordinate space in windowPositionLostRT.
mWinFrame as set when returning from relayout will be in screen
space coordinates. repositionChild however expects coordinates relative to the
parent position (like relayout).

Bug: 31112993
Change-Id: Id4fcd7fcb771908e8a7db981207d19c99fb51b98
2016-09-07 11:07:18 -07:00
Alan Viverette
df3a7cab8f Change density for the correct user
Bug: 30839993
Change-Id: I5368accddfc4a03b8025a257b4155fcdc6197f11
2016-09-06 17:13:41 -04:00
Phil Weaver
de13bcf08b Stop double notifying a11y about Toasts.
am: 532c7999c5

Change-Id: If8d025884b8a941386cd472403c1c93fee5a70af
2016-09-06 16:40:15 +00:00
Phil Weaver
85d18cce6d Merge "Stop double notifying a11y about Toasts." into nyc-mr1-dev 2016-09-06 16:33:42 +00:00
Svetoslav Ganov
dea62c6f58 Prevent apps to overlay other apps via toast windows
am: aa07653d2e

Change-Id: I309615a989eade43401b086da42ff6522d000b68
2016-09-02 23:36:59 +00:00
Svetoslav Ganov
aa07653d2e 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: Ia1dae626bd9e22541be46edb072aa288eb1ae414
2016-09-02 14:00:07 -07:00
Yohei Yukawa
1a000651d5 Fix typos in JavaDoc for InputConnection
am: 1ab959a6e0

Change-Id: I8e945ed58761262ebe3b7521de1c4b701ab6e195
2016-09-02 00:21:37 +00:00
Yohei Yukawa
1ab959a6e0 Fix typos in JavaDoc for InputConnection
This CL fixes typos in JavaDoc for InputConnection.

This CL slso updates the content regarding a new API that was added in
API 25 [1][2].

 [1]: Iaadf934a997ffcd6000a516cc3c1873db56e60ad
      152944f490
 [2]: Ica1ba3154795c1bf44e140dfe639b299f83cd8af
      adebb52588

Bug: 31249896
Change-Id: Icafedb15943a84f8e5b03ef9eb3a50627d508bdd
2016-09-01 15:42:29 -07:00
Mark Lu
e8691d19cb docs: fix grammar mistake in TextureView
Bug: 6441115
2016-08-30 17:38:42 -07:00
sergeyv
ac2ca87e92 TextureView: clean up displaylists
am: 17dd01b693

Change-Id: Ib32a64f032b9f7230414f038417b2151f1e6e4be
2016-08-31 00:32:17 +00:00
TreeHugger Robot
c0e2e0ad62 Merge "TextureView: clean up displaylists" into nyc-mr1-dev 2016-08-31 00:26:46 +00:00
Phil Weaver
532c7999c5 Stop double notifying a11y about Toasts.
TalkBack was speaking all Toasts twice because we were
sending both NOTIFICATION and a WINDOW_STATE_CHANGE events
when Toasts were displayed.

Stop sending the WINDOW_STATE_CHANGE event for toasts.
Bug: 30570188
Change-Id: I26c6dc50350dfd4daf2a706b94fadcf5d1e03557
2016-08-30 15:41:59 -07:00
sergeyv
17dd01b693 TextureView: clean up displaylists
bug:31066756
Change-Id: Ibc61825ad1ed12479e9de18cc06be7401d3fc93a
2016-08-30 14:03:32 -07:00
Eino-Ville Talvala
286b1a83e4 android.view.Surface: Add parceling warning
am: f005f5ed88

Change-Id: Id2c772873fbf98653e751036790484d0fbf7bb16
2016-08-30 17:50:12 +00:00
Eino-Ville Talvala
0656931d18 Merge "android.view.Surface: Add parceling warning" into nyc-mr1-dev 2016-08-30 17:44:11 +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
John Reck
8eaa65b867 Merge "Cherry pick TextureView fixes" into nyc-dev 2016-08-29 23:33:57 +00:00
Chris Craik
2e8a8a2432 Cherry pick TextureView fixes
The following changes are in this commit:

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.

(cherry picked from commit 391d560402)

TextureView: destroy layer on destroyHardwareResources event

bug:30468770

(cherry picked from commit 1c16c37d86)

Fix NPE in TextureView

Bug: 30651595

(cherry picked from commit 3c2587f26e)

Fix NPE in TextureView

Bug: 30779663

(cherry picked from commit 7e237189c2)

Fix maps resume being blank

Bug: 30889568

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

(cherry picked from commit 03df0834e6)
2016-08-29 14:22:13 -07: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
Yohei Yukawa
8eb07090a4 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
(cherry picked from commit dd228fbb4d)
2016-08-29 18:24:31 +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
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
Daniel Chapin
7c02d7adaa Merge "Fixes for ImageView drawable visibility dispatch" into nyc-dr1-dev 2016-08-27 01:14:34 +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
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
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