Commit Graph

9022 Commits

Author SHA1 Message Date
TreeHugger Robot
c2a2b94393 Merge "Get rid of Keyguard visibility modifiers on WindowState" 2016-11-03 23:08:26 +00:00
Phil Weaver
b2dc39c09e Merge "Make calls from apps to a11y oneway." 2016-11-03 22:23:27 +00:00
Phil Weaver
ba6285f63d Make calls from apps to a11y oneway.
Saves about 300us for each AccessibilityEvent sent, which
translates to 1 ms in gfx-avg-frame-time in the
QuickSettingsPull.

Test: Ran a11y cts and unit tests. Ran systrace and the
QuickSettingsPull to measure jank improvement.
Change-Id: I6d219b0e82c21047e50d402d930d8a5cc93fa6ad
2016-11-03 11:41:45 -07:00
Winson Chung
34f47747f7 Merge changes I0d6f2f0c,I278ab8c3
* changes:
  Experiment for snapping PIP to closest edge.
  Experiment with allowing tap to break through to interact with the PIP.
2016-11-03 17:48:12 +00:00
John Reck
f0503b0b6f Merge "Add benchmarks for View inflation" 2016-11-03 17:14:57 +00:00
Jorim Jaggi
b0d273427b Get rid of Keyguard visibility modifiers on WindowState
Not needed anymore \o/. Also fixes a flicker when transitioning
between two activities that both set FLAG_LIGHT_STATUS that was
somehow introduced recently.

Test:
- Start an light status bar activity from another activity that
already has light status bar, ensure there is no flicker.
- Open IME and make sure the content gets resized like before.

Change-Id: Ie9c9e1cd40f909c449d36ae436250063af20539e
2016-11-03 04:34:50 +00:00
Winson Chung
dff5c08bfd Experiment for snapping PIP to closest edge.
Test: Enable in SysUI tuner, drag PIP.  This is only experimental to help
      figure out what UX we want to keep.

Change-Id: I0d6f2f0c5909d6a76aae4a8fb84c5076f6996fdd
2016-11-02 18:25:29 -07:00
John Reck
3acf0382da Add benchmarks for View inflation
Also speed up RenderNode creation:

Use finalizer() instead of NativeAllocationRegistry, this
shaves ~3us off of creation currently

Avoid instanceof, instead have SurfaceView explicitly ask
for updates.

Remove unused method call.

Test: ran benchmarks
Change-Id: I3117fdf72313a4e6a9965baca9f2a8b855c19b34
2016-11-02 14:49:51 -07:00
Wale Ogunwale
5b6714c2fa Added support for window TYPE_PRESENTATION
Switched presentation feature to use new window TYPE_PRESENTATION
and also add its own window token to the display the presentation
is running on. This is needed as window manager no longer allows
tokens to have windows on multiple displays.

Bug: 32566372
Test: Presentation mode works.
Change-Id: I9c2998311b65640743b8e23ec4f10bf1ffbfd785
2016-11-02 18:25:34 +00:00
Wale Ogunwale
ac2561e820 Make window token add/remove APIs require displayId
Window tokens can now only be on one display, so we now require clients
that want to add/remove window tokens to specify the display they would
like the token to be created on. This simplifies the token handling code
in WM and will be useful moving forward for clients that want to add
windows to external displays.

Test: Existing tests pass
Change-Id: I6b2d8d58a913b3624f1a9a7bebbb99315613f103
2016-11-02 10:28:45 -07:00
Jorim Jaggi
5974b4df49 Merge changes from topic 'keyguard_refactor'
* changes:
  The big keyguard transition refactor (6/n)
  The big keyguard transition refactor (5/n)
  The big keyguard transition refactor (4/n)
  The big keyguard transition refactor (3/n)
  The big keyguard transition refactor (2/n)
  The big keyguard transition refactor (1/n)
2016-11-02 02:14:15 +00:00
TreeHugger Robot
7bb566c63d Merge "Removing forced layout when the window is translated." 2016-11-01 23:28:18 +00:00
Jorim Jaggi
73294b6cf7 The big keyguard transition refactor (4/n)
Nuke KeyguardScrim

Test: Kill SystemUI while lockscreen is showing, make sure nothing
is visible when being killed.

