Commit Graph

12390 Commits

Author SHA1 Message Date
TreeHugger Robot
370b0da014 Merge "Fix View#performHapticFeedback() can block UI thread" 2019-02-23 03:39:53 +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
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
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
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
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
TreeHugger Robot
1671308c29 Merge "API adjustments for Picture serialization discussion" 2019-02-20 18:00:28 +00:00
Mathew Inwood
f906a38eed Merge "Move the right method to max-sdk-o list." 2019-02-20 17:43:42 +00:00
TreeHugger Robot
4cac1f42f0 Merge "Move TextClassifier.getLocalTextClassifier() API." 2019-02-20 16:40:21 +00:00
TreeHugger Robot
f7612ac846 Merge "Changes on the ContentCaptureContext APIs." 2019-02-20 15:51:59 +00:00
Alan Viverette
db9c27cb7a Merge "Public API for statically accessing global list of window views" 2019-02-20 14:59:12 +00:00
Adrian Roos
9b963d3ce4 Add CompositionSamplingListener
Adds a facility to sample the median luma in a region
of the SurfaceComposer's result.

Test: atest CompositionSamplingListenerTest
Bug: 124305231
Change-Id: I78eececa9aef420f488a860f4e6891d4af84d27f
2019-02-20 15:16:36 +01:00
TreeHugger Robot
fe71582e23 Merge "Introduce a way to turn a fullscreen window into freeform" 2019-02-20 09:43:51 +00:00
Yunfan Chen
d967af828b Introduce a way to turn a fullscreen window into freeform
Change the exitFreeformMode to toggleFreeformMode. Now the original
maximize button will work as maximize/restore button.

Test: go/wm-smoke
Test: Manual test.
Bug: 117075771
Bug: 124475503

Change-Id: I268d053ed0e665b8ac5e56019c6ae8f8b7ee1317
2019-02-20 15:51:40 +09:00
Felipe Leme
72e83d8c3d Changed ContentCaptureManager API so service can only disable itself.
To re-enable, it will need to launch a Settings intent
(Settings.ACTION_REQUEST_ENABLE_CONTENT_CAPTURE).

Bug: 123286662
Test: atest CtsContentCaptureServiceTestCases

Change-Id: I0dd03013aba645c188af4034e530492d8294180e
2019-02-19 09:29:14 -08:00
Mathew Inwood
8e82865436 Move the right method to max-sdk-o list.
The DisplayListCanvas override was on the dark grey list in P, not the
View override.

Test: m
Bug: 123987101
Change-Id: Ibc1503a8b5fe7dfe797835c972288c4b98362b65
2019-02-18 10:55:08 +00:00
Felipe Leme
044c63b367 Changes on the ContentCaptureContext APIs.
- Replaced URI by a generic ID
  (which is a new class LocusId, and required)
- Createad a new Intent.ACTION_VIEW_LOCUS action
  (and Intent.EXTRA_LOCUS_ID extra)
- Removed ContentCaptureContext.getAction()
  (so the only "supported" action is ACTION_VIEW_LOCUS)
- Made the ContentCaptureContext getters public
  (getId(), getExtras())

Test: m update-api
Test: atest CtsContentCaptureServiceTestCases \
      CtsContentTestCases:LocusIdTest \
      FrameworksCoreTests:android.view.contentcapture.ContentCaptureEventTest

Bug: 123577059
Fixes: 124266664

Change-Id: Id4c28f056eb7a24dd083303ffdea7cf662cefac2
2019-02-15 20:44:35 -08:00
Felipe Leme
e8eae9d420 Initial implementation of ContentCaptureService.setContentCaptureWhitelist()
For now it only whitelists packages, not activities.

Test: atest CtsContentCaptureServiceTestCases

Bug: 122595322

Change-Id: I5beb9b027eb704510e68f3af15e84e14bda07eb2
2019-02-15 20:00:49 -08:00
TreeHugger Robot
2188365b44 Merge "Annotated mTheme field on ContextThemeWrapper with maxTargetSdk P" 2019-02-16 03:48:19 +00:00
Felipe Leme
80e7bf114d Initial implementation of AutofillManager.setAugmentedAutofillWhitelist()
For now it only whitelists packages, not activities.

