Commit Graph

11869 Commits

Author SHA1 Message Date
TreeHugger Robot
e6fd92b9f8 Merge "Improved ContentCapture capture by flushing its buffer after some time idle." 2018-12-13 19:40:35 +00:00
TreeHugger Robot
8c93e2b28b Merge "Introduce EXTRA_FROM_TEXT_CLASSIFIER" 2018-12-13 02:10:46 +00:00
Tony Mak
c5a4612ffa Introduce EXTRA_FROM_TEXT_CLASSIFIER
To indicate the intent is from text classifier, so apps can log
the traffic from text classifier.

Test: atest IntentFactoryTest
Test: atest TextClassifierTest
BUG: 120944241

Change-Id: I6584504a39c0db3c1de1eaab6915b26b30adadcd
2018-12-13 02:09:08 +00:00
TreeHugger Robot
d348897131 Merge "Add getAccessibilityWindowId system process API" 2018-12-12 23:57:09 +00:00
TreeHugger Robot
a44e66a504 Merge changes from topic "reference_time_tc"
* changes:
  Populate person and reference time, uses more than the last message in NAS
  Pass reference time / locales of messages to the model
2018-12-12 23:30:02 +00:00
TreeHugger Robot
f59189146c Merge "Add InputEvent Compatibility Processor" 2018-12-12 22:53:44 +00:00
Felipe Leme
4017b209f8 Improved ContentCapture capture by flushing its buffer after some time idle.
Right now the value is hardcoded to 5s, but it will be dynamically configurable.

Bug: 119220549
Test: manual verification
Test: atest CtsContentCaptureServiceTestCases

Change-Id: I230dee32d215d099a323499e55b4347e817907a0
2018-12-12 13:36:49 -08:00
Prabir Pradhan
3ce67d10fa Add InputEvent Compatibility Processor
Depending on the SDK version of applications, there may need to be
changes made to InputEvents for compatibility purposes. Here, we add a
InputEventCompatProcessor to refactor all compatibility adjustments to
InputEvents.

The compatibility processor is instantiated in ViewRootImpl using
reflection, where the class name of the processor is defined in
config.xml as `config_inputEventCompatProcessorClassName`. This allows
for overlays to change the compatibility processor that is used for the
build.

The processor has two methods for processing the InputEvent before and
after it is sent into the InputStages of the input pipeline in
ViewRootImpl. InputEvents that are changed by the processor are marked
with `FLAG_MODIFIED_FOR_COMPATIBILITY` so that they are sent back to the
processor before they are finished.

Bug: 119264233
Test: manual
Change-Id: Ie0dc4665cb677a7ab2cc627791a0f72cdfce1cde
2018-12-12 11:13:51 -08:00
Kevin DuBois
3ec307b262 Merge "DisplayManager: Add color sampling hardware query" 2018-12-12 15:27:01 +00:00
Adrian Roos
e77ff79fdb Merge "API: Clean up redundant and ineffective usages of SystemApi and TestApi" 2018-12-12 13:43:34 +00:00
Tony Mak
82fa8d9451 Pass reference time / locales of messages to the model
1. It is required to set Person object when constructing a Message object
   now. As it is very important to know whether the message is from
   local user or remote user. Introduced PERSON_USER_REMOTE if
   the caller just want a simple way to specify a remote user.

2. Use detectLanguages to detect the locale of the messages
   If the model finds the detected language is not something
   it supports, model may suppress smart reply.

3. Pass the reference time to the model. So model can resolve
   the absolute time from a relative date string like "tomorrow 6pm".

BUG: 120809869

Test: atest ActionsSuggestionsHelperTest.java
Test: atest ConversationActionsTest.java

Change-Id: Ie079848e9b3d9bb8800f7f95d73e289e831968f8
2018-12-12 21:32:35 +08:00
Jorim Jaggi
5e34c414cf Merge "A brave new world for window insets (4/n)" 2018-12-11 20:57:30 +00:00
Adrian Roos
66f859135b API: Clean up redundant and ineffective usages of SystemApi and TestApi
Everything that is marked SystemApi or TestApi, but not @hide is still
part of the public SDK, it is therefore not sound to have that combination.

In the future, specifing such a combination will be considered an error
to prevent inadvertently exposing SystemApi and TestApi as public API.

