Commit Graph

11845 Commits

Author SHA1 Message Date
Yohei Yukawa
0c49908a02 Stop supporting null IME token in IMM#switchToLastInputMethod()
Hopefully no one has relied on this undocumented behavior that when
the caller has WRITE_SECURE_SETTINGS then null IME token is allowed in
IMM#switchToLastInputMethod().

Bug: 114488811
Test: CtsInputMethodServiceHostTestCases
Change-Id: Icb02c9bb52b11cff39b222198f4b67984676b9a6
2018-12-09 18:52:02 -08:00
Yohei Yukawa
70f17e7c1d Remove IInputMethodManager#switchToNextInputMethod()
It turns out that we had already rejected null IME token in
InputMethodManager#switchToNextInputMethod() since Android L [1].

Hence there is no need to keep this IPC any more.

There should be no developer-visible behavior change.

 [1]: I043aa30a19c821f33effd57dfd6590b0e3ed817b
      34c666472137a99a2ce5546b80bd04979d10ab7a

Bug: 114488811
Test: atest CtsInputMethodServiceHostTestCases
Change-Id: I72ee82d62e3bdce44f623604eca86ab3fe3df0bd
2018-12-09 18:51:38 -08:00
Felipe Leme
749b889889 Yet another (major) refactoring on Content Capture and Augmented Autofill.
Bunch of changes:

- Split public SmartSuggestionsService info ContentCaptureService and
  AugmentedAutofillService
- Renamed 'intelligence' packages to either 'contentcapture' or
  'autofil.augmented'
- Renamed internal packages and classes.
- Changed permissions, resource names, etc...
- Moved Augmented Autofill logic from IntelligeceManagerService (R.I.P.) to
  Autofill.
- Optimized IPCs by passing a String instead of the InteractionSessionId
  (that also solves the view -> service dependency).

Test: atest CtsContentCaptureServiceTestCases \
            CtsAutoFillServiceTestCases \
            FrameworksCoreTests:SettingsBackupTest
Test: manual verification with Augmented Autofill Service

Bug: 119638877
Bug: 117944706

Change-Id: I787fc2a0dbd9ad53e4d5edb0d2a9242346e4652d
2018-12-06 16:56:39 -08:00
TreeHugger Robot
205b9ffda2 Merge "Required change for the new model drop" 2018-12-06 10:07:16 +00:00
TreeHugger Robot
d9ddcd6a9e Merge "Add @InspectableProperty to View" 2018-12-06 03:42:41 +00:00
Ashley Rose
25c291da8e Add @InspectableProperty to View
Bug: 120492712
Test: make framework
Change-Id: Ie2269898e0b0b526d9bb3e72286d7164de079dd6
2018-12-05 17:07:23 -05:00
Jackal Guo
100a6f0417 Merge "Get long press timeout directly" 2018-12-05 06:33:13 +00:00
Hyundo Moon
873d88d2c0 Merge "AML: Unhide KeyEvent.isMediaSessionKey()" 2018-12-05 03:00:13 +00:00
Hyundo Moon
3d1353aa60 AML: Unhide KeyEvent.isMediaSessionKey()
Bug: 119789707
Test: make update-api
Change-Id: I60f3271b205348ed64241851304fe7213a535c8e
2018-12-05 09:07:08 +09:00
Ashley Rose
0b2d82ca1e Remove bad type param link
Test: make framework
Change-Id: Ie482534af48d46fd7d087ad60a6a5adc597617cb
Fixes: 120499404
2018-12-05 00:04:01 +00:00
Tony Mak
8508fbf5e2 Required change for the new model drop
Will pipe through the real data in the coming CL.

Test: atest TextClassifierTest.java

