Commit Graph

12418 Commits

Author SHA1 Message Date
TreeHugger Robot
1f24ccf2f6 Merge changes from topic "display_policy"
* changes:
  DisplayEventDispatcher: add DISPLAY_EVENT_CONFIG_CHANGED
  SurfaceControl: add setAllowedDisplayConfigs
2019-02-27 00:01:45 +00:00
Felipe Leme
f6b8a28426 Merge "Added ContentCaptureEvents for session resumed and paused." 2019-02-26 16:28:49 +00:00
TreeHugger Robot
7a13eb215c Merge "Support title_with_entity and title_without_entity" 2019-02-26 14:25:26 +00:00
Tony Mak
ac9b4d8d2e Support title_with_entity and title_without_entity
1. Pull out TextClassifierImpl.LabeledIntent to LabeledIntent.
2. LabeledIntent.resolves takes a TitleChooser object, which
   allow custom logic like "if the resolved app is a browser, use
   title_with_entity. Otherwise, use title_without_entity".
   If TitleChooser is not set, the default behavior is to use
   title_with_entity if provided, use title_without_entity otherwise.
3. For classifyText, we use a TitleChooser that always return
   title_without_entity. So no behavior change in classifyText.
4. If custom titleChooser returns null, fallback to use the default
   titleChooser.

BUG: 124428508
BUG: 123946471

Test: atest framework/base/core/tests/coretests/src/android/view/textclassifier/

Change-Id: I7299c40ffc57deb9484d493f8c62b220a5a1e7d8
2019-02-26 12:00:04 +00:00
Nathaniel R. Lewis
9aff88bdfd Merge "Fixes for touchpad capture" am: c5ea003bbb am: 6f72ed8b27
am: 01aa9e8157

Change-Id: I2bc16fb5a8fb0eaf5865a5f675d7d4ce978c09f2
2019-02-25 21:23:52 -08:00
Nathaniel R. Lewis
01aa9e8157 Merge "Fixes for touchpad capture" am: c5ea003bbb
am: 6f72ed8b27

Change-Id: I07e2ce2f93a8ed920879759873af4f0f40191b87
2019-02-25 20:27:54 -08:00
Felipe Leme
a820910468 Added DeviceConfig properties for Augmented Autofill service timeouts.
Test: manual verification
Bug: 123100811

Change-Id: I82749b4cea5fe90998efa0798fb6b032a8470086
2019-02-25 16:20:18 -08:00
Rob Carr
dbd04bb64b Merge "Exclude secure layers from most screenshots taken by the system server." 2019-02-25 23:57:26 +00:00
TreeHugger Robot
5daa6d5c67 Merge "Added a DeviceConfig property for Content Capture idle timeout to unbind from system server." 2019-02-25 21:10:50 +00:00
TreeHugger Robot
3d66fc9d6b Merge "Trigger augmented autofill when the app is not important for autofill." 2019-02-25 20:34:44 +00:00
TreeHugger Robot
4a79c63722 Merge changes from topic "view_tree_batch"
* changes:
  Changed Content Catpure workflow so it notifies when multiple changes are made.
  Improved how Content Capture events are flushed when activity is resumed / paused.
2019-02-25 19:22:05 +00:00
TreeHugger Robot
3d61f89275 Merge "Address API council feedback" 2019-02-25 19:21:52 +00:00
TreeHugger Robot
2451425051 Merge "Linkify CLASSIFICATION_AMBIGUOUS_GESTURE" 2019-02-25 17:56:08 +00:00
Felipe Leme
e764fa2892 Added a DeviceConfig property for Content Capture idle timeout to unbind from system server.
Test: manual verification
Bug: 111276913

Change-Id: I3c8f0ffc5fbadfc033ef6574cab7e0ec1419b38e
2019-02-25 09:42:14 -08:00
Siarhei Vishniakou
6e1cdb635f Linkify CLASSIFICATION_AMBIGUOUS_GESTURE
Add a doc link to MotionEvent#CLASSIFICATION_AMBIGUOUS_GESTURE, to make
it easier for readers to cross-reference documentation.