Bug: 115333477
Change-Id: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Test: METALAVA_PREPEND_ARGS="--error UnhiddenSystemApi" m checkapi
Exempt-From-Owner-Approval: API cleanup
2018-12-11 20:38:02 +01:00
TreeHugger Robot
1982ca78e3 Merge "Changed activity --intelligence option to --contentcapture" 2018-12-11 19:27:34 +00:00
Winson Chung
fb402f2c5e Merge "Ensure frame callback applied during scroll handling is applied." 2018-12-11 02:43:58 +00:00
Kevin DuBois
bf76b11bd2 DisplayManager: Add color sampling hardware query
Add calls to SurfaceControl JNI interface that allow
the DisplayManager to drive color histogram functionality.

Fixes: 112756444

Test: Boot
Test: additional test in 'atest FrameworksServicesTests:DisplayManagerServiceTest'
Change-Id: Ifa46dab53b09db62da79ad82e9687d9155ddc6da
2018-12-10 16:52:26 -08:00
Winson Chung
f213111bd3 Ensure frame callback applied during scroll handling is applied.
- By the time we call computeScroll(), the current frame's callback
  has already been consumed, which makes it impossible to apply
  surface updates with the current frame (in response to the scroll).
  Instead, we should only consume the frame callback after dispatching
  draw for the current frame (but before the window callbacks which
  may reset the frame callback).

Test: Update surface transforms in response to scroll, ensure that
      it is updated with the current frame

Change-Id: I52a640604ee15cf745c47fc0120b4844b67f35be
2018-12-10 16:11:28 -08:00
Jorim Jaggi
c8d60387a5 A brave new world for window insets (4/n)
Rework how new window insets are dispatched: Send it to the
controller, controller applies the local visibility overrides and
then dispatch it without doing a full layout.

Bug: 118118435
Change-Id: I0d3070d2c46c3af6236e98b858bed5b463da6053
2018-12-10 15:48:24 -08:00
TreeHugger Robot
2a91317acf Merge "Add calling package name to TC requests." 2018-12-10 22:12:53 +00:00
TreeHugger Robot
a5a81d2458 Merge "Add IMMS#showInputMethodPickerFromSystem." 2018-12-10 18:56:40 +00:00
Felipe Leme
b718e0301e Changed activity --intelligence option to --contentcapture
Test: adb shell dumpsys activity top --contentcapture
Bug: 111276913

Change-Id: Ie4986ba018b77ec5f03aa7fb4522b6b874ec7ebe
2018-12-10 09:58:37 -08:00
Abodunrinwa Toki
0f1389637d Add calling package name to TC requests.
- This is only set by the SystemTextClassifier.
- The system verifies that the package name is correct before
  passing the request to the TCS. Note that the system is the
  only direct client of the TCS.
- Sets package name to context.getOpPackageName(). See b/119921159
- Also adds an extra to a TextLink object.

Bug: 118690735
Bug: 119921159
Test: atest frameworks/base/core/tests/coretests/src/android/view/textclassifier
Change-Id: I1ac0fa421cd0f26e580a8e0768c3819a731bb471
2018-12-10 14:13:26 +00:00
Yuki Awano
ca4c57439d Add getAccessibilityWindowId system process API
- Add an API to get accessibility window id from window token. This API
  can be called only from a system process.

Bug: 119794051
Test: None
Change-Id: I37db50209efeb81f3e3502d84fd53fedec695f99
2018-12-10 13:36:56 +09:00
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
lumark
0b05f9e49d Add IMMS#showInputMethodPickerFromSystem.
Since the NavBar will be supported for multi-display, for
single session IME, it will be possible that IME switcher icon
will shown on external display.

Add IMMS#showInputMethodPickerFromSystem for system modules (i.e.
Settings or SystemUI) to pass displayId for creating right display
context, so that IME switcher dialog can shown on the display
correctly.

Also Add a TODO item for ACTION_SHOW_INPUT_METHOD_PICKER notification
that currently only support showing IME picker for default display,
this should support per display after supporting status bar per display.

Bug: 119933861
Fix: 120050928
Test: manual, verify IME switcher dialog can shown on external display
      when tapping IME switcher icon on external navbar.
Test: atest InputMethodManagerTest#testShowInputMethodPicker

Change-Id: Ic7d7c5a7ad8005a3fbd9d1c1b73e3c5a39a07001
2018-12-07 17:30:24 +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