Commit Graph

11901 Commits

Author SHA1 Message Date
Feng Cao
c5cd1325fc Merge "Fix augmented autofill window positioning to be right below the input field." 2018-12-21 18:57:13 +00:00
TreeHugger Robot
5f175e3d6f Merge "Move orientation request into hierarchy." 2018-12-21 16:52:05 +00:00
Jorim Jaggi
99dc47483c Merge "A brave new world for window insets (5/n)" 2018-12-21 14:00:45 +00:00
Jorim Jaggi
5bb571dc40 A brave new world for window insets (5/n)
Implement controlWindowInsetsAnimation

Based on the leashes we have on the client, and the insets the
client has requested, we are able to move the surfaces around
such that the resulting insets will match what the client
requested.

Bug: 118118435
Change-Id: I0616e53455a6544aaf374c1b0eb10e258aced21d
2018-12-21 13:05:30 +01:00
TreeHugger Robot
84cdbdfc13 Merge "Send logs to TextClassifier by calling onTextClassifierEvent in NAS" 2018-12-21 02:36:32 +00:00
Feng Cao
023b84c35f Fix augmented autofill window positioning to be right below the input field.
Test: manual verification

Bug: 120932071

Change-Id: If8fc3b78fd6240bca54035b139f44e56ddb996dc
2018-12-20 17:25:57 -08:00
Garfield Tan
90b042819f Move orientation request into hierarchy.
This CL also removes a hidden method in IWindowManager that's only used
inside of WM right now.

Also wire up Task level logic.

Bug: 113252523
Test: Manual test that app requested orientation still rotates the
display and WmTests.
Change-Id: I7c5046e9beaea79de4ec471eabc792e3593583a2
2018-12-20 13:39:00 -08:00
Felipe Leme
87a9dc9a97 Moved createContentCaptureSession() to ContentCaptureSession.
Such move will allow nested sessions. For example, WebView could create a
new session for the main page, then child sessions for IFRAMEs contained on it.

This CL changes the API and provides an initial implementation, although it's
not quite ready yet - it only allows 1 level of children (from the activity
session), but the full implementation is coming soom to a movie theather near
you...

Bug: 121033016
Bug: 117944706

Test: atest CtsContentCaptureServiceTestCases

Change-Id: I86156bb3b8a2c08cb00b9518599eb6d67fbf77c2
2018-12-20 08:59:48 -08:00
Felipe Leme
fc24beab3e Changed ContentCaptureService to receive one event at time.
The initial implementation was using a batch the events to optimize the
performance, but that can be optimize behind the scenes (i.e., we can still
send the batches in the binder, but deliver them one by one).

This change not only makes it easier for the service to use the API, but it
paves the way to implement multiple sessions (so we can buffer children events
while the parent session is not completely started yet).

Bug: 121033016
Bug: 117944706
Bug: 121051220

Test: atest CtsContentCaptureServiceTestCases

Change-Id: I713ceb998bd81733255fd3ef8d0b8d7a3fcac20c
2018-12-19 16:36:19 -08:00
Felipe Leme
b63e0ddc84 Split ContentCaptureSession in 2 classes.
This is just a refactoring for now, but it paves the way to support children
sessions.

Bug: 121042846
Bug: 117944706

Test: atest CtsContentCaptureServiceTestCases

Change-Id: I64bb5562dcfd4a9f0f69bb13009e4cf47a4f3b37
2018-12-19 16:35:59 -08:00
Dieter Hsu
3541a64436 Merge "Refine API javadoc: onTouchExplorationHoverEvent" 2018-12-19 00:51:42 +00:00
Gus Prevas
1386358988 Merge "Fixes layout of icons in notification header." 2018-12-18 22:11:33 +00:00
Felipe Leme
b9687849bb Optimizes the Content Capture workflow by calling the service directly.
Initially, the ContentCaptureManager (in the app) was calling the
IContentCaptureManager (on system server) for everything, even to pass the
list of captured events, which caused 2 IPCs for each batch of events (i.e.,
from app to system_server, then from system_service to service).

