Commit Graph

8105 Commits

Author SHA1 Message Date
Chris Craik
6ee192f4e9 Document that SurfaceView is synchronous in N
bug:28821062

Change-Id: I1c17949d93de3d1f89c504fc061f7d20dd451a4d
2016-05-17 16:17:25 -07:00
Yohei Yukawa
cef3337cb5 Merge "Make IMS#clearInsetOfPreviousIme() reliable." into nyc-dev 2016-05-16 15:22:21 +00:00
Yohei Yukawa
833bdcedce Make IMS#clearInsetOfPreviousIme() reliable.
This is a follow-up to my previous CL [1] for Bug 15922840 so that we
can clear the following variables in a more reliable way.
 - PhoneWindowManager#mLastInputMethodWindow
 - PhoneWindowManager#mLastInputMethodTargetWindow

The idea behind CL [2] is that when InputMethodManagerService (IMMS) is
switching from an IME to another IME, IMMS can send a signal to
WindowManagerService (WMS) to remember the current IME's inset so that
the system can continue using it to reduce jank until the new inset is
specified by the next IME.  As summarized in Bug 28781358, however, if
the next IME does not show the window after the IME switch, WMS (or
PhoneWindowManager to be precise) keeps using the previous IME's inset
unexpectedly until the new IME shows its window.  All we have seen in
Bug 15922840 and Bug 26663589 fall into this category.

The idea of this CL is just adding a hidden API to InputMethodManager so
that InputMethodService#clearInsetOfPreviousIme() can surely terminate
the IME transition state managed in PhoneWindowManager, rather than
relying on a hack of calling SoftInputWindow#show() and
SoftInputWindow#hide(), which actually does not work for Bug 26663589.

 [1]: Ib04967f39b2529251e4835c42e9f99dba2cf43f2
      2977eb7b6c
 [2]: I5723f627ce323b0d12bd7b93f5b35fc4d342b50c
      792faa2c16

Note that addressing all the corner cases in [2] still requires lots of
non-trivial change.  Hence this CL focuses only on Bug 26663589 (and
the case we handled in Bug 15922840).

Bug: 26663589
Change-Id: Ib567daa009c1139858dccadcfc6a04465ebecf36
2016-05-15 20:05:56 -07:00
Abodunrinwa Toki
cb66406d33 Ensure that ViewGroup.getChildVisibleRect(...) is recursive.
This change fixes the issue where
getChildVisibleRect(View, Rect, Point, boolean) call isn't recursive.
The method was introduced in I49550ed4082bcbdcfe4643b962b50f3308092525

Bug: 28514727
Change-Id: Ib6b0fb67ca6c700b44f645319c23b1213a2742d4
2016-05-13 19:26:03 +01:00
Andrii Kulian
4ef107bb7a Merge "Close leaked windows when trying to preserve main one" into nyc-dev 2016-05-13 03:24:34 +00:00
Vladislav Kaznacheev
cb4bbd7af8 Partial fix for jumping freeform windows
Currently every focus change causes a freeform window to jump
for a few frames. The size of the jump is equal to the difference
in inset size (which is derived directly from the window elevation).

This problem goes away for most real use cases if the insets are
not allowed to decrease.

Bug: 28318973
Bug: 22668382
Change-Id: I77ca440a7d9c89cc4d45e6667bf37da94a5c8a9a
2016-05-12 23:56:32 +00:00
Yigit Boyar
4c6eeb67a2 Merge "Respect add focusables flags" into nyc-dev 2016-05-12 23:19:22 +00:00
Yigit Boyar
4c6e983000 Respect add focusables flags
This CL fixes 2 bugs in View's addFocusables implementations.

1) addFocusables(list, dir) method was always returning focusables in
touch mode even if the device is not in touch mode.

2) addFocusables(list, dir, mode) was not respecting the provided mod.