Bug: 32057734
Change-Id: I9f8d1e5a0e0f968460d8170627a849623c6a7245
2016-11-01 15:36:21 -07:00
Jorim Jaggi
77e1043229 The big keyguard transition refactor (3/n)
Notify activity manager when dreaming showing state changed so
KeyguardController can update the occluded state when the device
is dreaming.

Test: Set dreaming while charging, wait until screen times out,
make sure that dream is occluding Keyguard.
Bug: 32057734
Change-Id: Ied6f485d9b4a1526cb4cd5f0701f86b1ea05830a
2016-11-01 15:36:00 -07:00
Phil Weaver
a3230467d1 Merge "Fixing outdated Javadoc for getAccessibilityViewId" 2016-11-01 22:02:12 +00:00
Winson Chung
c7c4dbb147 Removing forced layout when the window is translated.
Test: Manual, ensure that the accessibility focus is still visible on 
      a moved window (enable talkback, focus a view, then move the 
      window).
Change-Id: Ifd67afe355cac2f1df01ddd16f960282f4d36132
2016-11-01 21:00:59 +00:00
Jorim Jaggi
fe762344f4 The big keyguard transition refactor (1/n)
The heart of this change are two things:
1) Instead of using the force hide mechanism to hide windows behind
Keyguard, we actually make the activities invisible in activity manager.
2) When Keyguard is going away, we change the visibilities in activity
manager and run an app transition.

At the very core we move the responsibility of hiding activities to
ActivityStack, which checks whether Keyguard is showing, and then
hides all non-show-when-locked activities. For that, we need to check
whether any window of an activity has SHOW_WHEN_LOCKED set. We
introduce a callback from WM -> AM in case these Keyguard flags have
changed.

Furthermore, we decide whether to occlude Keyguard in KeyguardController,
which just checks whether the top activity has SHOW_WHEN_LOCKED set. When
this state changes, we prepare an occlude/unocclude app transition, and
in PWM we just inform the Keyguard about the animation so SysUI can play
along this animations in a mostly synchronized manner.

Since we now use an app transition when unlocking the phone, we get
lockscreen launch animations for free - window manager automatically
waits until the activity is drawn, or directly executes the transition
if there is nothing to animate. Thus, we can remove all the infrastructure
around "waitingForActivityDrawn".

The logic to show/hide non-app windows is moved to policy, and we add the
ability to run animations on non-app windows when executing an app
transition.

Test:
1) runtest frameworks-services -c com.android.server.wm.AppTransitionTests
2) Manually test unlocking Keyguard:
2a) Without security
2b) With security
2c) With security but trusted
2d) Portrait while activity behind is in landscape
3) Test launching things from Keyguard
3a) Without security
3b) With security
3c) Launch camera without security
3d) Launch camera with security
3e) Launch camera with securtiy and trusted
3f) Launch voice affordance
4) Set no notifications on lockscreen, drag down, make sure you get
the correct animation
5) Test clicking "emergency" on bouncer
5b) Test "Emergency info" on emergency dialer
5c) Test clicking edit button on emergency info, should show pattern on
Keyguard

Bug: 32057734
Change-Id: Icada03cca74d6a612c1f988845f4d4f601087558
2016-11-01 13:53:32 -07:00
Phil Weaver
7e5b229f31 Fixing outdated Javadoc for getAccessibilityViewId
Test: N/A. Only changing comments.
Change-Id: I2e994c8df0bf71463858090345c3a96f85b7b706
2016-11-01 13:13:51 -07:00
Winson Chung
655332c641 Creating PinnedStackController.
- Creating a PinnedStackController to keep track of the state of the PIP
  to prevent changes in the system (ie. IME showing) and user interaction
  from clobbering each other.
- Refactoring calls in AM into WM/controller

Test: android.server.cts.ActivityManagerPinnedStackTests

