Commit Graph

14530 Commits

Author SHA1 Message Date
Charles Chen
94deecfda2 Merge "Trust System UI owned display to receive keys" into rvc-dev 2020-06-16 13:56:55 +00:00
Tiger Huang
ae9ce9716d Merge "Disable user animations on insets whose visible frame is empty" into rvc-dev 2020-06-16 09:26:33 +00:00
Charles Chen
b28fb721f5 Trust System UI owned display to receive keys
A11y service cannot get focus of bubbles because it's not a
System owned display. This patch makes System UI owned display
a trusted display. Moreover, this patch refactors the logic to
identify a trusted display by introducing FLAG_TRUSTED and
removes the trusted display check along with supportsSystemDecorations()
because the check has been included in supportsSystemDecorations().

fixes: 155823002
Bug: 152416787
Test: atest DisplayContentTests
Test: atest WindowFocusTests
Test: atest TaskDisplayAreaTests
Test: atest MultiDisplaySystemDecorationTests
Test: atest DisplayTest
Change-Id: Ie684c6488904e5aa8cae166a455c6d55455e5f55
2020-06-16 02:10:21 +08:00
Tiger Huang
ac4e36b948 Merge "Let position of system bars can be restored by swipe" into rvc-dev 2020-06-15 08:54:46 +00:00
Tiger Huang
0b9450bab9 Disable user animations on insets whose visible frame is empty
Floating IME or fullscreen IME won't cause insets (except the area
overlapped with navigation bar). It doesn't make much sense to let
apps move the IME at these cases.

Fix: 157777145
Test: atest InsetsSourceConsumerTest
Change-Id: Ibdf5454843c880d7e726a66a8f1107ca511e5025
2020-06-14 19:14:26 +08:00
Tony Huang
a73d6ecb84 Merge "Only add divider when it need to show" into rvc-dev 2020-06-12 03:04:26 +00:00
TreeHugger Robot
dd9c140ef5 Merge "Fix content capture session id collision bug" into rvc-dev 2020-06-12 00:14:51 +00:00
Feng Cao
945f31cc12 Fix content capture session id collision bug
* The content capture session id should be globally unique
* Before this change, the id is genrated from a static random
  number generator created with new Random(). It appears that
  it all has the same seed value, so the sequence it generates
  is identical across processes
* Ideally the session id should be generated from a center
  place to ensure uniqueness (e.g. system server), or be a UUID
  which is more unlikely to conflict. We will explore that as
  a longer term solution in S
* For now the less invasive solution is to use SecureRandom,
  which produces non-deterministic output
* Other approaches tried:
  1) new Random(android.os.Process.myPid()). This doesn't work
     as the pid value is all the same at static loading time
  2) offset the generated number by pid. This will work but the
     ids are not so random
  3) make Random a non-static variable. This will work but it
     creates a new object for every class

Test: manual
Bug: 158714891

Change-Id: I158f45680a961b32f3b01dc4eabb45e7215cdeec
2020-06-11 15:51:09 -07:00
TreeHugger Robot
8089c3867e Merge "Release SurfaceView surface if viewrootimpl surface is not valid" into rvc-dev 2020-06-11 18:43:39 +00:00
Tiger Huang
017d51dccd Let position of system bars can be restored by swipe
In the new insets world, apps can move system bars while keeping them
visible, which can make the user difficult to access the bars. This CL
lets the user can restore the position of system bars by swipe.

This CL also removes some unnecessary logic and refactors some methods.

Fix: 152194798
Test: Manual test with NewInsetsMainActivity
Change-Id: I81c8a41ca88a403d291186d61ec597c6bc5d3d84
2020-06-11 21:57:47 +08:00
Jorim Jaggi
1f6b99d5fa Merge "Exclude non-observable insets change" into rvc-dev 2020-06-11 12:15:49 +00:00
TreeHugger Robot
9e1a5ebbfd Merge "Don't clear requested SysUI visibility if the source doesn't exist" into rvc-dev 2020-06-11 11:24:45 +00:00
Tiger Huang
026dec4298 Don't clear requested SysUI visibility if the source doesn't exist
This makes the SysUI visibility callback compatible with the legacy
behavior.

