Commit Graph

14566 Commits

Author SHA1 Message Date
TreeHugger Robot
9e7c46190a Merge "Revert "Enable IMS and its config context to obtain UI component"" into rvc-dev 2020-06-25 00:41:07 +00:00
Alistair Delva
71b8a0456c Revert "Enable IMS and its config context to obtain UI component"
Revert "Verify IMS to get display and WM"

Revert submission 11823238-ims_ui_context

Reason for revert:
Broke the following tests:
android.os.cts.StrictModeTest#testIncorrectContextUse_GetDisplay
android.os.cts.StrictModeTest#testIncorrectContextUse_GetSystemService
android.os.cts.StrictModeTest#testIncorrectContextUse_GetViewConfiguration
But was submitted with a bypass.

Reverted Changes:
I688b46a92:Verify IMS to get display and WM
I172ceb2e1:Enable IMS and its config context to obtain UI com...

Bug: 157027563
Bug: 159795597
Change-Id: Id309faac0ac8f60ee0d92c26767a89f450ddc455
2020-06-24 22:31:53 +00:00
Svet Ganov
4846803547 Address missed comments from previous CL
bug:153826463

Test: atest android.widget.cts.inline.InlineContentViewTest#testReparenting

Change-Id: Iddb1f4d2e0b7043517616d0ec3678a55f9eda34c
2020-06-24 06:39:28 +00:00
Svetoslav Ganov
f8b9ddea71 Merge "Handle reperenting of InlineContentView" into rvc-dev 2020-06-24 06:28:59 +00:00
Svet Ganov
a5b4990d96 Handle reperenting of InlineContentView
When an inline content view is reparented its surface is
getting offset and not being under the view itelf. This is
because the surface views manage the postion of their
surface and are assuming a location based off the window's
surface position. However after a reparenting the inline
content view's surface position becomes relative to that
of the new parent surface view. For example, two surface
views at position (10, 10) being reparented would reslut
in the surface of the parent being at (10, 10) while the
surface of the child being at (20, 20) while both views
would still be at (10, 10).

To address this we are intecepting when an inline content
view's surface is reparented and get a weak reference to
the view that owns the new parent surface. We then position
the inline content view's surface relative to the view that
owns the new parent surface, i.e. we position the surface
such that its location would not change because of the
fact it is being reparented.

While at this make sure the inline content view is marked
as not important for a11y to ernsure the a11y plugins don't
try to click on the view tree in the app's process but
insted on the views in the remote proccess, i.e. on the
embedded view tree.

bug:153826463

Test: atest android.widget.cts.inline.InlineContentViewTest#testReparenting

Change-Id: I2cff4b88d404a740bc447668e948eabccad084d2
2020-06-24 06:27:17 +00:00
Tiger Huang
77190b77f6 Merge "Disable user animations on insets whose visible frame is empty (refined)" into rvc-dev 2020-06-24 04:00:09 +00:00
Charles Chen
8655743001 Merge "Enable IMS and its config context to obtain UI component" into rvc-dev 2020-06-24 03:33:53 +00:00
Joanne Chung
234a31e2f5 Merge "Made AutofillId.withoutSession is testable." into rvc-dev 2020-06-23 22:56:59 +00:00
TreeHugger Robot
e16a6a02a7 Merge "[DO NOT MERGE] Bring back touch events for double tap and double tap and hold." into rvc-dev 2020-06-23 22:24:13 +00:00
Adrian Roos
e658c76b5c Merge "IME animation: hide IME-related navbar icons until perceptible" into rvc-dev 2020-06-23 07:06:48 +00:00
Joanne Chung
24abde551e Made AutofillId.withoutSession is testable.
We add new test in stage-aosp-rvc-ts-dev for R2, we need make this API
testable.

Bug: 156408900
Test: atest android.autofillservice.cts.inline.\
InlineAugmentedWebViewActivityTest