Change-Id: Ia23c0755dd01abc609349e2be0e8ec10014953f5
2018-12-04 19:08:48 +00:00
TreeHugger Robot
be0afe72a8 Merge "Refactor Inspector API" 2018-12-04 18:36:51 +00:00
Tiger Huang
b4287e0c49 Merge "Prevent the focus state from getting cleared" 2018-12-04 10:10:41 +00:00
Jorim Jaggi
c999d5ee84 Merge "A brave new world for window insets (2 and 3/n)" 2018-12-04 09:44:26 +00:00
Ashley Rose
d2c5f456c9 Refactor Inspector API
InspectionHelper has been renamed to InspectionCompanion for clarity
about its lifecycle. The APIs needed to be accessed from the context of
an inspection agent injected by the profiler have been made public.

With a tightend focus on platfrom views and XML resource IDs, the
@InspectableProperty annotation now has affordances for specifying an
attribute resource ID and for defining @IntDef flag and enum mappings.
@InspectableChildren has been removed, as this will be special cased in
the injected inspector. Additionally, support for attribute ID is now
provided in all PropertyMapper methods.

Additionally, PropertyMapper and PropertyReader now have support for
Gravity ints, @ColorInt, @ColorLong, and Color objects.

Test: mmma frameworks/base
Bug: 120224687
Change-Id: If455e2d1d9693eac39c33fc35f892baf75671ba4
2018-12-04 01:20:11 +00:00
Felipe Leme
39233ff029 Refactored AbstractRemoteService in 2 classes.
AbstractRemoteService was spun off from RemoteFillService, which only supports
1 pending request while not bound to the service - if a new request comes,
it cancels the previous one.

This behavior is fine for Autofill, but for Content Capture all requests must be
queued. In fact, the upcoming CTS tests for Content Capture were failing because
the 1st PendingOnContentCaptureEventsRequest would cancel the pending
PendingSessionLifecycleRequest.

So, this CL fix this problem by creating 2 subclasses:
 - AbstractSinglePendingRequestRemoteService
 - AbstractMultiplePendingRequestsRemoteService

Test: atest CtsContentCaptureServiceTestCases CtsAutoFillServiceTestCases

Bug: 111276913
Bug: 117779333

Change-Id: I43bb98be16f5def037f85a415e1f77799adf156e
2018-12-03 15:29:07 -08:00
Felipe Leme
ecb08be22e Split IntelligenceManager / IntelligenceService.
This name is too generic, so we split it in 2 parts:

- ContentCaptureManager: the public API used by views and apps to report their
  structure.
- SmartSuggestionsServiec: the system service use to consume these events and
  provide autofill suggestions.

This CL also:

- Optimizes ContentCaptureManager allocation so they are not created on contexts that are not
  capturing events (such as views from the system server).
- Uses a generic ContentCaptureEventsRequest (rather than a list of events) to make it easier
  to be extended.
- Fixed IntelligencePerUserService so it clears the sessions when the
  implementation changes.

Test: manual verification

Bug: 119776618
Bug: 117944706
Bug: 119638877

Change-Id: I069bcd23dda94afe18b2781fd3981b8b555afa56
2018-12-03 15:29:07 -08:00
Jorim Jaggi
b603095494 A brave new world for window insets (2 and 3/n)
Implements basic API's to control windows generating insets in
the new insets world.

Test: CTS tests will be added at some point in the future
Bug: 118118435
Change-Id: I722d2e58c68734ac131b12da3d9978e946292130
2018-12-03 21:53:09 +01:00
Chavi Weingarten
e8f76a3642 Merge "Reparent DisplayContent layers to SurfaceControl for ActivityView" 2018-12-03 18:08:43 +00:00
Andrey Kulikov
c7f839b720 Merge "Restrict unsupported API usage to View.setFrame" 2018-12-03 15:54:19 +00:00
Andrey Kulikov
c5713cbf62 Made View#setTransitionAlpha(),getTransitionAlpha() public
It will allow to call this methods in AndroidX Transition without reflection.