Fix: 158639842
Fix: 158643177
Test: atest LayoutTests#testAddingImmersiveWindow
Change-Id: Ife06f8aab1b9d86790478665a33961d1b613d62d
2020-06-11 17:50:04 +08:00
Vishnu Nair
34486ad942 Release SurfaceView surface if viewrootimpl surface is not valid
When the window visiblity changes, SurfaceView gets notified to
release its surface. If an app relayout happens before this
notification, the ViewRootImpl surface will be null and the
SurfaceView will not release it surface.

Fixes: 158469622
Test: go/wm-smoke
Test: repro steps from bug
Test: play with SurfaceView apps
Change-Id: Ia4d5948fd229b2c77700c91691b54561d84290bb
2020-06-10 18:14:20 -07:00
Jorim Jaggi
ed31259e01 Exclude non-observable insets change
When we notify insets changed, legacy behavior forces us to force
a new measure on the entire hierarchy. However, this can cause
jank in various scenarios.

Make sure that we don't report an insets change if non-observable
state changes.

Test: InsetsStateTest
Test: Swipe up to home while IME open
Bug: 157123435
Change-Id: I9c51066c6489888720b307240d03054cc18c4172
2020-06-10 14:24:03 +02:00
TreeHugger Robot
b121512580 Merge "Report WINDOW_FOCUS_GAIN_REPORT_ONLY when the served connection remains" into rvc-dev 2020-06-09 13:41:30 +00:00
Adrian Roos
5b12e07b9c Merge "Insets: allow controlling insets as long as the window is covering in the relevant direction" into rvc-dev 2020-06-09 08:24:57 +00:00
Ming-Shin Lu
6ecbf08772 Report WINDOW_FOCUS_GAIN_REPORT_ONLY when the served connection remains
When we tried CL[1] to fix Gboard Translation UI dialog dismissed that
keeping the served view when focused to the next window,
although we can skip starting new input when the window focused back as
the behavior of Q,

However, we overlooked in R, IME insets will rely on IMS#reportStartInput
to get the updated IME input target, which will out of sync for the above
case.

To fix this regression, we report the next window focus gain
to IMMS with WINDOW_FOCUS_GAIN_REPORT_ONLY when the next focused view is
same as current served view and the served input connection remains.

so that in IMMS side won't get StartInputFlags.INITIAL_CONNECTION flags
to set restarting as false when calling IInputMethod#startInput to IMS,
and in IMS side will still call reportStartInput to WMS for updating
IME input target without additional onFinishInputView callback to
client.

[1]: I8d4fff94ba9313b773bc27fcbd019cc88580d3e9

Fix: 152373385
Bug: 155781821
Test: atest CtsInputMethodTestCases
Test: manual, make sure Bug 155781821 comment #10 works:
    1) Launch video call in Hangouts.
    2) End call.
    3) Click on the text box.
    4) Expect Soft-Keyboard shown
Test: make sure not break Bug 148489857 and Bug 148788569, following
auto / manual test to verify:
 - Auto: atest FocusHandlingTest#testKeyboardStateAfterImeFocusableFlagChanged
 - Manual:
    1) Build / install EditTextVariations
    2) Select menu -> Direct-Reply, make sure Notification comes up.
    3) Tap EditText on Notification, verify soft-keyboard is visible.

Change-Id: I45a9814d812ad906f417c24200fd4219959e2423
2020-06-09 13:48:15 +08:00
TreeHugger Robot
854b0d1a89 Merge "Fix NPE in InlineContentView" into rvc-dev 2020-06-09 03:42:04 +00:00
Feng Cao
10e6217a8d Fix NPE in InlineContentView
* The NPE is due to in the InlineContentView we try to reparent the
  surface view which is no longer attached to the window, this can
  happen if the InlineContentView is attached to window and then
  immediately detached from the window, before the surface package
  is returned from the remote view process.