This CL optimizes the workflow by getting rid of the "middle man" and sending
the events from the app to the service directly, which the system_server only
calling the service to notify when the view starts and finishes (and passing
the UID in the former so the servier can validate the sendEvents() calls).

Bug: 119220549
Test: atest CtsContentCaptureServiceTestCases

Change-Id: I6c08dccf755605320ac37cbc9424132e5455a594
2018-12-18 10:03:37 -08:00
TreeHugger Robot
74f1ce3fc1 Merge "Changed verbosity of log message shown when context is not autofillable." 2018-12-17 21:46:12 +00:00
Gus Prevas
8771761757 Fixes layout of icons in notification header.
This change resolves a discrepancy between onMeasure() and onLayout() in
NotificationHeaderView.  Icons were measured with their defined
margins in order to figure out how much to truncate the header text, but
during layout potentially multiple icons used the container's end
padding as their end margin (and their start margin was ignored).

Change-Id: I513efe2723fc78dd81bbe07aa40a3ed5fd1182d1
Fixes: 120893622
Test: manual
2018-12-17 14:00:12 -05:00
Felipe Leme
261e75fca6 Changed verbosity of log message shown when context is not autofillable.
Test: echo 'In TreeHugger we trust!'
Bug: 121063774

Change-Id: If2c6b3a93563e55a1d41d5ff294018ee2c19bbf3
2018-12-17 10:16:13 -08:00
TreeHugger Robot
56208f49dc Merge "Another round of changes on Content Capture." 2018-12-17 17:59:40 +00:00
Tiger Huang
860ed7c688 Merge "Make per-display focus optional (1/2)" 2018-12-16 07:15:30 +00:00
Tiger Huang
51c5a1d042 Make per-display focus optional (1/2)
In general cases, we don't have multiple input methods simultaneously.
So that it may not make sense to have multiple focused window in the
system. Especially when there are multiple blinking cursors of input
boxes on different displays, the user may not be able to know which
input box can receive key events. In these cases, we let the system
has only one focused window.

In some cases, there can be multiple input methods simultaneously (one
for each display). To enable multiple users to interact with the
corresponding displays at the same time, we should let the system have
per-display focused window in these cases.

This CL makes per-display focus optional, and also reverts ag/5312657

Fix: 120241480
Fix: 120790099
Test: atest ActivityManagerMultiDisplayTests \
            CtsWindowManagerDeviceTestCases \
            WmTests

Change-Id: Ie030eed523599b217060887171710692d050e5d8
2018-12-15 16:30:14 +08:00
Felipe Leme
aa5088ede6 Another round of changes on Content Capture.
- Get rid of activity-level events.
- Renamed InteractionSessionId and InteractionContext to
  ContentCaptureSessionId and ContentCaptureContext (and made them public)
- Create the explicit concept of ContentCaptureSesssion (and moved notification
  APIs to it).
- Added APIs to let apps create new sessions (not implemented yet).
- Added APIs to remove user data based on some context properties (like URI).