Bug: 28745577
Change-Id: I9b9e5af27f8f5b1bb3cc601584fdad7c73e54a5d
2016-05-12 15:11:13 -07:00
Andrii Kulian
eac0ea5cdf Close leaked windows when trying to preserve main one
When app has several windows and activity is relaunched + we try to preserve
main window - other windows just stayed around until removed by timeout or
replaced by app. There was a problem when one of the windows registered
broadcast receiver and set its own timer to remove it. In this case all
receivers were removed by framework because windows were considered leaked
and apps' timer caused crash when trying to remove registered receiver.

This CL removes all windows expect the main one, which we're trying to
preserve in this case.

Bug: 28337135
Change-Id: Ib8790cc8c61801f11d871ba3803bb0ebc3d3be01
2016-05-12 13:37:05 -07:00
Dimitry Ivanov
0997908c95 Move Vulkan layer path setup to ApplicationLoaders
ThreadedRenderer was never the right place for this anyway, and
ApplicationLoaders can provide both the full library search path (not
just the extracted native library dir) as well as the application loader
namespace.

Bug: 28213888
Change-Id: Ibcc0a9178da4dba6f3f3105932fdac1a1d0261af
2016-05-11 22:59:10 -07:00
Jim Miller
e4044bb617 Fix KeyguardManager.isSecure() to observe work profile
The fix passes the calling userId instead of the current userId to
allow apps running as managed profiles to work.

Fixes bug 28666104

Change-Id: I9f8676ab11bd581d9e67b2b9f385036d4d3576ee
2016-05-10 18:38:25 -07:00
Jorim Jaggi
e85ce990fe Don't stage content drawn bounds
It's certainly not needed for two up, so remove the staging aspect.

Freeform resizing is currently broken because of another bug so this
can't be tested, but because we are not "shipping" it in any case
fixing the 2-up bug is more important, but it shouldn't break freeform
anyways.

Bug: 28618501
Change-Id: I6f285a714281fde50fd7328a3f8999cfa8dfb2c5
2016-05-11 00:37:33 +00:00
Chong Zhang
44aabe4b72 Disable keep_screen_on traces
bug: 28692100
bug: 27522448

Change-Id: Ic077e8985f1f21bc111287813fb2992ed01df909
2016-05-10 21:34:01 +00:00
Yohei Yukawa
9f76abc8ab Merge "Fix stale InputMethodManager#mFullscreenMode." into nyc-dev 2016-05-05 21:55:50 +00:00
TreeHugger Robot
ea162c3c79 Merge "Prepare to replace windows across recreate()." into nyc-dev 2016-05-05 19:38:17 +00:00
Chong Zhang
6afe594461 Merge "Debug traces to facilitate screen timeout debugging" into nyc-dev 2016-05-04 22:50:11 +00:00
TreeHugger Robot
4e34cd0537 Merge "Fix View leakage from mPreSortedChildren" into nyc-dev 2016-05-04 22:23:26 +00:00
Chong Zhang
4ffc318012 Debug traces to facilitate screen timeout debugging
bug: 27522448
Change-Id: I4d51be316e4aedecffb7001126849d7c6136d517
2016-05-04 15:09:01 -07:00
Chris Craik
fc56377178 Fix View leakage from mPreSortedChildren
bug:28553824

Change-Id: I62bfa3dcb121792dff7d00be1f4b018a99c96e1d
2016-05-04 13:40:07 -07:00
Robert Carr
77bdfb512f Prepare to replace windows across recreate().
When the activity locally recreates itself, nothing
on the server side is able to prepare preserving windows,
or replacing windows. The activity was trying to defer
removing the old window, but it was just waiting
until the new one was created, not until it was drawn,
thus resulting in a flicker. It's easy to backpack on the
existing replacement infrastructure.

Bug: 28221875
Change-Id: I55fc4ca78e9e11809473fedd8b30b6a6350cf852
2016-05-04 12:40:39 -07:00
Chet Haase
d86fb2ce37 Force second measure pass when there is a configuration change
It's possible for a call to updateConfiguration() to happen in the middle
of performTraversals(), after the measure phase has happened, but before
the layout phase. During the configuration call, it's possible for views to
have requestLayout() called on them. This can result in the request flag
not getting cleared, because views that have had layout requested, but which
have not yet been measured, may not be told to layout.

