Commit Graph

8309 Commits

Author SHA1 Message Date
Gopal Krishna Shukla
f7abcda5f2 Provide synchronization to setview to avoid NPE
If setView() will be called from two different threads
then mView property of a View object may have inconsistent
value. For instance, setView() may set mView to null causing
NullPointerException. Synchronize root.setView() as well to
avoid this.

Change-Id: I5f9cf47ece5d4aca575bd8644ecfcee0ed43d843
2016-09-22 04:48:24 +00:00
Gopal Krishna Shukla
fa1886feea 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-16 03:41:46 +00:00
John Reck
8a953d02d9 Merge \"Add missing null checks\" into nyc-dev
am: 02e391585d

Change-Id: Ib081c05d197b01ec3a9039941dd1265bf0b9b92c
2016-06-27 17:06:22 +00:00
John Reck
474659ccc4 Add missing null checks
Bug: 29743482
Change-Id: Ic4bc5b9d5718eabd41e09a108a765b01aef4e3c8
2016-06-27 07:56:37 -07:00
Adam Lesinski
c038c55f62 Merge \"Update DisplayMetrics when resizing\" into nyc-dev
am: 34ccbe035a

Change-Id: I1b0b6711a3ad8c9fd29bbb967d59d59326fa7d25
2016-06-24 23:42:34 +00:00
TreeHugger Robot
34ccbe035a Merge "Update DisplayMetrics when resizing" into nyc-dev 2016-06-24 23:35:13 +00:00
Adam Powell
242a44395e Merge \"Fix layout issue after insets changed\" into nyc-dev
am: 119f1715b3

Change-Id: I3dc13e068c258a74acee79e6ab6a75b569c891e8
2016-06-24 23:28:37 +00:00
TreeHugger Robot
119f1715b3 Merge "Fix layout issue after insets changed" into nyc-dev 2016-06-24 23:21:29 +00:00
Yorke Lee
c9bbca5682 Merge \"Update documentation for View.startDragAndDrop\" into nyc-dev
am: c63710ea48

Change-Id: I47ee9fa89edc5495616393a1c352677c8b990030
2016-06-24 22:18:22 +00:00
Adam Lesinski
ac3e0e590a Update DisplayMetrics when resizing
Previously the DisplayMetrics passed to a new ResourcesImpl
object would be generated from the default DisplayAdjustments.
We now use the correct DisplayAdjustments for the ResourcesImpl
and make sure to update them for things like rotation changes.

Bug:29619314
Change-Id: If2ba0d7670a4554dcd3fde9766e2337f20a191fd
(cherry picked from commit 8e8d23214a)
2016-06-24 22:11:27 +00:00
Yorke Lee
c63710ea48 Merge "Update documentation for View.startDragAndDrop" into nyc-dev 2016-06-24 22:10:47 +00:00
Adam Powell
76fdbb72c9 Fix layout issue after insets changed
Fix a regression where a change in insets would forceLayout on the
view hierarchy but not run the measure/layout as a result. This would
cause layout requests to become stalled until a window-level relayout
event.

Bug 29634368

Change-Id: Ia3f32f5891c8b32c06c13f95ebd0572233572b04
2016-06-24 14:47:06 -07:00
Yorke Lee
d092e3a414 Update documentation for View.startDragAndDrop
Bug: 29606395
Change-Id: Ibbe1a20c998986c7afffac6f5f4b25769f56a8f2
2016-06-23 12:23:22 -07:00
John Reck
c86a2e325e Merge \"Remove FD from the right Looper\" into nyc-dev
am: db13dd41a9

Change-Id: I451ef3649426d9b8ea1bf15e388d0efa82dae442
2016-06-23 18:39:44 +00:00
John Reck
ac04f4e69a Remove FD from the right Looper
Bug: 29586513

Also gives BackdropFrameRenderer a direct-destroy
of Choreographer since it's hammering on new Threads
and we don't want to wait for the GC to release
FDs.

Change-Id: Id2ec0af2ee4d5304961c4ab87a104ccb92f35fc2
2016-06-23 11:00:00 -07:00
John Reck
fdff97caf0 Merge \"Change approach for windowPositionLostRT\" into nyc-dev
am: 16038a0c5f

Change-Id: I80f6bf6d169c43a10106857627f5c127d94d00a4
2016-06-22 23:45:50 +00:00
John Reck
16038a0c5f Merge "Change approach for windowPositionLostRT" into nyc-dev 2016-06-22 23:38:24 +00:00
John Reck
f23a1b8e4c Change approach for windowPositionLostRT
Bug: 29547000

Instead of shifting the window off screen fall
back to the UI-thread calculated values. This fixes
a race issue around tear-down where we stop
drawing long before our window is actually no longer
visible, as well as fixes a funky issue with
PRESERVE_GEOMETRY during first draw.