Bug: 125800452
Test: m doc-comment-check-docs
Change-Id: Ic7a5a14d30c0cc3aa57f8bcd6af34e2e684f0437
2019-02-23 22:15:52 -06:00
TreeHugger Robot
370b0da014 Merge "Fix View#performHapticFeedback() can block UI thread" 2019-02-23 03:39:53 +00:00
Felipe Leme
b0da18f32e Added ContentCaptureEvents for session resumed and paused.
Test: atest CtsContentCaptureServiceTestCases # which was updated to listen to the new events
Test: m update-api

Fixes: 125395044

Change-Id: Ie1ed5d9badaa64ff0921226a1c08bd5e3cbf07d8
2019-02-22 18:10:22 -08:00
Ady Abraham
a5a21f70e1 DisplayEventDispatcher: add DISPLAY_EVENT_CONFIG_CHANGED
Add a new event for display configuration change. This event
will be sent by SF anytime it changes the display config.

Test: Generate DISPLAY_EVENT_CONFIG_CHANGED and observe the log
Bug: 122905403
Change-Id: Ifa473a34d7b313501e5e4e8a67186fb82754fdcd
2019-02-22 17:54:06 -08:00
Nathaniel R. Lewis
6f72ed8b27 Merge "Fixes for touchpad capture"
am: c5ea003bbb

Change-Id: I27c8f1f58d7824fc57b273d36a01135d78e2b4ec
2019-02-22 17:50:31 -08:00
Treehugger Robot
c5ea003bbb Merge "Fixes for touchpad capture" 2019-02-23 01:27:07 +00:00
Qasid Sadiq
62b67c26c9 Merge "Revert "Fix a11y cache correctness bug"" into pi-dev am: 987ec033ab
am: 24f953a6c2

Change-Id: I38d80cd355ebf044696848d1d4697521cd78183f
2019-02-22 17:23:08 -08:00
TreeHugger Robot
3f9eff103e Merge "Re-throw reflective exceptions" 2019-02-23 01:10:32 +00:00
Ady Abraham
6070ce1be3 SurfaceControl: add setAllowedDisplayConfigs
expose ISurfaceComposer::setAllowedDisplayConfigs to SurfaceControl.
This API is expected to be called by DisplayManager depends on the
current policy in place. Once setAllowedDisplayConfigs is called,
SF can only set a new display config if it is part of the allowed
configurations list.

Test: call setAllowedDisplayConfigs() from SurfaceControl and
observe config change.
Bug: 122905403
Change-Id: I7f8cc09dbec352701f5dcf2595bee66b8380bc00
2019-02-22 17:04:03 -08:00
Qasid Sadiq
24f953a6c2 Merge "Revert "Fix a11y cache correctness bug"" into pi-dev
am: 987ec033ab

Change-Id: I00d421256cbda478bf413a2195f14787d09d133c
2019-02-22 15:55:50 -08:00
Ashley Rose
c74a113d28 Re-throw reflective exceptions
Test: atest GeneratedInspectionCompanionProviderTest
Fixes: 125800739
Change-Id: Ifea2c3dc303e255bc704ee34168e250e649519b5
2019-02-22 18:24:18 -05:00
Robert Carr
5c52b139f6 Exclude secure layers from most screenshots taken by the system server.
In pre-P versions of Android, it was allowed to screenshot secure layers if the
buffer queue producer which was the target of the screenshot was owned by
the system (in this case SurfaceFlinger). This really was a synonym for:
The screen rotation animation was allowed to capture secure layers, but the other
code paths weren't. In O we mistakenly changed this check to always allow the system server
to capture secure layers via the captureScreen path (the captureLayers path used for
TaskSnapshots was unaffected). This can result in data leakage in cases where the
system server takes screenshots on behalf of other parts of the system (e.g. for
the assistant). To mitigate this we provide an explicit switch for the system server
to specify whether it wishes to capture Secure layers. While this is dangerous, I think
it is less dangerous than the previous implicit switch of capturing secure layers based on which
type of BufferQueue was passed in. The flag defaults to not capturing secure layers
and we set it to true in the one place we need it (for the screen rotation animation).
Non privileged clients can still not capture secure layers at all directly.

Test: TransactionTest.cpp#SetFlagsSecureEUidSystem
Bug: 120610669
Change-Id: I9d32c5ac2b005059be9f464859a415167d9ddbd4
2019-02-22 15:12:47 -08:00
Felipe Leme
544b39cbd2 Changed Content Catpure workflow so it notifies when multiple changes are made.
Prior to this change, it sent a pair TYPE_INITIAL_VIEW_TREE_APPEARING and
TYPE_INITIAL_VIEW_TREE_APPEARED after the initial layout, then it would send invididual events for
the views appeared / disappeared.