The correct flow should be that any code path causing requestLayout() (which
could be anything that calls out to user/app code) should happen before the
measure phase (or cause a second measure to occur). For now, causing the second
measure to occur is a low-risk simple change that fixes the immediate problem.

Issue #28152259  Calling requestLayout from inside View.onConfigurationChanged can cause problems

Change-Id: I3b532eeacc3784d8d21193d01ddd7fa15ac0684e
2016-05-04 18:14:46 +00:00
Abodunrinwa Toki
4e7a1208ea Implement alternative ViewGroup.getChildVisibleRect.
This CL allows getChildVisibleRect to optionally always call the
view's parent. The previous version attempted to optimize the call
by not calling further up the view heirarchy when the rect isn't
visible in the current view.

The call is hidden and the previous behaviour is preserved to limit
the bits of code that this change affects.

Bug: 28514727
Change-Id: I49550ed4082bcbdcfe4643b962b50f3308092525
2016-05-03 19:41:15 +01:00
Jaewan Kim
d98dcab679 Fix crash when device doesn't support picture-in-picture
Bug: 28512987
Change-Id: Ic8287d70fed491d7493d443ba7d9633b7d9aaea9
2016-05-03 07:13:28 +09:00
TreeHugger Robot
3446a6ef71 Merge "Fix ViewRoot inset adjustment after initial setup." into nyc-dev 2016-04-29 20:37:33 +00:00
Robert Carr
1bccabf3c4 Fix ViewRoot inset adjustment after initial setup.
If the insets change, "mWidth/mHeight" won't change
as it's based on the window frame (not the surface size),
we need to track when the insets change and call
HardwareRenderer.setup with the new values.

Bug: 28257246
Bug: 28368990
Change-Id: Ida304b57c4671d010d1cf7b370674c9453841c97
2016-04-29 11:13:57 -07:00
TreeHugger Robot
5bddeaa9bc Merge "Properly parcel HdrCapabilities." into nyc-dev 2016-04-28 15:01:31 +00:00
Yohei Yukawa
1544def0fa Fix stale InputMethodManager#mFullscreenMode.
The current mechanism to sync InputMethodService#mIsFullscreen to
InputMethodManager#mFullscreenMode is really fragile because
  1. Currently the state change is notified via
     InputConnection#reportFullscreenMode(), where InputConnection is
     designed to be valid only while the IME has input focus to the
     target widget.
  2. In favor of performance InputMethodService (IMS) calls
     InputConnection#reportFullscreenMode() only when #mIsFullscreen
     changed.  If InputConnection#reportFullscreenMode() failed, there
     is no recovery mechanism.
  3. Screen oriantation change is likely to cause Window/View focus
     state change in the target application, which is likely to
     invalidate the current InputConnection.

What our previous workaround [1] did for Bug 21455064 was actually
relaxing the rule 1 only for InputConnection#reportFullscreenMode().
However, my another CL [2] made the lifetime check of InputConnection a
bit more strict again, which revived the issue as Bug 28157836.

Probably a long-term fix would be to stop using InputConnection to sync
that boolean state between IMS and the application.  However, it's too
late to do such a refactoring in N, hence this CL relaxes the rule 1
again keeping it as secure as possible.

The idea is that we allow InputConnection#reportFullscreenMode() to
update InputMethodManager#mFullscreenMode regardless of whether
InputConnection is active or not, as long as the InputConnection is
bound to the curent IME.  Doing this as a short-term solution is
supporsed to not introduce any new risk because the active IME is
already able to mess up the InputMethodManager#mFullscreenMode by
calling InputConnection#reportFullscreenMode() on any other active
InputConnection.  Bug 28406127 will track the long-term solution.

 [1]: Id10315efc41d86407ccfb0a2d3956bcd7c0909b8
      da589dffdd
 [2]: If2a03bc84d318775fd4a197fa43acde086eda442
      aaa38c9f1a