Change-Id: I792d1966f5aaee1e703295ae79166c723b97a1dc
2016-06-22 16:10:07 -07:00
Adam Lesinski
a72a6aae37 Merge \"ContextImpl: Keep DisplayAdjustments and Display in sync\" into nyc-dev
am: 0bf31c3fa6

Change-Id: If0da3136f1fcb17c43a5b8c22ca890b8abcfc25c
2016-06-22 19:17:43 +00:00
Adam Lesinski
0bf31c3fa6 Merge "ContextImpl: Keep DisplayAdjustments and Display in sync" into nyc-dev 2016-06-22 19:11:36 +00:00
Adam Lesinski
4ece3d6bb1 ContextImpl: Keep DisplayAdjustments and Display in sync
Make sure that when our Resources get updated, that DisplayAdjustment
and Display properly reflect the potentially new screen dimensions.

Bug:28388969
Change-Id: I340550ea094ece87abc8790dd46aaa60ab3cedd3
2016-06-21 17:55:58 -07:00
Yorke Lee
072ce0c29c Merge \"Tweaks to DragAndDropPermissions behavior\" into nyc-dev
am: 22faa5ddb1

Change-Id: Icbe2a2b78d19dbdf067aa69a2e0c539a809893aa
2016-06-21 21:20:11 +00:00
Yorke Lee
c8ad0cd316 Tweaks to DragAndDropPermissions behavior
No longer release permissions in finalize(), so that
apps do not have to maintain a reference to the
DragAndDropPermissions object.

Also make it parcelable, so that permission instances can be
retained across activity instances so that they can be
manually released.

Bug: 29162822

Change-Id: Ie604dd3e83ee45a8665d743449b91857dd54e896
2016-06-21 12:57:52 -07:00
John Reck
f5159155d0 Merge \"DO NOT MERGE Move SurfaceView offscreen if the app stops drawing it\" into nyc-dev
am: d11b5e6661

Change-Id: I1caf2fbac785c68c6afeb61b60493e728a83a670
2016-06-18 02:14:29 +00:00
John Reck
34bf49e4de DO NOT MERGE Move SurfaceView offscreen if the app stops drawing it
Bug: 29360411
Change-Id: Iefb9d7a9dafb34a2b4f79130a2a8b5a7cf7de906
(cherry picked from commit aa6e84f21d)
2016-06-17 20:26:10 +00:00
Chong Zhang
dba235d91a Merge \"Do a forceLayout if pending insets is changed after relayout window\" into nyc-dev
am: 2756d0707f

Change-Id: Ia95dd424c118b962a9a10ac074d508758b49ea90
2016-06-17 18:26:45 +00:00
Chong Zhang
71f2c31469 Do a forceLayout if pending insets is changed after relayout window
We might have a pending MSG_RESIZED_REPORT, but if it's executed after
relayoutWindow, mPendingInsets will already be the new value and it'll
not forceLayout. So we need to forceLayout here to make sure the measure
cache is cleared.

bug: 29391054

Change-Id: I73793b1427b89e75700369ec3b37053a6a732f0d
2016-06-17 01:11:49 +00:00
Yorke Lee
3d80871032 Merge \"Limit global drags to apps targeting SDK 24 and above\" into nyc-dev
am: f33af2285b

Change-Id: I539f39cfea50f34dade2141829b21d422809b09f
2016-06-16 21:22:22 +00:00
Yorke Lee
0e85247195 Limit global drags to apps targeting SDK 24 and above
Bug: 29127791

Change-Id: Ib5f85a207bdb79eeac0418fda78e452d225761bc
2016-06-16 09:35:40 -07:00
Selim Cinek
0630d92064 Merge \"Added dismiss, expand, and collapse accessibility actions\" into nyc-dev
am: c1720dce1b

Change-Id: I25bd41f1307233bba14067952086ca7be3118505
2016-06-16 04:25:26 +00:00
Selim Cinek
e9bad242f3 Added dismiss, expand, and collapse accessibility actions
Fixes: 20343017
Fixes: 29368014
Change-Id: Ib571242aac04c67aea2f3c3ce76139eaedc1f3f1
2016-06-15 16:30:09 -07:00
Yorke Lee
71ab239765 Merge \"Check for detached view in drag-related APIs\" into nyc-dev
am: cdc9d7bed9

Change-Id: I95d551726913c95d2806fe22ee93fcc24d1862c2
2016-06-13 22:14:24 +00:00
TreeHugger Robot
cdc9d7bed9 Merge "Check for detached view in drag-related APIs" into nyc-dev 2016-06-13 20:09:43 +00:00
Yorke Lee
07452c37ab Check for detached view in drag-related APIs
Bug: 29253539
Change-Id: I26285404ee15bb17e87ac23c67f7c3c6aaa2d968
2016-06-13 11:32:23 -07:00
John Reck
93ff5124c6 Merge \"Don\'t call surfaceCreated for just changed surfaces\" into nyc-dev
am: e4b1fb94e3

