Commit Graph

7930 Commits

Author SHA1 Message Date
Chris Banes
6b69b12202 Merge "Re-dispatch nested scrolls if not implemented" into nyc-dev 2016-03-30 08:43:40 +00:00
Rob Carr
ffe3098169 Merge "Ensure we change SurfaceView size from UI thread." into nyc-dev 2016-03-29 23:50:47 +00:00
Jeff Sharkey
297017d154 AccessibilityNodeInfo shouldn't touch extras.
The extras may contain custom Parcelables which aren't in the
system's default classpath, so touching them would end up clobbering
the contents.

Update code to leave the parcelled data untouched inside the bundle
until someone tries reading the extras.

Bug: 27897919
Change-Id: I99381dd50c9a0e8887667076362ea98805f0437c
2016-03-29 16:38:55 -06:00
Robert Carr
0b10c335c7 Ensure we change SurfaceView size from UI thread.
We need to change the SurfaceView size from the UI thread
so that we can appropriately deliver the SurfaceChanged
callback. We also need to not preserve geometry
in this case, as if we don't update the surface
and layout size together we could get scaling. This still has
some potential for holes, as transactions are not synced with
the parent renderer, but we have other methods to avoid
these in the case of resizing. This fixes the remaining
issues with content sizing and surface view "out of sync".

Bug: 27780983
Bug: 27687126
Bug: 27676101

Change-Id: Idd7864f00e5cf7a4eb32dd66c0b389292a788069
2016-03-29 13:42:06 -07:00
George Mount
58cf2c3da0 Merge "Run cleanup before end actions of ViewPropertyAnimator." into nyc-dev 2016-03-29 19:54:36 +00:00
Jorim Jaggi
75c21ca948 Revert "Start drawing immediately"
This reverts commit 3127c2a471.

The original CL caused various issues for which we don't have the
time/not willing to take the risk.

Bug: 27864389
Bug: 27451341
2016-03-29 19:30:21 +00:00
Chet Haase
fd48a321c9 Merge "Add setHasOverlappingRendering() method" into nyc-dev 2016-03-29 19:19:14 +00:00
Chet Haase
15b6ba5859 Add setHasOverlappingRendering() method
View.hasOverlappingRendering() is an important performance tweak that
subclasses can override to do the right thing return false when appropriate
to avoid expensive operations when view is translucent).
But this requires subclassing View to get this behavior.

This new API allows the property to be set from outside, enabling
standard views to have this behavior set. When the new method is called,
the behavior will derive from whatever it was set to. Otherwise, it
will default to the old/overriden behavior.

Issue #16561361  Make hasOverlappingRendering settable from outside/XML

Change-Id: If0fbc8667cdb82b1d85e795e782716a07196f3c0
2016-03-29 11:01:27 -07:00
Alan Viverette
4d2a42336b Merge "Various fixes for MagnificationController" into nyc-dev 2016-03-29 15:13:04 +00:00
George Mount
e9a4f87852 Run cleanup before end actions of ViewPropertyAnimator.
Bug 27788719

The end action of a ViewPropertyAnimator may do anything,
including starting a new animator. If the next animator has
started prior to cleaning up the previous one, it will capture
the dirty state as the final state. This CL runs the cleanup
Runnables before running the end actions so that any captured
state is the clean state.

Change-Id: Ib005b817d420e79b636e61987669a852e15df9ce
2016-03-29 07:39:02 -07:00
Chris Banes
61d5070614 Re-dispatch nested scrolls if not implemented
Currently the default implementations just swallow
the calls. This CL fixes this by re-dispatching
them up the tree by default.

BUG: 27611756

Change-Id: Ib31938dca34cd956e78d746321716a51cbd9dcd6
2016-03-29 12:37:03 +01:00
Jorim Jaggi
15d4b5aae8 Merge "Fix nav bar consuming" into nyc-dev 2016-03-28 22:16:44 +00:00
Jorim Jaggi
2eb62737af Merge "Cleanup window callbacks locking" into nyc-dev 2016-03-28 22:16:18 +00:00
Jorim Jaggi
e5638a6f75 Fix nav bar consuming
- Cache shouldAlwaysConsumeNavbar so it doesn't get reset when
insets == null
- Remove logic with frame comparison when determining whether to
consume nav bar. Not sure how that ever worked.
- Make sure shouldAlwaysConsumeNavBar survives when consuming
insets.

Bug: 27157904
Change-Id: I35f209ab27cc12240038da7efa9e79c95f70c6ce
2016-03-28 21:58:30 +00:00
Sergei Vasilinetc
4edfdd55cf Merge "Fix NPE while using mLayerPaint" into nyc-dev 2016-03-28 21:21:45 +00:00
Jorim Jaggi
16b631923d Cleanup window callbacks locking
- Also get rid of USE_MT_RENDERER, because there is no point in
having a flag if the other path never gets tested.

