Commit Graph

14633 Commits

Author SHA1 Message Date
TreeHugger Robot
727d5a2f14 Merge "Animate IME with zero insets" into rvc-dev am: cc498f3e69 am: 5208fccc52
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11829827

Change-Id: I58c014806c75aa48c8ada10ede61ecdacdec2823
2020-06-20 17:29:45 +00: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
9a56fc9d77 Merge changes I4fdf368e,Ibc6be890 into rvc-dev am: 48dc192499 am: 6affc2707b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11932511

Change-Id: I467cdc91b8747234fc21241b2a2753bee4871488
2020-06-20 00:24:05 +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
cd350453d6 Merge changes Ia7d9514e,I3e9e4f47 into rvc-dev am: 5cc486b1a1 am: f3dfb52c65
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11920861

Change-Id: I0fa24dba86e7aad7dd4cc2315c7556dee88b44a3
2020-06-19 14:32:31 +00: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
8e1a8334a1 Merge "Fix the context leak in the ContentCapture" into rvc-dev am: 44b233c55d am: 8766dbaf8c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11882491

Change-Id: Ia9a003e3f59d8252e630fffe8782178839ffbebb
2020-06-19 07:02:08 +00:00
TreeHugger Robot
8766dbaf8c Merge "Fix the context leak in the ContentCapture" into rvc-dev am: 44b233c55d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11882491

Change-Id: I8c6f7cbb3e8467782d8fab29f40c86ce8f0e3871
2020-06-19 06:51:50 +00: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
e212052243 Merge "WM: Replace eEarlyWakeup flags with explicit eEarlyWakeup start and end flags" into rvc-dev am: 278f00319f am: 66bab75ea1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11852824

Change-Id: I19c91a7b9d2229f1fd95d58182cd1060d75cf060
2020-06-18 05:11:37 +00:00
Ady Abraham
66bab75ea1 Merge "WM: Replace eEarlyWakeup flags with explicit eEarlyWakeup start and end flags" into rvc-dev am: 278f00319f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11852824

Change-Id: Iae325723452bbb5ac9c941d8e84d95d0c80337b4
2020-06-18 04:51:35 +00: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
TreeHugger Robot
3d61c943b8 Merge "Revert "Add logs that indicate why a surface is invalid"" into rvc-dev am: d82080094e am: 0b235515ce
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11874469

Change-Id: Ia68ee7a6a29ecab20ffe97471398a3c93c58b6b1
2020-06-17 14:34:16 +00:00
TreeHugger Robot
0b235515ce Merge "Revert "Add logs that indicate why a surface is invalid"" into rvc-dev am: d82080094e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11874469

Change-Id: I744413842bbc74724268c1fe58187a74f4d90461
2020-06-17 14:15:17 +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
a95675bfcf Merge "SurfaceView: Check ViewRootImpl non-null" into rvc-dev am: 3764cbaac4 am: 38972ce1f6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11884759

Change-Id: If2e1fe9ee2983bd5414ca65a8777ce278a1474ae
2020-06-17 00:54:27 +00:00
TreeHugger Robot
38972ce1f6 Merge "SurfaceView: Check ViewRootImpl non-null" into rvc-dev am: 3764cbaac4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11884759

Change-Id: Iecdbbd14f2a4e78b1614b199efb4abd004c6445b
2020-06-17 00:38:07 +00:00
TreeHugger Robot
3764cbaac4 Merge "SurfaceView: Check ViewRootImpl non-null" into rvc-dev 2020-06-17 00:16:36 +00:00
TreeHugger Robot
a62362b295 Merge "Revert "Disable user animations on insets whose visible frame is empty"" into rvc-dev am: 11fcb1987a am: 37de161ec5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11883882

Change-Id: I87dcee6341c69226c000062e38b30a988b3064b7
2020-06-16 23:34:36 +00:00
TreeHugger Robot
37de161ec5 Merge "Revert "Disable user animations on insets whose visible frame is empty"" into rvc-dev am: 11fcb1987a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11883882

Change-Id: I2b97b5a88908579d3ff142fa21b1b41f59188b03
2020-06-16 23:18:15 +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
Yabin Huang
74f91531c8 Update FocusFinder am: 713af5fdd3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11825630

Change-Id: I7636504c50fa48e92e89f557461a35bd0aea015a
2020-06-16 17:41:50 +00:00
Tiger Huang
115e3a75a9 Merge "Let animations of insets controller can be disabled" into rvc-dev am: 299734b637 am: 3f6f662d51
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11570106

Change-Id: I9c5d977f49cb2f54a0bb9f1fcb8b100718e041c0
2020-06-16 14:56:03 +00:00
Tiger Huang
c448e5eba6 Merge "Let animations of insets controller can be disabled" into rvc-dev am: 299734b637
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11570106

Change-Id: I303066b63ad1397ff0d91d20db0586a01266afb5
2020-06-16 14:44:14 +00: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
94fe22f674 Merge "Trust System UI owned display to receive keys" into rvc-dev am: 94deecfda2 am: d09b0f10bf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11570100

Change-Id: Iac08bb390ee1a5d6bbfc02afdb57e980cdad7597
2020-06-16 14:29:09 +00:00
Charles Chen
dd7e0fded2 Merge "Trust System UI owned display to receive keys" into rvc-dev am: 94deecfda2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11570100

Change-Id: I93a7522c1ce94e379269b9a1a0de802916dcbb32
2020-06-16 14:14:14 +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
ad8e892660 Merge "Disable user animations on insets whose visible frame is empty" into rvc-dev am: ae9ce9716d am: 07d77fce08
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11754098

Change-Id: I73e27dead5774a4cf9ce4618ec8e5fdbea833416
2020-06-16 09:38:08 +00:00
Tiger Huang
f0ab382fae Merge "Disable user animations on insets whose visible frame is empty" into rvc-dev am: ae9ce9716d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11754098

Change-Id: Ib5fbf8e6412d1d46a9295adcffa30d9b6286e89a
2020-06-16 09:32:11 +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
2121d62ccd Merge "Let position of system bars can be restored by swipe" into rvc-dev am: ac4e36b948 am: 5078e7a8c1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11612964

Change-Id: I73e23ea1a5052d4f0afb02f58fae4bf3a91825e5
2020-06-15 09:34:02 +00:00
Tiger Huang
c298524cb0 Merge "Let position of system bars can be restored by swipe" into rvc-dev am: ac4e36b948
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11612964

Change-Id: Ie1912992be2ab8a3046b713b825753e1d63ca63b
2020-06-15 09:17:33 +00: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
dbe759768c Merge "Only add divider when it need to show" into rvc-dev am: a73d6ecb84
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11612936

Change-Id: I2274b246c949846a48d622090c17be3d0baed4b3
2020-06-12 03:24:57 +00: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
8b29418964 Merge "Fix content capture session id collision bug" into rvc-dev am: dd9c140ef5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11829309

Change-Id: Ibeaab73767ebb7f7bf0c35f5716c65c0c4b91de5
2020-06-12 00:24:13 +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
cb2b174838 Merge "Release SurfaceView surface if viewrootimpl surface is not valid" into rvc-dev am: 8089c3867e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11829307

Change-Id: I4b61eb8994f5f75fe0f38c54c874d90d2396f0ae
2020-06-11 18:45:28 +00:00