Change-Id: I27d1227f858aac83b3de1cb8ef719edf177524dc
Merged-In: I27d1227f858aac83b3de1cb8ef719edf177524dc
2020-06-23 00:38:40 +00:00
Ameer Armaly
9e83d07824 [DO NOT MERGE] Bring back touch events for double tap and double tap and hold.
Bug: 159168795
Test: atest TouchExplorerTest
Change-Id: I427b98c71ce8a2ac5b9285b2f34c1864f48c4a32
2020-06-22 13:58:51 -07:00
Charles Chen
d2fd037ab3 Enable IMS and its config context to obtain UI component
Test: atest StrictModeTest
Bug: 157027563

Change-Id: I172ceb2e17722a7cba917a6e3a808d7559cad3e0
2020-06-23 03:45:17 +08:00
Taran Singh
296855fe76 Merge "Fix InsetsConsumer leak" into rvc-dev 2020-06-22 18:53:20 +00:00
Tiger Huang
618dbe022f Disable user animations on insets whose visible frame is empty (refined)
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 GlobalActionsImeTest
            ImeInsetsControllerTest
Change-Id: Id70f59be7653beedc02d6c8bc3b1bd50a357f4fe
2020-06-23 00:58:05 +08:00
Taran Singh
531404721f Fix InsetsConsumer leak
Activity was still referred from ImeInsetsSourceConsumer after
ViewRootImpl's mView was destroyed when ViewRoot's surface is cleared
using die signal.
This CL makes sure we still free-up resources at die signal.

Fix: 157955883
Test: atest NexusLauncherTests
Change-Id: Ia48f7b7a8cf6b867ce75b2b7393a60ba73b0c3d0
2020-06-22 15:32:47 +00:00
Adrian Roos
c22eec9d35 IME animation: hide IME-related navbar icons until perceptible
During transitions and while the IME is controlled by the app,
the IME may be "visible" as far as the IME framework is concerned,
but not actually perceptible by the user due to offsets or alpha
applied to the leash.

This may lead to out-of-place navbar symbols for the IME, especially
in gesture nav.

To avoid this, the ImeInsetsSourceConsumer now notifies the IMF of
whether it has made the IME unperceptible to the user.

For now, we ignore the cases where the IME is controlled by something
other than the client window - in that case, we just revert to the
previous behavior of it being always considered perceptible.

Fixes: 158079255
Test: manual, launch email compose activity, observe that back button only indicates once IME appears
Test: atest InsetsAnimationControlImplTest
Change-Id: I4dc9d6513d0559156f7da39244f3fc5ebc952ed4
2020-06-22 16:55:54 +02:00
TreeHugger Robot
70ad33113f Merge "Ignore onStartInput when WINDOW_FOCUS_GAIN_REPORT_WITH_SAME_EDITOR" into rvc-dev 2020-06-22 14:51:15 +00:00
Ming-Shin Lu
48bfc3165c Ignore onStartInput when WINDOW_FOCUS_GAIN_REPORT_WITH_SAME_EDITOR
CL[1] introduces new WINDOW_FOCUS_GAIN_REPORT_ONLY flows to notify
InputMethodService only reports IME input target to WM when focusing to
the next window and its input connection remains.

Originally in android Q and prior devices, we don't need such report
mechnism but just skip to start new input connection and ignore
onStartInput / onFinishInput for the above use case.

Since starts from Android R, new IME insets control APIs relying on this
mechanism (see CL[2]) to keep the actual IME input target up-to-date.

As we expected there should be no new input connection and additional
onFinishInput when CL[1] landed.

However, in IMMS, startInputUncheckedLocked will be called
to callback additional onStartInput for InputMethodService, which mostly
is not expected, except when focusing the same window after device
turned screen on, we need to start input and callback onStartInput to
align with the behavior of android Q or the prior platform.