Bug: 27738239
Change-Id: Ic76115962940e72f2c59b8d291d078d15f8d493c
2016-03-28 21:19:17 +00:00
sergeyv
e66be622f6 Fix NPE while using mLayerPaint
bug:27873847
Change-Id: I9bfae72dfa9bda45fdeb94544b7656e2584f29f6
2016-03-28 13:23:28 -07:00
Yohei Yukawa
feade80609 Merge "Dump more info for View when IMM#DEBUG is true." into nyc-dev 2016-03-28 18:20:56 +00:00
Alan Viverette
59e53a164e Various fixes for MagnificationController
- Ensure initial magnified and available regions are set
- Correctly offset magnified bounds by left coordinate
- Cancel ongoing animations before unregistering callbacks

Bug: 22718911
Bug: 27871383
Change-Id: Iaff63be856598d1f8edb2d94158bbd75045c86ec
2016-03-28 13:41:32 -04:00
Yohei Yukawa
5c1e6751a5 Dump more info for View when IMM#DEBUG is true.
This is a preparation CL to fix Bug 27858665.  In order to debug issues
like this, we want to record following information about View.
 - Whether the View is focused or not.
 - Whether the Window to which the View belongs is focused or not.
 - Whether the View belongs to a Window or not.

This CL has no impact on production build where IMM#DEBUG is false.

Bug: 18920212
Change-Id: I06bcd5e42d55f96a9e916eb34ed7785cfe14c96f
2016-03-28 01:52:47 -07:00
Yohei Yukawa
241eac21a0 Clean-up a workaround that is no longer necessary.
With the previous commit [1], now Bug 27868748 is fixed and Bug 6789252
is no longer reproducible even without a workaround [2] for that.  Hence
this CL logically reverts [2] in favor of simplicity.

  [1]: If2a03bc84d318775fd4a197fa43acde086eda442
       aaa38c9f1a
  [2]: I66f51da1299532793ef8fa700f35b0811670f235
       4e5184f929

Bug: 27868748
Change-Id: Ic59af43343eb44d1d2c23a3f4018565e7a75b143
2016-03-28 00:28:50 -07:00
Yohei Yukawa
aaa38c9f1a Ensure IC#finishComposingText() is called on the correct Handler.
This attempts to reland previously reverted CLs [1][2] due to an
unexpected regression (Bug 27824691).

The Bug 27868748 we want to address by this CL is that currently
InputConnection#finishComposingText() can be called on the root view's
Handler no matter what Handler is associated with
ControlledInputConnectionWrapper.  Actually the root cause of
Bug 6789252 is the same, but there we worked around it by not calling
InputConnection#finishComposingText() in certain situations [3].
With this CL we should be able to logically revert that workaround.

This CL also removes redundant IMM#mServedInputConnection.  This is safe
because the following two fields have the same lifetime.
 - InputMethodManager#mServedInputConnection
 - InputMethodManager#mServedInputConnectionWrapper
We do not need to maintain both of them.  This also allows us to use a
strong refecente in IInputConnectionWrapper#mInputConnection instead of
a WeakReference.  To understand why this is safe, we need to understand
how things previously worked, which is as follows:

  1. InputMethodManager#mServedInputConnection becomes non-null.
    -> IInputConnectionWrapper#mInputConnection.get() is guaranteed to
       be alive.
  2. InputMethodManager#mServedInputConnection becomes null or another
     object.
    -> IInputConnectionWrapper#mInputConnection.get() may not be alive.

Since we know exactly when InputMethodManager#mServedInputConnection is
updated, in theory we do not need to use WeakReference here, and
with this CL we do not use WeakReference anymore.  Actually the initial
commit [1] accidentally removed the last strong reference to the active
InputConnection and WeakReference could be null at any time, which was
what we observed in Bug 27824691.

  [1]: I1181e067aa5bedbdf0c7ec1bcec479257aea511c
       afb6558c8f
  [2]: Ibe94f115e607a198d12ecd3d4e4f91a7d9469c98
       16e2c7b59a
  [3]: I66f51da1299532793ef8fa700f35b0811670f235
       4e5184f929

Bug: 27868748
Change-Id: If2a03bc84d318775fd4a197fa43acde086eda442
2016-03-27 23:46:04 -07:00
Jorim Jaggi
c39c7b0ce2 Add shadow during resizing in docked mode
Bug: 27738239
Change-Id: I48c45bd97c2aa7f3d7bbb5b1ba650fbe408bd0bf
2016-03-25 14:04:25 -07:00
Muyuan Li
3eca3cd334 Merge "Refactor enableAccessibility to AccessibilityManagerService" into nyc-dev 2016-03-25 18:03:36 +00:00
sergeyv
342a7e6a7c Clean up setLayerType and setLayerPaint
bug:21755299
Change-Id: I8f0953ccfc3d743abdecc8ec228ed3e1b6718c3c
2016-03-24 16:06:46 -07:00
Yohei Yukawa
cdf90bb674 Merge changes I16312592,Iadfc226e into nyc-dev
* changes:
  Revert "Remove redundant IMM#mServedInputConnection."
  Revert "Make sure to call back reportFinish() on the desired Handler."