* Release the surface package immediately in this case, so the
  remote view can be released.

Test: atest android.autofillservice.cts.inline
Bug: 158139090

Change-Id: I9efdf8ba182a1d66334362edcfb6ba58fcdc222a
2020-06-08 18:52:21 -07:00
Minche Li
e85c54f39b Merge "Documentation cleanup for AccessibilityNodeInfo.ExtraRenderingInfo" into rvc-dev 2020-06-09 01:46:08 +00:00
Joanne Chung
9856804eb2 Merge "Handle SyncResultReceiver.TimeoutException" into rvc-dev 2020-06-09 00:21:44 +00:00
TreeHugger Robot
88e86e641a Merge "Insets: Fix stuck mPendingFrame" into rvc-dev 2020-06-08 15:41:26 +00:00
Joanne Chung
c6adc68368 Handle SyncResultReceiver.TimeoutException
1.Change SyncResultReceiver.TimeoutException to checked exception
2.Handle the SyncResultReceiver.TimeoutException in AutofillManager,
ContentCaptureManager, ContentSuggestionsManager
3.Fix the bug we should throw e.rethrowFromSystemServer()

Bug: 156044027
Test: atest CtsAutoFillServiceTestCases
Test: atest ContentSuggestionsManagerTest
Test: atest CtsContentCaptureServiceTestCases
Change-Id: I959d2aca2b80866c076fae2520de66c123f5367d
2020-06-08 14:53:45 +08:00
Shawn Lin
c54d84a858 Merge "Add a @hide ctr to disable background layer in ActivityView & SurfaceView" into rvc-dev 2020-06-08 03:34:20 +00:00
TreeHugger Robot
78d74114aa Merge "Update textclassifier TEST_MAPPING file." into rvc-dev 2020-06-05 21:56:34 +00:00
Joanne Chung
a0adc25387 Update textclassifier TEST_MAPPING file.
Add CtsTextClassifierTestCases and TextClassifierServiceTest into
presubmit.

Bug: 154961272
Test: atest --test-mapping frameworks/base/core/java/android/service/textclassifier
Test: atest --test-mapping frameworks/base/core/java/android/view/textclassifier
Test: atest --test-mapping frameworks/base/services/core/java/com/android/server/textclassifier
Change-Id: I123eeb0ce11e2b159ebbf20fe81dc682cd347230
2020-06-06 01:49:27 +08:00
Adrian Roos
021f4a7140 Insets: Fix stuck mPendingFrame
Fixes an issue where the mPendingFrame was not properly cleared
if we re-applied the current frame.

Fixes: 156762386
Test: InsetsSourceConsumerTest
Change-Id: I9f0ebfafac44e1b4b87ea9d3408e64ba34bca2ec
2020-06-05 17:15:26 +02:00
Adrian Roos
8d04bcbc43 Insets: allow controlling insets as long as the window is covering in the relevant direction
Fixes: 154745615
Test: InsetsStateTest
Change-Id: I666a7eee82c15f0c5594c0acbd1a4f0186bcdc01
2020-06-05 14:46:14 +02:00
mincheli
bb8e4dcbcb Documentation cleanup for AccessibilityNodeInfo.ExtraRenderingInfo
1. Mentioned the layout size could also be WRAP_CONTENT or MATCH_PARENT.
2. These API docs should be more generic that not mention the test tool.

Bug: 156961226
Test: none
Change-Id: I689bf4caf41bfe1fc09024777a87183d7211be05
2020-06-05 09:06:05 +00:00
shawnlin
ba532aff3e Add a @hide ctr to disable background layer in ActivityView & SurfaceView
Bug: 152441717
Test: 1. Open bubble
      2. adb shell dumpsys SurfaceFlinger
      3. Check result