Besides, to have more clear code logic and debugging concept of
ignoring onStartInput and onFinishInput only when focused the same editor
with input connection remains, we remove WINDOW_FOCUS_GAIN_REPORT_ONLY
reason and introduced 2 more start input reasons to distinguish the
different behavior:
    - WINDOW_FOCUS_GAIN_REPORT_WITH_SAME_EDITOR
    - WINDOW_FOCUS_GAIN_REPORT_WITHOUT_EDITOR

[1]: I45a9814d812ad906f417c24200fd4219959e2423
[2]: I9e8984b7e5aa989a53ece9e2576393f795b9ef94

Fix: 158624922
Test: atest FocusHandlingTest InputMethodStartInputLifecycleTest
Test: manual as below steps:
    1. Use Gboard, Open the emoji keyboard
    2. Swipe down to reveal notification shade
    3. Swipe up to dismiss notifications
    4. Expect the Emoji keyboard is still open without close

Change-Id: I2da99ae67b9ce4051dec0c0f0e975ebe6e1ab118
2020-06-22 12:22:33 +08:00
Taran Singh
4291410118 Animate IME with zero insets
When IME has zero insets, it doesn't map to any side and doesn't have
can't be animated.
IME can have zero insets in following cases:
1. Floating IME
2. Fullscreen IME (in landscape)
3. IME doesn't overlap with IME target window.

In order to animate a type, it must have insets. We can animate IME
from negative insets to zero and vice-versa. This makes zero insets IME a
special case of ISIDE_BOTTOM.
Deprecate SIDE_FLOATING because it shouldn't logically map to a side.

Fix: 153909316
Test: atest WindowInsetsAnimationImeTests#testZeroInsetsImeAnimates
Change-Id: I6d1d3430888db4632cb2f93e9042f692b35ebaeb
2020-06-20 03:51:00 +00:00
TreeHugger Robot
48dc192499 Merge changes I4fdf368e,Ibc6be890 into rvc-dev
* changes:
  SurfaceControlViewHost: Release ViewRoot from finalizer
  SurfaceControlViewHost: Call doDie with true
2020-06-20 00:07:56 +00:00
Robert Carr
7a31b8b1df SurfaceControlViewHost: Release ViewRoot from finalizer
If we don't explicitly go through the doDie process the
WindowManagerGlobal instance will hold the ViewRoot alive
indefinitely. This accidental leak could be very expensive so
we prevent it with a finalizer.

Bug: 157709599
Test: Existing tests pass
Change-Id: I4fdf368eed4b4e43faacd9f62b6d9fddfd9b7ef2
2020-06-19 13:14:00 -07:00
Robert Carr
5409e24105 SurfaceControlViewHost: Call doDie with true
If we pass immediate=false to the doDie without
updating the visibility, we may destroy the hardware renderer
but then try to draw again anyway, and then crash. It seems
theres no reason we can't call immediate=true and
properly shut down immediately.

Bug: 159250432
Test: Existing tests pass
Change-Id: Ibc6be8901be10c0985681d83f4ce16dd1ab54925
2020-06-19 13:10:13 -07:00
Jorim Jaggi
5cc486b1a1 Merge changes Ia7d9514e,I3e9e4f47 into rvc-dev
* changes:
  Yearly Window Manager spring cleaning #2
  Yearly Window Manager spring cleaning #1
2020-06-19 13:58:45 +00:00
Jorim Jaggi
bfa95a71fb Yearly Window Manager spring cleaning #1
- Replace InsetsState ArrayMap with simple array.
- Cache same values in InsetsPolicy.
- Only access Dimmer if dimming

Test: InsetsState test etc.
Bug: 159056748
Change-Id: I3e9e4f473eaa05b2013b7a6d0f37cd9c1fac81dd
2020-06-19 13:18:38 +02:00
TreeHugger Robot
44b233c55d Merge "Fix the context leak in the ContentCapture" into rvc-dev 2020-06-19 06:38:19 +00:00
TYM Tsai
c9f0c232ae Fix the context leak in the ContentCapture
Activity cannot be released because the context be holded by multiple
objects.
* Activity holds ContentCaptureManager.
* ContentCaptureManager holds the context and MainContextCaptureSession.
* MainContextCaptureSession holds the context and ContentCaptureManager.
* The system server holds some binder references to MainContentCaptureSession.
If the system service never released the binder references, then the
activity is also never GC'd.
To avoid the issue,
1. Make the session state receiver of MainContextCaptureSession to be
   static and uses weak reference to MainContextCaptureSession.