The reasoning behind this change is to let app developers explicitly associate
the captured content with some app-level domain (and also let the app ask the
service to clear such data at user's request). For example, a browser app
(and WebView) can use these APIs to associate the content capture events with
the URL being rendered.

Bug: 117944706
Fixes: 121034139

Test: atest CtsContentCaptureServiceTestCases
Test: m update-api && m

Change-Id: I7841da303b6a39c825651b03a07e3081fbd0bdf5
2018-12-14 18:02:24 -08:00
Jorim Jaggi
e71551c45d Merge "Trace dispatchApplyInsets" 2018-12-15 01:21:01 +00:00
Tony Mak
e94e0787db Send logs to TextClassifier by calling onTextClassifierEvent in NAS
Whenever NAS called TextClassifier.suggestConversationActions,
it will cache the notification key to result id mapping.
The result id will be used to log subsequent events related to
these suggestions.

This change should allow us to collect CTR.
TODO: Log the coverage, i.e. among all suggestConversationActions
request, how many of them actually contains some suggestions.

BUG: 120803809
Test: atest SmartActionHelperTest
Test: Manual, add a log in TextClassifierImpl.onTextClassifierEvent
1. Send a message notification
2. Expand the notification, observe event is logged.
4. Clicked on one of the replies, observe event is logged.
5. Send another message to myself
6. Inline reply it, observe event is logged.

Change-Id: I590d9bfcdb7ae7ee7976740d71bf7f1204683939
2018-12-15 08:04:15 +08:00
TreeHugger Robot
b4ee870eca Merge "Hides audibly alerted icon after 30 seconds." 2018-12-14 21:58:34 +00:00
Adrian Roos
19cc34233c Merge "KeyguardDisableHandler: make properly user aware" 2018-12-14 18:42:56 +00:00
Gus Prevas
7306b90554 Hides audibly alerted icon after 30 seconds.
Bug: 116622974
Test: atest SystemUITests FrameworksUiServicesTests
Change-Id: I9074e46b5e557c7c65f601ee118dfa7e3751652a
2018-12-14 10:07:48 -05:00
Abodunrinwa Toki
37ccedcc12 Introduce TextClassifierEvent
This serves as a general TextClassifier event object for reporting
any textclassifier event and will replace the SelectionEvent class.

Example:

// Smart link clicked.
new TextClassifierEvent.Builder(CATEGORY_LINKIFY, TYPE_LINK_CLICKED)
  .setEventContext(new TextClassificationContext.Builder(
      pkgname, WIDGET_TYPE_TEXTVIEW)
      .build())
  .setEntityType(TextClassifier.EMAIL)
  .setResultId(textclassification.getId())
  .setEventIndex(0)
  .setEventTime(now)
  .setStart(0)
  .setEnd(3)
  .build();

Bug: 120837847
Test: See related cts CL
Test: atest cts/tests/tests/view/src/android/view/textclassifier/cts \
      frameworks/base/core/tests/coretests/src/android/view/textclassifier
Change-Id: Ifd84a45fc5c46ffdb200dcb9600f6a470ce792bb
2018-12-14 15:49:01 +08:00
Tony Mak
c4359bf17f Add id to ConversationActions and conversationId to its Request
ID is used as session id when logging.
Conversation id is used for TextClassifier to keep track of ongoing
conversation.

BUG: 120803809
Test: atest TextClassifierTest.java
Test: atest ConversationActionsTest.java

Change-Id: Ifa2e25005efa9b16e480d9a06b376d726ea6d6d3
2018-12-14 15:49:01 +08:00
Vishnu Nair
f85dddfd0c Merge "Pip: Use raw input coordiates when calculating pip movement offsets" 2018-12-14 01:04:53 +00:00
TreeHugger Robot
e6fd92b9f8 Merge "Improved ContentCapture capture by flushing its buffer after some time idle." 2018-12-13 19:40:35 +00:00
Vishnu Nair
1899955c1c Pip: Use raw input coordiates when calculating pip movement offsets
* Recently the pip_input_consumer changed to move with the pinned stack bounds.
* Change the touch logic to use raw input coordinates so that we do not have to
  account for the pip_input_consumer position.
* Add workaround for velocity tracker to support moving input frame.
* Use getActionMasked instead of getAction for MotionEvents. This fixes b/120942892.

Test: Test moving pip window in YouTube and Chrome
Bug: 120663157, 120942892
Change-Id: I0a8b2eea7ee5930a6651ad037eaa0f898fe8635d
2018-12-13 09:28:11 -08: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
Dieter Hsu
4ee79ff99e Refine API javadoc: onTouchExplorationHoverEvent
Bug: 35702820
Fixes: 120488378
Test: make docs

Change-Id: Id04a31bd9c89e423706ce0256ed668eebd12bd47
2018-12-12 11:48:46 +08:00
Jorim Jaggi
5925509ab9 Trace dispatchApplyInsets
Test: Take trace
Change-Id: Iec38b20c0b9c65efc3f227803c30254ed4572651
2018-12-11 13:41:43 -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