Bug: 117521009
Bug: 117519704
Test: a new test
Change-Id: I68f33365337a3c21c0914e8a02bef47e430d8e46
2018-12-03 13:49:02 +00:00
Andrey Kulikov
470564c977 Restrict unsupported API usage to View.setFrame
Developers should use setLeftTopRightBottom() instead. Also making setLeftTopRightBottom final.

Bug: 117520377
Test: none
Change-Id: I67d196e4950d4ef43c9b15dbd00a7dc5d72a59d5
2018-12-03 13:48:21 +00:00
Andrey Kulikov
5754598e83 Makes View#setAnimationMatrix public
Bug: 117520374
Test: None. There is no getter for it so it's not easy to test. Probably it should be tested on RenderNode side instead.
Change-Id: I399ebb772e557c849b02a1d71be7821121a9ce8a
2018-12-03 11:34:39 +00:00
Andrey Kulikov
4bcd414ea9 Merge "Made ViewGroup.suppressLayout/isLayoutSuppressed public" 2018-12-03 11:32:48 +00:00
Tiger Huang
44c0455124 Let getNavBarPosition() can take displayId
Navigation bar can show on non-default display now. So the caller
should specify which display the desired navigation bar is on.

Bug: 117474929
Test: atest QuickStepControllerTest
Change-Id: Ibe06a6c7778134204502e6456860d69bea2a9061
2018-12-03 16:10:27 +08:00
Lucas Dupin
ff9d6ab69f Expose rounded corners to SurfaceControl
Bug: 111514493
Test: Manualy launch an app
Test: Press home when activity is on top of the stack
Test: Quick scrub
Test: Swipe up on the home button, swipe down
Change-Id: Id8196e344585b4f7aebea595c12e7276dbbd881b
2018-12-02 04:32:14 -08:00
TreeHugger Robot
031eef2fef Merge "Expose RenderNode#getUniqueId() as View#getUniqueDrawingId()" 2018-12-01 05:44:59 +00:00
Ashley Rose
752828f92f Expose RenderNode#getUniqueId() as View#getUniqueDrawingId()
Test: atest ViewTest
Bug: 120282501
Change-Id: I797fbbc6ac40869fea4e29ce55697cfafd8bafef
2018-11-30 14:34:42 -05:00
chaviw
ff2e7d8f41 Reparent DisplayContent layers to SurfaceControl for ActivityView
With the current implementation, when an ActivityView is created, it creates
a new Display in both DisplayManager and SurfaceFlinger. Then it attaches the
SurfaceView's surface to the Display so the content generated for the second
display renders into the SurfaceView. However, this is inefficient since it
requires the rendered content to get copied over.

With this change, the ActivityView creates a VirtualDisplay but also creates
a new SurfaceControl. It then notifies WindowManager so WM can instead
reparent the windows that represent the new VirtualDispay to be a child of
the SurfaceControl passed in. The SurfaceControl passed in is a child of the
SurfaceView's SC so the content in the new VirtualDisplay will just
automatically render onto the main display without having to copy.

The SF hierarchy will have the VirtualDisplay's surfaces as children of the
SurfaceView, but the WM will still represent the VirtualDisplay as a second
display.

Test: Run app with ActivityView and launch Activity in AV
Change-Id: I21c9bb189b6c12b0d98c67c8e68f53c621a4a802
Fixes: 111440225
2018-11-30 10:48:28 -08:00
Issei Suzuki
26fc2c9e46 Stop the window manager acquiring a sleep token in dozing state.
This logic is not necessary anymore, and makes transition of the
windows manager flaky.

Bug: 119217735
Test: atest CtsActivityManagerDeviceTestCases:KeyguardTransitionTests
Change-Id: I953b40737f6673b83d27b096dd1f8e81b0cc6e46
2018-11-30 16:28:07 +01:00
Hyundo Moon
9a908db9f4 Rename KeyEvent.isMediaKey() to isMediaSessionKey()
Since not all KEYCODE_MEDIA_* keycodes return true in isMediaKey(),
the naming can give confusion. This CL renames the method to
isMediaSessionKey() and revises its Javadoc.