Test: atest CtsAutoFillServiceTestCases:android.autofillservice.cts.augmented.AugmentedLoginActivityTest

Bug: 123100824

Change-Id: I043f4a22684fcdac7409393c208c2c1e6d987c5e
2019-02-15 17:57:58 -08:00
Felipe Leme
d32d8f6f3c Added DeviceConfig properties to fine tune ContentCapture:
- DEVICE_CONFIG_PROPERTY_MAX_BUFFER_SIZE
- DEVICE_CONFIG_PROPERTY_IDLE_FLUSH_FREQUENCY
- DEVICE_CONFIG_PROPERTY_TEXT_CHANGE_FLUSH_FREQUENCY
- DEVICE_CONFIG_PROPERTY_LOG_HISTORY_SIZE
- DEVICE_CONFIG_PROPERTY_LOGGING_LEVEL

Test: manual verification
Test: atest CtsContentCaptureServiceTestCases

Bug: 123096662
Fixes: 121044064
Fixes: 121044306

Change-Id: I08623516bb7ebbe9c900987be853f4f395250016
2019-02-15 17:32:04 -08:00
TreeHugger Robot
fe09cbef5a Merge "ContentCaptureManager should be null when the feature is disabled." 2019-02-16 00:57:04 +00:00
Alan Viverette
1761cfac39 Public API for statically accessing global list of window views
Android Studio's UI inspection tool needs access to the currently displayed
window(s) via publicly-accessible APIs given only a classloader -- it does
not have any activity or app Context.

Bug: 124516440
Test: atest WindowInspectorTest
Change-Id: I960165813c260ac8f8e17cc163fabf65b1417480
2019-02-15 16:17:30 -05:00
John Reck
d9425659af API adjustments for Picture serialization discussion
Fixes: 124315734
Test: none
Change-Id: Ie1c610ae5536225f1ba454235be509f1c7e70bab
2019-02-15 12:32:31 -08:00
Nader Jawad
a1eef72673 Annotated mTheme field on ContextThemeWrapper with maxTargetSdk P
Added ContextThemeWrapper#setTheme(Theme) method to programmatically
assign the theme without using a resource id

Change-Id: I043253e65a535abdf8d89d9421d2cff2b41bdb05
Fixes: 123768723
Test: Added CTS test to verify setTheme
2019-02-15 19:06:51 +00:00
Felipe Leme
d49d52c0ad ContentCaptureManager should be null when the feature is disabled.
Test: manual verification using logcat and dumpsys
Test: atest CtsContentCaptureServiceTestCases

Fixes: 124475449

Change-Id: I699de127bf9e61ba187eb129c38d243d5fc93f1c
2019-02-15 10:32:45 -08:00
TreeHugger Robot
3a5211e744 Merge "Changed ContentCaptureService.setContentCaptureWhitelist() to use Set instead of List." 2019-02-15 04:20:23 +00:00
Felipe Leme
7a3c9f5324 Changed ContentCaptureService.setContentCaptureWhitelist() to use Set instead of List.
(Same for Augmented Autofill)

Bug: 122595322
Test: m update-api

Change-Id: I6753ce2567801da148682c0ccbad7f6abc4d1ecc
2019-02-14 14:13:56 -08:00
John Reck
989bb3714f Merge "Make HardwareRenderer public API" 2019-02-14 20:40:13 +00:00
TreeHugger Robot
1df6e435b0 Merge "Removed unused APIs." 2019-02-14 16:51:29 +00:00
TreeHugger Robot
d14c8a2a72 Merge "RESTRICT AUTOMERGE Close TextClassifier native resources." into pi-dev 2019-02-14 16:22:18 +00:00
Felipe Leme
0552f41c4e Merge "Add new ContentCapture APIs to let apps change the ContentCaptureContext." 2019-02-14 15:26:27 +00:00