Change-Id: Ie59dfd45d5c54764ba69a589b3b8148845e92cc3
Signed-off-by: Winson Chung <winsonc@google.com>
2016-10-31 13:21:55 -07:00
Chet Haase
281c3a28be Merge "Clean up InputConnection.commitContent() javadocs" 2016-10-31 19:34:51 +00:00
Chet Haase
2a16fc53e2 Clean up InputConnection.commitContent() javadocs
Test: docs only, no test apart from verifying that it builds
Bug: #32158219 clean up InputConnection.commitContent() javadocs
Change-Id: I94ca33a34dfaece8db912367d2290db67a4a038a
2016-10-31 09:00:20 -07:00
Aga Madurska
99449eea6c Update colors for the round scroll bar. am: 5177264735 am: c78b695126
am: 5a5187edcd

Change-Id: I08861d4c80ba2d682ed009c82bec1933d8f78c09
2016-10-31 12:05:28 +00:00
Aga Madurska
5a5187edcd Update colors for the round scroll bar. am: 5177264735
am: c78b695126

Change-Id: Iffaab844f7c0fab11cc429f06b450eb190737bc5
2016-10-31 11:59:29 +00:00
Aga Madurska
5177264735 Update colors for the round scroll bar.
Bug:32536003

Change-Id: I35503c089bc918493aab3288580f81d7b780d671
2016-10-31 10:55:07 +00:00
John Reck
1952e2dc9b Merge "Add SurfaceHolder#lockHardwareCanvas()" 2016-10-28 19:38:45 +00:00
John Reck
6bc7014210 Add SurfaceHolder#lockHardwareCanvas()
Bug: 26988043
Test: SurfaceViewTests#testSurfaceHolderHardwareCanvas CTS test
Change-Id: I3e5352d498dbe2fc56a18ca27360d129a14c7784
2016-10-27 14:13:44 -07:00
Winson Chung
303c6b78b6 Fix wrong bounds being used in landscape.
- Ensure we use the right display size when calculating PIP bounds.
- Also update interface to take the display id.

Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testPinnedStackDefaultBounds
Test: #testPinnedStackMovementBounds

Change-Id: I01fd8ba6dee212c29a9a092673ee8f7843e41af6
2016-10-26 12:49:40 -07:00
Andrii Kulian
5406e7ade8 Apply display override config for secondary displays
Now display-specific settings, such as dimensions and orientation,
are stored in display override config. For default display it is
mirroring the global config. Each time when global config is updated,
override of the default display should be updated too and vice versa.

Test: Existing and manual tests still pass.
Change-Id: Ic6c2190092d328820f314a05bed43c875db18170
2016-10-25 13:22:10 -07:00
TreeHugger Robot
0154feef22 Merge "Initial refactoring to enable reuse of SkiaDisplayList on a per RenderNode basis. With Skia renderer we see 30% speed improvement in Invalidate Tree UI Jank test, when SkiaDisplayList objects are reused." 2016-10-19 20:36:00 +00:00
Robert Carr
652aae43e6 Un-hide ROTATION_ANIMATION_SEAMLESS.
For N the Camera used ROTATION_ANIMATION_JUMPCUT
which was reinterpreted as seamless rotation if possible.
However this ended up being non ideal in app transition
scenarios where the rotation animation replaces the app
transition. Here we also can't seamlessly rotate, so the
window just suddenly appears with jumpcut. In fact we want
crossfade as a fallback animation and this is what distinguishes
ROTATION_ANIMATION_JUMPCUT and SEAMLESS. The problem was patched
over in N by having double-tap gestures fire camera intents
with a SEAMLESS ActivityOptions.rotationAnimationHint,
but it was too late to un-hide for consumption by apps. While here,
clean up some documentation that doesn't really parse.

Test: Manual, try the RotationAnimation activity in ApiDemos sample.
Bug: 28838855
Bug: 28823590
Change-Id: I17b5e9fa967df8ade0943337cd7b6c3956d3a499
2016-10-17 17:23:09 -07:00
Stan Iliev
c0e7a90f1f Initial refactoring to enable reuse of SkiaDisplayList
on a per RenderNode basis. With Skia renderer we
see 30% speed improvement in Invalidate Tree UI Jank test,
when SkiaDisplayList objects are reused.

Test: manually built and run on angler-eng.
Change-Id: Ie4ec50ddb2015150e3ec678dde7ebed0c8d90067
2016-10-17 16:30:28 -04:00
John Reck
caa08ff5e9 The bigger update to Canvas
All draw* calls in Canvas are regular JNI
All draw* calls in DisplayListCanvas are FastNative
Unifies Canvas JNI on nMethodName naming