2016-03-24 17:54:21 +00:00
Yohei Yukawa
223db8b6f5 Revert "Remove redundant IMM#mServedInputConnection."
This reverts commit afb6558c8f.

It turns out that this CL caused a serious regression Bug 27824691.

Bug: 25332806
Bug: 27824691
Change-Id: I16312592743a6673449c492ee5ba533256d343ea
2016-03-24 10:26:19 -07:00
Yohei Yukawa
1fa5f594a2 Revert "Make sure to call back reportFinish() on the desired Handler."
This reverts commit 16e2c7b59a.

It turns out that I1181e067aa5bedbdf0c7ec1bcec479257aea511c caused
a serious regression Bug 27824691.  To revert that CL, we have to revert
this one first.

Bug: 25332806
Bug: 27824691
Change-Id: Iadfc226eb91cc969b77c9d98e04ec3c76fe86ead
2016-03-24 10:24:23 -07:00
Clara Bayarri
3e5bf786b7 Merge "Keyboard Shortcuts: plumb deviceId through" into nyc-dev 2016-03-24 13:30:48 +00:00
Clara Bayarri
bfd996f5cd Merge "Keyboard Shortcuts: Add Keycodes for shortcut representation" into nyc-dev 2016-03-24 11:49:05 +00:00
Clara Bayarri
fcd7e80b21 Keyboard Shortcuts: plumb deviceId through
Bug: 27673736
Change-Id: Ie72807aa8c2bfd142b081a6a915e101c16d31473
2016-03-24 11:47:32 +00:00
Clara Bayarri
4e850ffaa7 Keyboard Shortcuts: Add Keycodes for shortcut representation
This changes the current API given app feedback received. In order to use
keycodes as well as chars we also must implement a mapping of Keycodes to
Display labels as only keys with a single char representation are provided
by KeyCharacterMap.

Bug: 27409783
Change-Id: I3da653adc4b8cbc66a4d1aa24a5f9181f71e83c3
2016-03-24 11:47:23 +00:00
Yohei Yukawa
2c8d528188 Merge "Make sure to call back reportFinish() on the desired Handler." into nyc-dev 2016-03-23 21:48:51 +00:00
Pablo Ceballos
6266d8c959 Merge "Java bindings for SurfaceControl::setFinalCrop" into nyc-dev 2016-03-23 16:30:54 +00:00
Yohei Yukawa
c1a72b6b74 Merge "Remove redundant IMM#mServedInputConnection." into nyc-dev 2016-03-23 05:41:08 +00:00
Yohei Yukawa
16e2c7b59a Make sure to call back reportFinish() on the desired Handler.
Before exposing #reportFinish() as a public API, we have to fix an
existing bug that my previous CL [1] for Bug 26945674 forgot to take care.

Currently BaseInputConnection#reportFinish() is always called by using
the root view's Handler.  We should move the logic to call
BaseInputConnection#reportFinishInputConnection() from ViewRootImpl to
IInputConnectionWrapper to make sure that the method in question can
always be called on the desired Handler.

To make things simple, instead of explicitly calling #reportFinish()
from IMM, this CL let ControlledInputConnectionWrapper#diactivate()
internally call #reportFinish() as needed.  This makes it easier to make
sure that #reportFinish() is called after all the queued method calls
are handled.

  [1]: Id9e579bb3e2966986cdcb1c34bc8cacfeca2e1a9
       612cce92ad

Bug: 25332806
Change-Id: Ibe94f115e607a198d12ecd3d4e4f91a7d9469c98
2016-03-22 21:27:48 -07:00
Yohei Yukawa
afb6558c8f Remove redundant IMM#mServedInputConnection.
Following two fields have basically the same lifetime.
 - InputMethodManager#mServedInputConnection
 - InputMethodManager#mServedInputConnectionWrapper
Hence we do not need to maintain both of them.

This is a preparation CL for Bug 25332806 and does not change any
user-visible behavior.

Bug: 25332806
Change-Id: I1181e067aa5bedbdf0c7ec1bcec479257aea511c
2016-03-22 20:53:08 -07:00
Adam Powell
005b272529 Merge "Only call Drawable.setVisible(false) for visible outgoing drawables" into nyc-dev 2016-03-22 18:16:34 +00:00
Adam Powell
35e2ea0203 Only call Drawable.setVisible(false) for visible outgoing drawables
In framework views where we're handling the new visibility aggregated
call we only update the drawable visibility when we're attached to a
window. For old outgoing drawables being replaced, gate this on
whether the drawable is already marked visible instead.