This change improves the workflow by also sending this pair of events after each change, which lets
the service know that a bunch of changes were made at the same layout pass.

Test: atest CtsContentCaptureServiceTestCases # which was updated to listen to the new events
Test: m update-api

Bug: 125395044

Change-Id: Ied9def9c95dd0f7711f59bccb2cc89a766fdc36b
2019-02-22 14:57:51 -08:00
John Reck
e57475e6c9 Address API council feedback
Bug: 125027187
Bug: 125026102
Bug: 125026678
Bug: 125026234
Bug: 125027586
Bug: 125026476
Bug: 125026103
Bug: 125026237
Bug: 125027248
Bug: 125026475
Bug: 125027487
Test: RenderNodeTests
Change-Id: Ic63ea7a3cfe359a7dff0c1b46e534e499f7e928b
2019-02-22 14:24:28 -08:00
Felipe Leme
d58c1eaada Improved how Content Capture events are flushed when activity is resumed / paused.
We were flushing right after the activity resumed, but the relevant events (views added / removed)
were not generated yet, which made such flushes useless.

This CL changes the workflow to flush them after the ViewRoot finishes doing its work.

Test: atest CtsContentCaptureServiceTestCases

Bug: 125395044
Bug: 122315042

Change-Id: I05bf27069b00c285643b2d23ad6708a6ad7bc8f3
2019-02-22 12:14:36 -08:00
Chavi Weingarten
a471767911 Merge "Wait for input windows to be set before proceeding with inject for tests" 2019-02-22 17:34:43 +00:00
Wale Ogunwale
c6506833e3 Merge "Added some TestApi that are already used by CTS" 2019-02-22 12:51:57 +00:00
TreeHugger Robot
add90457d5 Merge "Language detection fixes." 2019-02-22 11:20:28 +00:00
Qasid Ahmad Sadiq
4d70022b88 Revert "Fix a11y cache correctness bug"
This fix introduced a painful crash that ends up disabling accessibility
services for certain users.
This happens when a client of AccessibilityCache tries to add a node, with the same id as a node previously in the cache, but fewer children, where the removed child is not in the cache.
This is because, when children are removed, and a the node is updated, the cache tries to clear the child trees. But if the child is not in the cache, the cache clears the whole tree. Every node is recycled.
Then the original node being replaced is attempted to be recycled again, and voila crash.

The fix also didn't fix the original issue based on the discussion in
b/114133438.

The risk for this is pretty low, since nothing was built on top of this.

This reverts commit 2f69c16c3d.
Bug: 124676705
Test: Tested to see if above usecase still happens.

Change-Id: I8a39698c4532a1613ba47e1c6ca70201cd496212
2019-02-21 21:07:12 -08:00
Arthur Hung
a4c520694f Fix View#performHapticFeedback() can block UI thread
Currently, IWindowSession#performHapticFeedback() would first lookup
the WindowState via IWindow token. That would also hold the WMS lock,
so if some function like relayout window is still hold WMS lock,
it may block the function.

Use uid and package name from Session that they already restored.

Bug: 62330939
Test: Open app with autofill edit, type with IME.
Change-Id: I359c106d213b87aa8afee48b0f1ad70011970eab
2019-02-22 12:43:55 +08:00
Wale Ogunwale
691af68a3c Added some TestApi that are already used by CTS
Allows us to remove the use of private platform API from CTS.

Bug: 124134247
Test: builds
Change-Id: Iceb81ff7c9385e877d2612fbb7b506245d116928
2019-02-21 20:15:56 -08:00
TreeHugger Robot
35047419e3 Merge "Make ViewRootImpl#destroyHardwareResources thread-safe" 2019-02-22 02:15:40 +00:00
Felipe Leme
9873510af3 Merge "Refactored Autofill properties that are optimized on application level." 2019-02-22 01:02:46 +00:00
chaviw
504715c505 Wait for input windows to be set before proceeding with inject for tests
Added a new test method to allow the client to wait until input windows
have been propagated to InputFlinger before proceeding to inject input.
This ensures that the inject is called when all windows have been set
up.