CanvasPerf results before:
INSTRUMENTATION_STATUS: basicViewGroupDraw_min=12492
INSTRUMENTATION_STATUS: recordSimpleBitmapView_min=13912

and after:
INSTRUMENTATION_STATUS: basicViewGroupDraw_min=11945
INSTRUMENTATION_STATUS: recordSimpleBitmapView_min=13318

Test: refactor, makes & boots
Change-Id: I06000df1d125e17d60c6498865be7a7638a4a13e
2016-10-17 11:33:28 -07:00
TreeHugger Robot
c2e3594b7f Merge "Drawing debug focus on Books/Recommended for you/MORE button" 2016-10-14 23:33:55 +00:00
Andrii Kulian
b97963475a Merge "Make usage of Configuration.EMPTY safe" 2016-10-14 23:27:06 +00:00
Winson Chung
011c85729a Merge "Adding PIP input consumer." 2016-10-14 22:34:03 +00:00
Vadim Tryshev
5e16f77865 Drawing debug focus on Books/Recommended for you/MORE button
1. Taking into account scroll state
2. Drawing focus also for views with edges.

Bug: 32099818
Test: Manually ensure that that button draws focus
Change-Id: I085db4deb1561d8b480e4012018d48bc83a7f81f
2016-10-14 14:36:01 -07:00
Winson
412754816d Adding PIP input consumer.
- This CL provides the framework for manipulating the pinned stack using
  an input policy (to be determined later) provided by the SystemUI.

Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testNonTappablePipActivity

Change-Id: I025c41fff26ed05a35d68e59f10330680ed11ea8
2016-10-14 11:21:48 -07:00
Andrii Kulian
a8a9bc5860 Make usage of Configuration.EMPTY safe
With current approach there is a high chance of making a programming
error and altering the state of singleton Configuration.EMPTY object,
because previously configuration was usually set by link to it.

This CL changes the behavior to create Configuration member objects
only once and alter their state afterwards.

Test: Manual and existing tests still pass.
Change-Id: Ie267c2fbf555f137670b7bd2cd251b817c69bc8e
2016-10-14 11:00:13 -07:00
TreeHugger Robot
16c9e8bac7 Merge "Visualize view focus in debug mode." 2016-10-13 20:28:57 +00:00
Vladislav Kaznacheev
1ed3c63bb8 Merge "Avoid sending incorrect or redundant hover events." 2016-10-13 18:29:20 +00:00
TreeHugger Robot
3bc72e5549 Merge "Fix import statement in view|transition|animation packages." 2016-10-12 21:31:56 +00:00
Aurimas Liutikas
67e2ae8639 Fix import statement in view|transition|animation packages.
This change also remove trailing whitespace.

Test: code still compiles
Change-Id: I7eff4546320d67d2bae58d31bad0625ea0791b8f
2016-10-12 09:09:52 -07:00
Vadim Tryshev
cdf38ba2c8 Visualize view focus in debug mode.
See the bug for motivation.

Bug: 32099818
Test: Manual check with enabling the dev setting.
Change-Id: I77262f77ac709639e5b1314a0be45612bde70ad6
2016-10-11 18:36:49 -07:00
Romain Guy
253f2c213f Linear blending, step 1
NOTE: Linear blending is currently disabled in this CL as the
      feature is still a work in progress

Android currently performs all blending (any kind of linear math
on colors really) on gamma-encoded colors. Since Android assumes
that the default color space is sRGB, all bitmaps and colors
are encoded with the sRGB Opto-Electronic Conversion Function
(OECF, which can be approximated with a power function). Since
the power curve is not linear, our linear math is incorrect.
The result is that we generate colors that tend to be too dark;
this affects blending but also anti-aliasing, gradients, blurs,
etc.

The solution is to convert gamma-encoded colors back to linear
space before doing any math on them, using the sRGB Electo-Optical
Conversion Function (EOCF). This is achieved in different
ways in different parts of the pipeline:

- Using hardware conversions when sampling from OpenGL textures
  or writing into OpenGL frame buffers