Bug: 119789707
Test: make -j
Change-Id: I36786ccf5606977e6d971c13d77d950356561bda
2018-11-30 13:54:32 +09:00
Fan Zhang
b36ba90475 Fix a NPE in ViewRootImpl
Fixes: 120229477
Test: make RunSettingsRoboTests -j40
Change-Id: I82f6c5fe5f553399c368bf30eef73b2d7f60d046
2018-11-29 13:45:05 -08:00
Jorim Jaggi
9a94afc6ca Merge "A brave new world for window insets (1/n)" 2018-11-29 17:14:15 +00:00
TreeHugger Robot
636be16176 Merge "Made View.setLeftTopRightBottom() public" 2018-11-29 16:32:22 +00:00
Andrey Kulikov
6ee8379dc0 Made View.setLeftTopRightBottom() public
It will allow to call this method in AndroidX Transition without reflection.
ChangeBounds#BOTTOM_RIGHT_ONLY_PROPERTY,POSITION_PROPERTY are restricted now as well as developers can just use setLeftTopRightBottom method instead (it was used as a performance optimization in third-party transitions backport)

Bug: 117521189
Bug: 117521197
Bug: 117521053
Test: new test added for the method
Change-Id: I0a29bc8cf0b3357e49f6be14270993a21a6dfeee
2018-11-29 14:44:29 +00:00
Jorim Jaggi
f96c90ac6c A brave new world for window insets (1/n)
This CL starts a journey to discover a brave new inset world. The
path to get us there may be rocky, but it's going to be rocky.

One of the main pledges of the new API is that an app can retrieve
what is causing a certain inset easily. For that, we need to
dispatch metadata who is causing what inset, such that we can query
it from the client side.

Furthermore, the client will be able to manipulate insets directly,
but also listen to animation changes. We don't want to go through
window manager for that, thus, there needs to be a local codepath
from (global window state -> WindowInsets).

Because we have these two requirements, we dispatch the relevant
global window state for insets, represented by InsetsState, and
dispatch it to the client. On the client side we take the frame
and the InsetsState and generate WindowInsets out of it.

Bug: 118118435
Test: InsetsSourceTest, InsetsStateTest, InsetsSourceProviderTest,
InsetsStateControllerTest
Change-Id: I2bfe9dda376512916261823fc2ee35cbedeb6731
2018-11-29 13:37:43 +01:00
Jackal Guo
198a262477 Get long press timeout directly
GestureDetector is preloaded by Zygote so the value of constant
would be init at early stage of boot. Since the value needs to
change dynamically, get timeout directly. Bedides, keeping get
the current value from core setting instead of setting provider
directly to reduce disk I/O.

Bug: 112929201
Test: a11y CTS & unit test
Change-Id: Iaaad801baabab90732dabbf17399dee2c0eec04b
2018-11-29 18:56:16 +08:00
Vishnu Nair
e86bd98a8b WM: Removes setSize from buffer-less surfaces
- Make a better distinction between surface bounds and buffer size by renaming setSize to
  setBufferSize and removing setSize for all buffer-less surfaces.
- Adds an error check in SurfaceControl to ensure buffer size is only set for buffer-less surfaces.
- Updates color fade surface to use passed in transaction object.

Bug:114413815
Test: go/wm-smoke
Test: atest FrameworksServicesTests:DimmerTests
Test: atest FrameworksServicesTests:SurfaceAnimatorTest
Change-Id: I88bd1452d6b3b3009e73e26986027d6a5a9efebc
2018-11-28 14:24:03 -08:00
Rob Carr
d5b4a58de5 Merge changes from topic "sfinput4"
* changes:
  ScreenMagnifier: Track SurfaceFlinger Input
  Forward SurfaceInsets to InputWindowInfo
  Track native changes: Rework InputApplicationInfo
  Replace InputWindowInfo#inputChannel with an IBinder token.
  Fix name for canReceiveTouchInput
  Fix pointer capture
  Cleanup Input left-overs.
  Port other InputWindowHandles to input surfaces.
  Port InputConsumerImpl to SurfaceFlinger input.
  Pass InputWindowInfo to SurfaceFlinger.