Bug: 123041491
Test: ListPopupWindowTest, PopupMenuTest
Change-Id: I42abfa4ea23a14ae1a003c6ee8976cc466f1d5af
2019-02-21 16:51:49 -08:00
Xin Li
b455c3a7f3 DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master
Bug: 120848293
Change-Id: I2f9a524f2ba552de3f62e343075cf0abf400bbae
2019-02-21 16:02:06 -08:00
Chavi Weingarten
263a4d08e4 Merge "Add synchronous transaction to wait for setInputWindow to complete (5/n)" 2019-02-21 23:33:44 +00:00
John Reck
68634d3087 Make ViewRootImpl#destroyHardwareResources thread-safe
Fixes: 25148144
Test: none
Change-Id: Ie719c5dd8bd7424c9dd2858d338c6cfc5c032d4f
2019-02-21 12:45:02 -08:00
Felipe Leme
a7de402a17 Trigger augmented autofill when the app is not important for autofill.
Test: atest AugmentedLoginNotImportantForAutofillActivityTest
      atest CtsAutoFillServiceTestCases # to make sure it didn't break anything

Bug: 123099842

Change-Id: I628c82cef0a87892ebf78059ffbe35998e8ef979
2019-02-21 10:49:45 -08:00
Felipe Leme
a4f39cd150 Refactored Autofill properties that are optimized on application level.
Prior to this CL we were just caching whether the service supported compatibility mode for the app,
but now we're also caching the logging level and whether the app is whitelisted for augmented
autofill - although right now the augmented autofill info is not used, it will allow us to trigger
it in the scenarios where autofill is disabled for the app.

Bug: 123099842
Bug: 123100824
Test: atest CtsAutoFillServiceTestCases:AugmentedLoginActivityTest \
            CtsAutoFillServiceTestCases:VirtualContainerActivityCompatModeTest
      atest CtsAutoFillServiceTestCases # sanity check, although still flaky

Change-Id: Iaf8ea6634ca94e5e61131890ec17c96c2fbb329a
2019-02-21 10:44:39 -08:00
Chavi Weingarten
d282641a1d Merge "Make WindowContainer surfaces container layers by default." 2019-02-21 18:03:14 +00:00
Abodunrinwa Toki
25f7fdc19a Language detection fixes.
- Load foreign language detection score threshold from model
- Pass resource config language to native code instead of Locale.getDefault()
- Avoid nullpointer exception in ExtrasUtils
- Don't set action_intents extras if empty

Bug: 124791964
Bug: 124794807
Test: atest core/tests/coretests/src/android/view/textclassifier
Change-Id: I2593d7cb4d364d8bf26239ed59b7212f79ddc350
2019-02-21 14:59:00 +00:00
Felipe Leme
326f15a392 Optimized Content Capture workflow by caching some state at the application level.
Content Capture for an activity and/or package is only available when the Content Capture service
explicitly whitelists it. As the whitelist is kept at system-server level, it's better to fetch that
info when the application is started and cache it locally, so we can optimize the
ContentCaptureManager APIs to return quickly when it's disabled.

This CL also caches other values such as the buffer parameters.

Test: atest CtsContentCaptureServiceTestCases

Bug: 120494182
Bug: 121202151

Change-Id: I9d5211bca496ffa85ba9efc2a7bb32411834b787
2019-02-20 18:44:05 -08:00
TreeHugger Robot
02aca1058f Merge "Initial implementation of AutofillManager.setAugmentedAutofillWhitelist()" 2019-02-21 00:01:56 +00:00
TreeHugger Robot
6944910037 Merge "Add CompositionSamplingListener" 2019-02-20 23:44:26 +00:00
Chavi Weingarten
6ef9cc6ac1 Make WindowContainer surfaces container layers by default.
This reverts commit f6ef18334b.

Reason for revert: ag/6227549 fixes underlying issue

Change-Id: Id1456529ef0009f8e28575ef591d9559c43db4a5
Fixes: 122561221
Test: go/wm-smoke
2019-02-20 15:33:30 -08:00
chaviw
319cd07860 Add synchronous transaction to wait for setInputWindow to complete (5/n)
Added syncInputWindows method to JNI and SurfaceControl.Transaction

This enables the caller to request SF to wait until input windows have
been synced with InputDispatcher.

Bug: 123041491
Test: builds, runs
Change-Id: I2ddaa3f43eded2fb117cc2850ee7c8a20b2b63ec
2019-02-20 14:09:30 -08:00