Change-Id: I3bda67bb56781eb75b51dc51f491a97efac7b4ef
2020-06-05 16:08:37 +08:00
Charles Chen
f843a85226 Merge "Add an incorrect context violation on GestureDetector" into rvc-dev 2020-06-05 02:08:48 +00:00
Robert Snoeberger
b1d2c79448 Merge "Revert "Exception if receive move withouth down"" into rvc-dev 2020-06-03 20:17:09 +00:00
Robert Snoeberger
0ef6f01bd1 Revert "Exception if receive move withouth down"
This reverts commit a0a20dc23b.

Reason for revert: This is causing a number of fatal crashes in SystemUI. See b/158081578, b/158057055, b/158060735, and b/158061923.

Fixes: 158081578
Fixes: 158057055
Fixes: 158060735
Fixes: 158061923
Change-Id: If7e6cd4ade3df540ba7d97d9265564132a235292
2020-06-03 20:15:44 +00:00
Tony Huang
a0ee06083c Only add divider when it need to show
By previous memory patch, the divider will always call update when
enter split when means it always add divider view when showing. So
we can reduce some update call to avoid any unnecessary surface
memory allocate.

Fix: 150190730
Test: Check split mode rotate normally and dump SF to check divider
      memory status
Change-Id: Idb39cefe0168e9e5e11ce0e13438a24f84cbb9f4
2020-06-03 15:32:23 +08:00
TreeHugger Robot
cc4f13e0ab Merge "Fix AugmentedAutofillService onFillRequest() wrong focused AutofillId for WebView" into rvc-dev 2020-06-02 20:54:18 +00:00
Rob Carr
28fdf609dc Merge "SurfaceView: Lock mDeferredDestroySurfaceControl" into rvc-dev 2020-06-02 19:27:08 +00:00
Robert Carr
6ce9ffb2cd SurfaceView: Lock mDeferredDestroySurfaceControl
Since mDeferredDestroySurfaceControl is the same underlying
object as mSurfaceControl we also need to hold the mSurfaceControlLock
when writing to it.

Bug: 157657896
Test: Existing tests pass
Change-Id: Ie0da3ed5d94c7aae2593423fa2767dbc902da4c8
2020-06-02 18:11:51 +00:00
TreeHugger Robot
46c51b716d Merge "Exception if receive move withouth down" into rvc-dev 2020-06-02 17:40:24 +00:00
Joanne Chung
fbc89efee3 Fix AugmentedAutofillService onFillRequest() wrong focused AutofillId for WebView
When AutofillManagerService try to trigger AugmentedAutofill, it uses
AutofillId.withoutSession() to get the AutollId without session. It
will return invalid "parentId:NO_ID" if the virtual AutofillId is
created with FLAG_IS_VIRTUAL_INT. The virtual AutofillId flag should
be FLAG_IS_VIRTUAL_INT or FLAG_IS_VIRTUAL_LONG, we should get
mVirtualIntId for FLAG_IS_VIRTUAL_INT or mVirtualLongId for
FLAG_IS_VIRTUAL_LONG.

Bug: 156408900
Test: atest android.autofillservice.cts.augmented
Test: atest android.view.autofill.AutofillIdTest#\
testVirtual_Long_withoutSession
Test: atest android.view.autofill.AutofillIdTest#\
testVirtual_Int_withoutSession
Test: Manual. Write a simple cts test for webview and check the
focused AutofillId is correct while switching between the field.

Change-Id: I7ebb4d7cfb6d6f383724b798dae69269ae3a27be
2020-06-03 01:06:24 +08:00
arthurhung
a0a20dc23b Exception if receive move withouth down
Throw an IllegalStateException if recevie touch move without down,
that could give an explicit feedback about GestureDetector may not
receive the full touch stream.