2018-11-28 20:35:10 +00:00
TreeHugger Robot
de6fe070b0 Merge "Initial buffering of Content Capture events." 2018-11-28 17:13:00 +00:00
Andrey Kulikov
eefd525641 Made ViewGroup.suppressLayout/isLayoutSuppressed public
It will allows the usage of this methods in AndroidX Transitions without reflection.

Bug: 117520180
Test: new cts tests for the methods added
Change-Id: Idf26d4b5c9fd2bb975e5a86dd46bd631c326b861
2018-11-28 16:32:20 +00:00
TreeHugger Robot
6f4e271922 Merge "Add displayId for WMS override pending transition APIs." 2018-11-28 12:02:33 +00:00
TreeHugger Robot
18439804f4 Merge "Support hasNavigationBar per display(1/2)" 2018-11-28 11:42:24 +00:00
Charles Chen
ea6e7f0401 Support hasNavigationBar per display(1/2)
This change is to support Auto case.
Auto may need to support displays without navigation bar by default,
because the display may be far away from driver.
Note: currently, hasNavigationBar is global since it's from config.
  In future patches, it will also check hasSystemDecorations() on
  secondary display.
TODO: We may find a way to make OEMs set hasNavigationBar() for each
  display.

Fixes: 119584629
Test: atest WmTests
Test: atest InputMethodManagerServiceTests
Test: atest SystemUiTests
Change-Id: I427f8ad1f3da644a2bf79ee5b777830378515348
2018-11-28 15:22:44 +08:00
Robert Carr
fcc0852558 Forward SurfaceInsets to InputWindowInfo
So that SurfaceFlinger can set the appropriate frame. See
frameworks/native commit and InputWindow.h for detailed
discussion.

Test: Manual
Bug: 80101428
Bug: 113136004
Bug: 111440400
Change-Id: I5df12fa3f90335f2045ee7107d3b1242ff0d00c5
2018-11-27 18:06:36 -08:00
Robert Carr
0bcbe6442d Track native changes: Rework InputApplicationInfo
First we move it inside of InputWindowInfo instead of InputWindowHandle
so it is part of the data sent across binder. Second we give it a persistent
identity of an IBinder token and use this for comparisons.

Bug: 80101428
Bug: 113136004
Bug: 111440400
Test: EndToEndNativeInputTest. Existing tests pass.
Change-Id: Id89a40e66887d834020f8e645fd1fb48adb7ee2e
2018-11-27 18:06:36 -08:00
Robert Carr
eadae82b55 Replace InputWindowInfo#inputChannel with an IBinder token.
The IBinder token is now being used as the UUID for InputWindows.
We can pass it around without the channel to avoid unnecessary FD
parcelling, duping, and other juggling.

Test: Existing tests pass.
Bug: 80101428
Bug: 113136004
Bug: 111440400
Change-Id: I8eba3fa05f249b7dfcb5c3d9817241cbfe9ab76c
2018-11-27 18:06:36 -08:00
Felipe Leme
b18e3179c2 Initial buffering of Content Capture events.
IntelligenceManager must buffer ContentCapture events and send them to the
service in a batch, and this is the initial implementation of such batch:
it's just batching a pre-defined number of events, without any further
optimization (like flushing after x ms).

Test: manual verification

Bug: 111276913
Bug: 119220549

Change-Id: I96a4708fd3fcfd3098a0894a3ae3e967804cf4e6
2018-11-27 17:24:23 -08:00
TreeHugger Robot
e3a6d9450a Merge "Add "dictionary" entity type" 2018-11-27 21:51:45 +00:00
Abodunrinwa Toki
f14f2b63dc Merge "Do not linkify text with RLO/LRO characters." 2018-11-27 20:19:35 +00:00