Bug: 28157836
Change-Id: Iba184245a01a3b340f006bc4e415d304de3c2696
2016-04-28 12:41:11 +00:00
Michael Wright
b082890149 Properly parcel HdrCapabilities.
Since the field might be null, we can't just read and write the
object directly. Use Parcel's convenience methods to do so safely
instead.

Bug: 28427070
Change-Id: I6460c9cb43dc6da97d5fd9edeaa78bdaaf105446
2016-04-27 19:28:29 -04:00
Phil Weaver
1f70f0b7d6 Merge "Fix several accessibility magnification issues." into nyc-dev 2016-04-27 22:50:37 +00:00
Phil Weaver
70439244ba Fix several accessibility magnification issues.
Clarifying region used for magnification as "magnificationRegion",
both in the public API and in the code. There's been significant
confusion about what "magnfifiedRegion" means. Removing
"availableRegion" from everywhere except where it's required, as
that region was identical to magnified/magnification region.

Trying to shut down magnification was a complex situation where
animations in progress and new magnification requests were tricky to
handle correctly. It was not possible to guarantee that the
magnification callbacks were unregistered consistently. There were
at least two situations that led to phone restarts:
1. If a triple tap was detected between unregistering the callbacks
and shutting down the input filter. In this case the magnification
request would go through.
2. If an animation had just started when magnification was turned
off, so the current magnification was 1.0 but the animator was
about to change it. In this case the callbacks would be unregistered,
and then the animator would start changing the magnification.

This change makes registering and unregistering magnification atomic.
It also makes MagnificationController stick around indefinitely once it
is created, registering and unregistering as needed to support
magnification gestures and services that control magnification. Services
that merely query the status of magnification no longer register for
callbacks.

One part of shutting down is turning off the animation and guaranteeing
that it won't try to make further changes. Adding a flag to
SpecAnimationBridge and a lock in that class so we can guarantee that
nothing happens when we aren't registered for magnification callbacks.

Also reconfiguring all accessibility options when a service stops to
make sure that only the features required by the current configuration
are enabled.

Bug: 27497138
Bug: 27821103
Change-Id: If697cbd34b117d82c8eee1ba7d0254089ee4241d
2016-04-27 13:57:43 -07:00
Bo Liu
08ca2e3a75 Merge "Revert "Expose setDrawGLFunctionDetachedCallback to webview"" into nyc-dev 2016-04-27 17:58:34 +00:00
Hangyu Kuang
39bb2c29b4 Merge changes from topic 'atv-hdr' into nyc-dev
* changes:
  Unhide getHdrCapabilities and HdrCapabilities.
  Plumb HDR capabilities to Display
  Revert "Revert "Hook up HDR capabilities from native SurfaceControl""
2016-04-27 16:38:21 +00:00
John Reck
7f209d37f1 Merge "API tweaks to PixelCopy and make it public" into nyc-dev 2016-04-27 14:36:53 +00:00
Rob Carr
69a6fe321c Merge "Fix bugs with takeSurface and preserveWindows." into nyc-dev 2016-04-27 00:47:59 +00:00
Hangyu Kuang
da802f5100 Unhide getHdrCapabilities and HdrCapabilities.
Bug:25684127
Change-Id: Ibeefc566213da5b76deba13eb2224916a4fefd13
2016-04-26 23:04:56 +00:00
Michael Wright
9ff94c0251 Plumb HDR capabilities to Display
Bug: 25684127
Change-Id: I0a4fcdc59aa1a7b295c8df03699466685300e735
2016-04-26 23:04:30 +00:00
John Reck
e94cbc76d5 API tweaks to PixelCopy and make it public
Bug: 27708453
Change-Id: I81667ce42f9ca1c1a13e1e61299927900845fc84
2016-04-26 15:41:43 -07:00
Oren Blasberg
a86d1e0b59 Merge "Accommodate NaN in new context menu methods." into nyc-dev 2016-04-26 22:41:01 +00:00
Hangyu Kuang
54ac219184 Revert "Revert "Hook up HDR capabilities from native SurfaceControl""
This reverts commit 2c38f45f27.