Bug: 149578486
Test: manual
Change-Id: I644ec1bebbca66dd0f0c219b63a6478b1290d1e1
2020-06-02 10:27:11 +08:00
TreeHugger Robot
1b2dfb04c8 Merge "Remove additional sf transaction when constructing a leash" into rvc-dev 2020-06-01 23:41:12 +00:00
Evan Rosky
82352f9db8 Merge "Use boundsChangeTransaction to improve split-screen enter/exit" into rvc-dev 2020-06-01 22:55:20 +00:00
Steven Thomas
061dec3e8d Merge "Clarify FRAME_RATE_COMPATIBILITY_* params" into rvc-dev 2020-06-01 20:44:30 +00:00
Evan Rosky
3613854d1b Use boundsChangeTransaction to improve split-screen enter/exit
Uses applySyncTransaction to synchronize all the surface
updates during split-screen enter/exit.

In Divider, all syncTransactions are serialized and runnables
can be posted to operate on the returned transactions so
they happen all at once.

This also required adding a "merge" functionality on
WindowContainerTransactions to handle racing between rotation
and other in-flight sync transactions (because they are
serialized, sometimes they got delayed).

Bug: 153579514
Test: Enter/exit split-screen and observe no flickers
Change-Id: I57df13489247f3c4fb3ca59efa26867a872e447f
2020-06-01 11:33:27 -07:00
Ahaan Ugale
4d8efece25 Merge changes from topic "Data Share Sender Crash" into rvc-dev
* changes:
  Handle sender's crash in Data Share API
  Add finish() method to DataShare Read and Write Adapters
2020-05-29 23:32:48 +00:00
Vishnu Nair
06cff30935 Remove additional sf transaction when constructing a leash
The leash needs to be visible on creation otherwise when reparenting
the leash, the leashed layer may be hidden for a moment. This is because
Transaction#show can be deferred but Transaction#reparent cannot.

This change adds a layer flag to allow creating effect layers without
a color fill so we can avoid an additional sf transaction.

Fixes: 157646690
Test: go/wm-smoke
Test: atest SurfaceFlinger_test
Change-Id: I3d8a4f4820d7b8fb05daab697c25cff8def612c1
2020-05-29 21:59:24 +00:00
Yara Hassan
dc699fb8ce Add finish() method to DataShare Read and Write Adapters
The finish() method is used to clear hard references after
the data copy has ended. This fixes a bug where the references are cleared before onError() is attempted to be called.

Test: CTS tests in followup CL
Bug: 157136368
Fixes: 157136368
Change-Id: If924fe388762831af90579e6b00bdf223230e203
2020-05-29 14:35:13 -07:00
Ahaan Ugale
974c3114dc AF Inline: Notify the registered AutofillCallback, also fix filtering.
This is missing notifications on the suggestions being hidden/shown
while filtering, but that is a bit harder to solve as we have to pipe
this state back from AutofillInlineSessionController. (although, I'm not
certain we even want this behavior, however it is inconsistent with the
dropdown behavior for now)

See bugs linked for what is fixed for filtering (some are not marked as
fixed as they still might need cts tests).
The main change is to make the privacy protection mechanism a bit
smarter - it now only applies to text-matching based logic.

Fix: 157763435
Fix: 156930859
Bug: 155517211
Bug: 157762527
Test: atest CtsAutoFillServiceTestCases:DatasetFilteringInlineTest \
  CtsAutoFillServiceTestCases:InlineFilteringTest \
  CtsAutoFillServiceTestCases:DatasetFilteringDropdownTest
Test: atest android.autofillservice.cts.inline
Change-Id: Icf94e21ba0df3b15a32454038772967cc1f6da79
2020-05-29 14:12:27 -07:00
Charles Chen
85f9f501b1 Add an incorrect context violation on GestureDetector
Also update the documentation of GestureDetector ctr.

fixes: 157165393
Test: build & run
Change-Id: If87d78d7337d7926af0a37819e4365a216a978b2
2020-05-29 14:57:34 +08:00