This catches a case where views being inflated might set drawables in
in a superclass constructor and have them replaced in a later
constructor. Gating the call into a drawable that might invoke its
callback (the view being constructed) avoids potential problems where
overridden methods are called unexpectedly on a view subclass that has
not finished running its constructor.

This is a better check than isAttachedToWindow, as isAttachedToWindow
will return false if the view has been temporarily detached from its
parent by a view-recycling container. In those cases, the view would
not correctly update the outgoing drawable.

Bug 27461617

Change-Id: I733a2dd3e3df0a8d80d5dc542ca7b30064159d5d
2016-03-22 11:14:16 -07:00
Chong Zhang
6136273888 Don't change geometry in relayout if preserve geometry is requested
This causes scaling to be applied in the relayout window since the
requested size won't match the window size. Apply the requested size
in repositionChild instead.

bug: 27676101
Change-Id: I03beee2b9fe118a6be329b5fd1338d54e48d9a22
2016-03-22 10:28:27 -07:00
Muyuan Li
16b8251c89 Refactor enableAccessibility to AccessibilityManagerService
enableAccessibility is refactored from EnableAccessibilityController to
AccessibilityManagerService. Also added are 2 methods disableAccessibility,
and isAccessibilityEnabled.

Bug: 27645255
Change-Id: I32d75ed6617b8bcf82bbee0dd5ee776f430fb386
(cherry picked from commit 84da556422d50e43eb674061cc454f331104d493)
2016-03-22 02:43:28 +00:00
Yohei Yukawa
b8a95d2c9a Merge "Add a comment about ResultReceiver lifetime." into nyc-dev 2016-03-21 22:45:21 +00:00
Alan Viverette
43a21c0500 Set drawable callbacks last
Bug: 27554777
Change-Id: I3ef9981bfafcb2a674304c9da10e4f5b1e66f932
2016-03-21 13:35:39 -04:00
Yohei Yukawa
d552a52305 Add a comment about ResultReceiver lifetime.
The root cause of memory leak crbug.com/595613 was that Chromium and
WebView have called InputMethodManager#showSoftInput() with
ResultReceiver thta has a strong reference to application logic class
named ContentViewCore.  In this particular case, ResultReceiver in
question will be copied to InputMethodManagerService and the current
InputMethodService, which means the original receiver object will not be
collected until the copied objects in other processes are GCed.

Probably there might be several ways to oprimize the performance in
Framework side because the corresponding ResultReceiver objects will be
always handled within the Android Framework unless IME developers
explicitly override the following method.
  InputMethodService#onCreateInputMethodInterface()

Anyway, it is probably a bit too late to do such an optimization in N,
and application developers need to support existing versions of Android
anyway.  For N, probably making it clear in JavaDoc would be the only
realistic improvement we can do.

Bug: 27658034
Bug: 27727645
Change-Id: I6fc6b88c91a4b1e0a29e94b99a9f0e35605c01b2
2016-03-20 15:08:31 -07:00
Yohei Yukawa
1064d35307 Merge "Tell IMS about missing InputConnection methods." into nyc-dev 2016-03-19 00:36:22 +00:00
Chris Craik
7fb0d09455 Merge "Rebuild outline when setBackground is called." into nyc-dev 2016-03-18 22:29:20 +00:00
Chris Craik
96bacd186e Rebuild outline when setBackground is called.
bug:27505848

Also correctly register damage from profiling bars.

Change-Id: I9550c2742eb833350a077ca48eccf9b584083a1e
2016-03-18 15:28:23 -07:00
Adam Powell
c5874094eb Dispatch aggregated visibility when performing attachViewToParent
attachViewToParent is generally used for finishing a temporary detach
of a view as seen in ListView, etc. Have it dispatch aggregated
visibility to the newly added view so as to correctly update the view
as to its new state.

Bug 27702014

Change-Id: Ie8a67c78d3edf401641d52ce10bddf7cb49796fe
2016-03-17 16:27:24 -07:00
Yohei Yukawa
fb8aa06883 Merge changes I068f8821,Ibcf12746,I169ad495 into nyc-dev
* changes:
  Add more @NonNull/@Nullable to TextServicesSettings.
  Remove an unnecessary int to String conversion.
  Add more @NonNull/@Nullable to InputMethodSettings.
2016-03-17 02:03:00 +00:00
Sunny Goyal
60dbc35784 Merge "Adding a default implementation for the new Window.Callback method" into nyc-dev 2016-03-17 01:50:09 +00:00