Bug:25684127
2016-04-26 22:24:23 +00:00
Sergei Vasilinetc
c015719954 Merge "DisplayListCanvas: throw exception at attempt to draw bitmap with size > 100MB" into nyc-dev 2016-04-26 21:39:43 +00:00
Robert Carr
b259485087 Fix bugs with takeSurface and preserveWindows.
When reusing a ViewRoot and DecorView as we do with preserveWindows
there are two issues with SurfaceHolders.  First, we update the
SurfaceHolder callbacks when we call ViewRootImpl.setView. In the
case of preserved window relaunch, the DecorView is reused and there is
no call to setView. We need the ActivityThread to notify the ViewRoot
that something has changed. Secondly, we were assuming the only time
a new surface would be created for the purposes of SurfaceHolder
notification was when we previously did not have a valid surface.
Instead we need to check if the native Surface object has changed each time we
get a result from relayout.

Bug: 28331264
Change-Id: If1b4aab9b2ba579fa040e2a3ab4471842476d82f
2016-04-26 14:33:21 -07:00
Jaewan Kim
f0fd218382 PIP: Send KEYCODE_WINDOW to app first if PIP isn't exist
Bug: 27954955
Change-Id: I517e378d5c1672ac0eb87bdf4375b7d733276e58
2016-04-26 13:06:21 +09:00
Clara Bayarri
f48f390a60 Merge "Improve KeyboardShortcutInfo documentation for Modifiers" into nyc-dev 2016-04-25 09:31:06 +00:00
Chris Banes
b02d51b3d3 Merge "Make AbsSavedState read using given ClassLoader" into nyc-dev 2016-04-23 07:04:21 +00:00
Bo Liu
d443f36957 Revert "Expose setDrawGLFunctionDetachedCallback to webview"
This reverts commit ee34ef1633.

This API is no longer needed by webview since 51.0.2704.22.
So remove this API. Note that this system API has never shipped
so it's ok to simply remove it.

Original description:
> Expose setDrawGLFunctionDetachedCallback to webview
>
> Add WebViewDelegate.setDrawGLFunctionDetachedCallback system API that's
> used for webview to receive the functor detach callback.
>
> BUG: 27709981
> Change-Id: Ie6b5e445c0090a181f94fcd2ec1ea77095c9cb03

BUG: 27709981
Change-Id: I9920dbedc6a280b4a19a8715832c4d2f64a7a7be
2016-04-22 13:32:23 -07:00
Andres Morales
82ee675330 Merge "FrameMetricsListener API council changes" into nyc-dev 2016-04-22 16:31:21 +00:00
Chris Banes
02e81a094f Make AbsSavedState read using given ClassLoader
Currently it does not use a ClassLoader to read
any super state, which can cause crashes for
custom views using the class but on a different
class loader.

BUG: 27790353
Change-Id: I4f4d1d72f213f2481606673643c0e56c23d34bc6
2016-04-22 13:52:08 +01:00
Tim Murray
e5cebf7aaa Merge "Fix flag value collision" into nyc-dev 2016-04-21 22:59:42 +00:00
John Reck
60e885f672 Fix flag value collision
Bug: 28314544
Change-Id: If73c1e8fd0e7b313bccbeffa172bdc3ab9496a43
2016-04-21 15:40:45 -07:00
sergeyv
3d8298e1a8 DisplayListCanvas: throw exception at attempt to draw bitmap with size > 100MB
bug:26943116
Change-Id: If72c9f21ca2d8eb660ea2db4a42c8199f8d02472
2016-04-21 14:48:04 -07:00