Change-Id: I896ffb151a1b6625fe6b6c937dac9b54f1d5d252
2016-06-10 18:02:20 +00:00
John Reck
e4b1fb94e3 Merge "Don't call surfaceCreated for just changed surfaces" into nyc-dev 2016-06-10 17:46:54 +00:00
Phil Weaver
e2b3248823 Merge \"Improve accessibility window title behavior\" into nyc-dev
am: f8af34365c

Change-Id: Id9d2de6b82f8e8062c0d66d759440b574b113a02
2016-06-09 23:42:47 +00:00
Phil Weaver
f8af34365c Merge "Improve accessibility window title behavior" into nyc-dev 2016-06-09 23:32:10 +00:00
John Reck
208c47cfb0 Don't call surfaceCreated for just changed surfaces
Fixes: 29223302

If the surface only changed we want to just call onSurfaceChanged,
not onSurfaceCreated.

Change-Id: I65c8b210a7e34eaa2862020335ee7f6ef56eeac2
2016-06-09 16:26:21 -07:00
Phil Weaver
155edc693e Improve accessibility window title behavior
Un-reverts ag/1057448, but uses a version of Resources#getText
that returns null rather than throw an exception when no title
is available. This is the same call made before, so this change
should be safer.

Bug: 28744278
Change-Id: I8c123f4f6d74f796ab9e8ffcf955aaf881770da1
2016-06-09 13:45:46 -07:00
Robert Carr
5978cf5ff8 Merge \"PiP animation: Move window with resize when ending animation.\" into nyc-dev
am: 4624d687f7

Change-Id: I94fc4de5fd24f75b2b69f6380048d8e57ae7980e
2016-06-09 19:36:27 +00:00
Robert Carr
a9408d4a48 PiP animation: Move window with resize when ending animation.
At the end of the animation (when going from larger to smaller),
we are left with a scaled surface, that we want to seamlessly
resize to an unscaled surface of the new size. Because we have scaled
the shadow region of the surface, the position of the content
will differ before and after the resize applies. We use new
SurfaceFlinger API to cause position updates to apply after
resize. Because we have to switch into SCALING_MODE_FREEZE,
we could end up prematurely cropping the window, so we
switch to using screen space crop for the pinned stack.

Bug: 28899837
Change-Id: I9b762a237413e4fa3d432e67d30c7125bfef484c
2016-06-09 10:31:17 -07:00
Phil Weaver
2c8099110e Merge \"Revert \"Improve accessibility window title behavior\"\" into nyc-dev
am: fc71309640

Change-Id: Ia2728037f9e610dd49db2bd1a22fd72690bd5340
2016-06-08 02:24:47 +00:00
Phil Weaver
fc71309640 Merge "Revert "Improve accessibility window title behavior"" into nyc-dev 2016-06-08 02:19:34 +00:00
Phil Weaver
266ed9acc3 Revert "Improve accessibility window title behavior"
Bug: 29127065

This reverts commit 2a7e4442bf.

Change-Id: Ibc5527cfedd49c685ffd1b8ae59e87ed99c93d39
2016-06-08 00:34:40 +00:00
Chong Zhang
2f2af39911 Merge "Fix scroll amount calculation in ViewRootImpl" into nyc-dev
am: b1e24209f1

* commit 'b1e24209f16621fd095dacb615364bfd15dfe721':
  Fix scroll amount calculation in ViewRootImpl

Change-Id: Idb326fa8e459aaf3a97d841c91b3ccefc48dad81
2016-06-02 21:06:00 +00:00
Chong Zhang
6725472329 Fix scroll amount calculation in ViewRootImpl
When calculating scroll amount, we should check whehter focus
is visible using before-scrolling position.

It's possible that the view is already scrolled, then visible
insets changes (eg. IME went away). Previous scroll position
still makes the focus visible, but it will leave the focus
in a bad position when it should be scrolled back.

bug: 29025892
Change-Id: I091f16bebc4c1e5ba831616c51ab2ac75d4c4b3c
2016-06-02 13:33:40 -07:00
Selim Cinek
f874020399 Merge "Fixed a few accessibility issues with notifications and groups" into nyc-dev
am: ddc6de1eda

* commit 'ddc6de1eda495790e6564438994df5d49ddf248f':
  Fixed a few accessibility issues with notifications and groups

Change-Id: Iaa2ddc8bedaad3623190e65116f0d8b85687eb78
2016-05-31 19:36:27 +00:00
Selim Cinek
ddc6de1eda Merge "Fixed a few accessibility issues with notifications and groups" into nyc-dev 2016-05-31 19:26:16 +00:00
Selim Cinek
ddf1b399d8 Fixed a few accessibility issues with notifications and groups
Change-Id: I78fa62884eaa0efe825b5eb1e6cac7d88fc05a7f
Fixes: 28069681
2016-05-27 17:04:56 -07:00