- Using software conversion functions, to translate app-supplied
  colors to and from sRGB
- Using Skia's color spaces

Any type of processing on colors must roughly ollow these steps:

[sRGB input]->EOCF->[linear data]->[processing]->OECF->[sRGB output]

For the sRGB color space, the conversion functions are defined as
follows:

OECF(linear) :=
linear <= 0.0031308 ? linear * 12.92 : (pow(linear, 1/2.4) * 1.055) - 0.055

EOCF(srgb) :=
srgb <= 0.04045 ? srgb / 12.92 : pow((srgb + 0.055) / 1.055, 2.4)

The EOCF is simply the reciprocal of the OECF.
While it is highly recommended to use the exact sRGB conversion
functions everywhere possible, it is sometimes useful or beneficial
to rely on approximations:

- pow(x,2.2) and pow(x,1/2.2)
- x^2 and sqrt(x)

The latter is particularly useful in fragment shaders (for instance
to apply dithering in sRGB space), especially if the sqrt() can be
replaced with an inversesqrt().

Here is a fairly exhaustive list of modifications implemented
in this CL:

- Set TARGET_ENABLE_LINEAR_BLENDING := false in BoardConfig.mk
  to disable linear blending. This is only for GLES 2.0 GPUs
  with no hardware sRGB support. This flag is currently assumed
  to be false (see note above)
- sRGB writes are disabled when entering a functor (WebView).
  This will need to be fixed at some point
- Skia bitmaps are created with the sRGB color space
- Bitmaps using a 565 config are expanded to 888
- Linear blending is disabled when entering a functor
- External textures are not properly sampled (see below)
- Gradients are interpolated in linear space
- Texture-based dithering was replaced with analytical dithering
- Dithering is done in the quantization color space, which is
  why we must do EOCF(OECF(color)+dither)
- Text is now gamma corrected differently depending on the luminance
  of the source pixel. The asumption is that a bright pixel will be
  blended on a dark background and the other way around. The source
  alpha is gamma corrected to thicken dark on bright and thin
  bright on dark to match the intended design of fonts. This also
  matches the behavior of popular design/drawing applications
- Removed the asset atlas. It did not contain anything useful and
  could not be sampled in sRGB without a yet-to-be-defined GL
  extension
- The last column of color matrices is converted to linear space
  because its value are added to linear colors

Missing features:
- Resource qualifier?
- Regeneration of goldeng images for automated tests
- Handle alpha8/grey8 properly
- Disable sRGB write for layers with external textures

Test: Manual testing while work in progress
Bug: 29940137

Change-Id: I6a07b15ab49b554377cd33a36b6d9971a15e9a0b
2016-10-11 17:47:58 -07:00
Vladislav Kaznacheev
5a77c37488 Avoid sending incorrect or redundant hover events.
Make sure ACTION_HOVER_EXIT is never sent to a
ViewGroup more than once.

While processing ACTION_HOVER_MOVE during exiting
a hover target never send it a ACTION_HOVER_ENTER.

Test: android.view.cts.HoverTest
Bug: 32071138
Bug: 32071098
Change-Id: Ibc1809137907176437a3a5a4ea14b00f1c629b58
2016-10-10 16:11:15 -07:00
John Reck
5cb74bca88 Canvas fastjni -> @FastNative
Just the basic cleanup first, will follow-up with a more
comprehensive update later
Test: builds & boots, refactor no behavior change

Change-Id: Ie3a7144b5fefdfda085e2ab50da8b0e627a1ecb8
2016-10-10 08:19:15 -07:00
Phil Weaver
6e91196404 Merge "Move a11y event dispatch back to ui thread." 2016-10-05 21:13:48 +00:00
TreeHugger Robot
838277059f Merge "More fixes in drag/drop docs." 2016-10-05 20:11:11 +00:00
Phil Weaver
65097bf83f Move a11y event dispatch back to ui thread.
Test: Ran CTS

Bug: 31753900
Change-Id: I0ba096cb99dd8347a7e9d6c41ff0aa8293dc5d15
2016-10-05 11:08:20 -07:00
John Reck
f6f26015f2 Merge "DisplayEventReceiver -> @FastNative" 2016-10-04 15:57:42 +00:00