2. The direct service vulture may miss to do unlinkToDeath(), do a checking
   while the session destory.

Bug: 143210612
Test: manual check Objects on the meminfo
Test: Activities should be released after a period of time
Test: adb shell dumpsys meminfo com.google.android.dialer
Change-Id: I12037483addb1efe444c74fa189ef6afd15821dd
2020-06-19 12:09:54 +08:00
Ady Abraham
278f00319f Merge "WM: Replace eEarlyWakeup flags with explicit eEarlyWakeup start and end flags" into rvc-dev 2020-06-18 04:36:03 +00:00
Vishnu Nair
2ed39d82db WM: Replace eEarlyWakeup flags with explicit eEarlyWakeup start and end flags
eEarlyWakeup flag is used as a hint to SurfaceFlinger to adjust its
offsets so it can wakeup earlier and have sufficient time to compose
more complex scenes.

This flag has been replaced with explicit start and stop flags which
ensure the SurfaceFlinger offsets remain consistent during animation.

Bug: 158127834
Test: go/wm-smoke
Test: systrace to verify new tracepoint and offset behavior

Change-Id: Ib9c35c01a6bf02f88ec7cb1778e01909bd2f9055
2020-06-17 23:10:30 +00:00
Jorim Jaggi
e1f741becf Revert "Add logs that indicate why a surface is invalid"
This reverts commit 0fd6748bf6.

Bug: 159056748
Change-Id: I850c0d29e07c74143868c6c63cef63649a449c9e
2020-06-17 14:12:50 +02:00
TreeHugger Robot
3764cbaac4 Merge "SurfaceView: Check ViewRootImpl non-null" into rvc-dev 2020-06-17 00:16:36 +00:00
TreeHugger Robot
11fcb1987a Merge "Revert "Disable user animations on insets whose visible frame is empty"" into rvc-dev 2020-06-16 23:01:15 +00:00
Yohei Yukawa
f35971dfca Revert "Disable user animations on insets whose visible frame is empty"
This reverts commit 0b9450bab9.

Reason for revert:
Broke ImeInsetsControllerTest#testChangeSizeWhileControlling

Bug: 157777145
Fix: 159154994
Test: atest CtsInputMethodTestCases
Test: atest InsetsSourceConsumerTest
Change-Id: I6c47ec5f8498a3566c543d4d1d6ef62e325ccd8e
2020-06-16 21:32:01 +00:00
Robert Carr
c34aea875a SurfaceView: Check ViewRootImpl non-null
This call to updateRelativeZ may be triggered from the
RT frame callback which may be triggered after we are detached
from the Window and in that case will be null. If we are detached
we are also going invisible so there is no need
to set a relativeZ.

Bug: 158706756
Test: Existing tests pass
Change-Id: I46aa824807b7b275e6a015c428fe7467a72ca949
2020-06-16 11:47:07 -07:00
Tiger Huang
299734b637 Merge "Let animations of insets controller can be disabled" into rvc-dev 2020-06-16 14:31:41 +00:00
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
f23211979e Let animations of insets controller can be disabled
In some cases, System UI needs to hide navigation bar without any
animation, i.e. transitioning to AOD. This CL creates a method in
insets controller to disable/enable animations.

Fix: 150729581
Test: Enable AOD, and go to AOD from home screen by pressing power key.
Test: Enter/leave bouncer while screen is on.
Change-Id: I3fb7be898b9e615c661d07eca97c9ffcb6bbf8c3
2020-06-15 19:36:37 +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