Commit Graph

17054 Commits

Author SHA1 Message Date
TreeHugger Robot
60422ba05a Merge "Revert "[RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent"" into sc-v2-dev 2021-11-11 14:13:01 +00:00
Alex Chau
930739c45a Revert "[RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent"
This reverts commit 71b2172abc.

Reason for revert: See b/205859784, breaks launcher tests
Bug: 205859784
Bug: 194262507
Bug: 191064581

Change-Id: Iaac32bd4142c0539300725dc2f6e4255fefc8b2f
2021-11-11 10:09:10 +00:00
Ryan Lin
f9e1f3b1a1 Merge "Fix magnification border includes taskbar" into sc-v2-dev 2021-11-11 01:56:21 +00:00
Winson Chung
35b8e2b997 Merge "Add multi-task support to recents-animation task-appeared" into sc-v2-dev 2021-11-10 17:05:46 +00:00
ryanlwlin
6092dd0be7 Fix magnification border includes taskbar
The window type of the Taskbar is navigation_bar_paenel, which
is unmagnifiable. However, we used to exclude these windows from
magnification region computation to avoid cutout.

When the foldables is unfolded, the taskbar wouldn't cause the cutout.
To fix this problem, so we add a flag to distinguish the windows
that cause the cutout.

Bug: 196510717
Test: manual test
      atest AccessibilityManagerServiceTest
Change-Id: I882bf48585f646cee5827044c88da37250041c0f
Merged-In: I882bf48585f646cee5827044c88da37250041c0f
(cherry picked from commit dc9b90f46a)
2021-11-10 09:52:44 +00:00
TreeHugger Robot
5b210b31f0 Merge "[RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent" into sc-v2-dev 2021-11-10 07:47:53 +00:00
Charles Chen
71b2172abc [RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent
Before this CL, SystemUiContexts were fixed to the Display metrics
when the SystemUiContexts were created. It is the same mechanism
as DisplayContext but applies to SystemUiContexts unexpectedly.
This CL makes SystemUiContexts associate with DisplayContent with
the corresponding display ID. In this way, SystemUiContext would
receive updates when there is a Display property change.

Bug: 194262507
Bug: 191064581
Test: atest InputMethodMenuControllerTest WindowContextControllerTest

Change-Id: Idd74da965c18bdbf8912bd45e89be21f652dcf93
2021-11-10 14:19:53 +08:00
Rob Carr
eba32bb22f Merge "DO NOT MERGE: ViewRootImpl: Add P2P sync primitive" into sc-v2-dev 2021-11-10 00:49:51 +00:00
Robert Carr
e5d1324755 DO NOT MERGE: ViewRootImpl: Add P2P sync primitive
Expose consumeNextDraw from ViewRootImpl to enable
one-off sync between two ViewRoots.

Bug: 201046726
Test: Existing tests pass
Change-Id: Iaf30830dc529eac83276a76d1908a06d12175b00
2021-11-09 21:37:48 +00:00
Evan Rosky
1258abfefc Add multi-task support to recents-animation task-appeared
Allows handling of app-pairs

Bug: 204094785
Test: Existing RecentsAnimation tests pass
Change-Id: Ie71fa994912a67a6b15c2f1e2dc1959473f52b15
2021-11-08 18:30:17 -08:00
Chavi Weingarten
41d736717e Merge "Call applyTransactionOnDraw when removing SV" into sc-v2-dev 2021-11-08 23:35:55 +00:00
Jerry Chang
b1626ac345 Merge "Snapshot all tasks in pending recents animation when rotating devices" into sc-v2-dev 2021-11-08 10:22:34 +00:00
Tiger Huang
92b3fbcdb7 Merge "Make sure mParent is not null before using it" into sc-v2-dev 2021-11-05 14:41:54 +00:00
Jerry Chang
79090d6930 Snapshot all tasks in pending recents animation when rotating devices
Since both of splitting tasks in split screen go to overview together
now, update to snapshot all pending animations when rotating while
showing overview to ensure both of splitting task snapshots are taken
with proper bounds before rotation.

Bug: 200813008
Test: atest RecentsAnimationControllerTest
Test: enter overview after activated split screen, observed task
      thumbnails showing with correct bounds after roation.
Change-Id: Id1101bf8be67593f85a43c1d4afae769ffc737d3
2021-11-05 22:32:34 +08:00
Pablo Gamito
0759523698 Merge "Account for task and inset crops in default legacy task animations" into sc-v2-dev 2021-11-05 13:39:19 +00:00
chaviw
6b1b599f30 Call applyTransactionOnDraw when removing SV
When SV is detached, we will try to clean up the SurfaceControls.
However, we want the clean up to be synced with the main app window.
This is to ensure we don't remove SV's SC before the
app window draws in the hole punched area.

Instead of relying on postionLost to synchronize with the main app
window, we can use applyTransactionOnDraw to ensure the next frame will
merge the remove transaction. Therefore, we no longer have to call
remove in positionLost since it's already handled elsewhere.

Test: No flicker when removing SV
Bug: 199860472
Change-Id: I93a91c45c862949e53ee9fd1b4a3b10404fba6bb
2021-11-04 17:46:35 -05:00
Tiger Huang
751839bd2a Make sure mParent is not null before using it
Otherwise, there will be NullPointerException.

Fix: 204883084
Test: Run the following code and see if it crashes.
  ViewGroup v = new FrameLayout(context);
  v.requestTransparentRegion(v);
  getWindowManager().addView(v, attrs);
  getWindowManager().removeView(v);
Change-Id: I059e13d2a258cf85dbc1694fb79b6088199de3fb
2021-11-04 17:26:04 +00:00
Jordan Demeulenaere
94204aa474 Merge changes from topic "dialog-aod" into sc-v2-dev
* changes:
  Resize dialogs when the configuration changes
  Disable dialog exit animation when locking (1/2)
2021-11-04 13:04:31 +00:00
Rob Carr
bec1fdfcd0 Merge "DO NOT MERGE: ViewRoot/BBQ: Cleanup flushShadowQueue" into sc-v2-dev 2021-11-03 21:51:50 +00:00
Robert Carr
bda55e3262 DO NOT MERGE: ViewRoot/BBQ: Cleanup flushShadowQueue
It's already a noop, we just never cleaned up the
frameworks/base side.

Bug: 200285149
Test: Existing tests pass
Change-Id: I7d79404f93a9386b16fb9770bbd7290dfb236cc0
2021-11-03 17:54:11 +00:00
Winson Chung
292ed69c65 Merge "Revert "Do NOT MERGE Fix magnification border includes taskbar"" into sc-v2-dev 2021-11-03 16:49:07 +00:00
Alex Chau
8f2824fc72 Revert "Do NOT MERGE Fix magnification border includes taskbar"
Revert submission 16003793-magnification_border

Bug: 196510717
Reason for revert: Caused NexusLauncherTests and NexusLauncherOutOfProcTests to stop running
Reverted Changes:
Ibbc9c51ea:Do NOT MERGE Fix magnification border includes tas...
Ida2bb5bf1:DO NOT MERGE Fix the cutout of magnification borde...

Change-Id: Id61a370271f94b4a379709226a90e29bc5dfa4b3
2021-11-03 14:19:23 +00:00
Jordan Demeulenaere
2642eed1f1 Resize dialogs when the configuration changes
Before this CL, system dialogs would not react to configuration changes,
which would cause weird UI issues when folding into a smaller screen.

This CL makes all SystemUIDialog's listen for configuration changes, and
resize their window accordingly.

Bug: 204042506
Test: Manual
Change-Id: I4cf1dbfff2a95c83ed3e240d165eae60660c429b
2021-11-03 14:44:21 +01:00
Pablo Gamito
abeab16373 Account for task and inset crops in default legacy task animations
This is to make sure that the task animation looks good and consistent
when the taskbar is and isn't visible

Test: Check task transitions animations look ok both when taskbar is and
isn't present
Bug: 200675009

Change-Id: I8ff70271a81dcdf329849907175691f901edc1d9
2021-11-03 14:01:40 +01:00
TreeHugger Robot
52c1467044 Merge "Fix unexpected hide IME cases" into sc-v2-dev 2021-11-03 08:01:36 +00:00
ryanlwlin
fa486cd228 Do NOT MERGE Fix magnification border includes taskbar
The window type of the Taskbar is navigation_bar_paenel, which
is unmagnifiable. However, we used to exclude these windows from
magnification region computation to avoid cutout.

When the foldables is unfolded, the taskbar wouldn't cause the cutout.
To fix this problem, so we add a flag to distinguish the windows
that cause the cutout.

Bug: 196510717
Test: manual test
Change-Id: Ibbc9c51ead9ea492f1f2e598587b21dd28d30a2b
2021-11-03 10:12:23 +08:00
Ming-Shin Lu
fac4cdfce6 Fix unexpected hide IME cases
When testing testImeSwitchingWithoutWindowFocusAfterDisplayOffOnFull on
the virtual device, the test flows will be:
1) Launch an activity and click the editor to show IME
2) Turn off/on the screen
3) Launch the IME picker dialog and expecting no window focus change.
4) Switch to another IME app and expect the IME visible after switched.

Somehow the flaky point is in step 4) that if attaching the new input
to show the IME comes first, before the input target updated to WM,
in the meantime the app received onControlChanged
callback with null control from WMS#relayoutWindow, then in
ImeInsetsSourceConsumer#setControl -> hide() will end up calling
notifyImeHidden for IME to invoke hideMySoftInput(), which is
not expected result.

As this unexpected IME hidden issue is related the timing issue of
updating IME targets to WM a bit late and showing IME request happends
from IMMS instead of from ImeInsetsSourceConsumer#requestShow.
(i.e. consumer#hide() be invoked when mIsRequestedVisibleAwaitingControl
is false but the control is null when setControl called)

To fix this issue case, it looks make sense to check with
ImeInsetsSourceConsumer#isRequestedVisibleAwaitingControl() when the
null control callback in setControl(), since
isRequestedVisibleAwaitingControl() will be true when requested the IME
visible, so that it won't fall into hide() logic.

Also, modified "Animation finished abruptly." debug log in
InsetsAnimationControlImpl#applyChangeInsets to print only when the
animation actually finished, since it does not make sense to print
when the animation is not finish.

Fix: 204524304
Test: atest InputMethodServiceLifecycleTest#\
        testImeSwitchingWithoutWindowFocusAfterDisplayOffOnFull \
          --rerun-until-failure 100

Change-Id: I3071af14bf78e23f9526d6a9c138ab6ae2e0e339
2021-11-02 16:19:18 +00:00
Pablo Gamito
398ef465ba Merge "Add API to allow SysUI/launcher to customize legacy task transition animations" into sc-v2-dev 2021-10-26 21:32:16 +00:00
Joanne Chung
64f6b76051 Fix showing translated text if user switch back to original lauguage quickly.
Fixes the bug if the translation service spending more time to deal
with the translation but user switches back to original lauguage
quickly, we will show translated text.

When the response back, if the translation state is finished, we drop
the result. If the state is pause, we update the response but we do
not call onShowTranslation to translated text.

Bug: 200251777
Test: atest CtsTranslationTestCases
Test: manual. Try to send request late and switch back original
language, it keeps original. Then it works fine when switch between
the source and target languages.

Change-Id: I780456f091884c61e5801ead3ff021531fee87b4
2021-10-26 03:54:45 +00:00
Wei Sheng Shih
e9ca409903 Merge "Only register listeners if setView was success." into sc-v2-dev 2021-10-26 00:34:57 +00:00
wilsonshih
1c833479dd Only register listeners if setView was success.
Found a memory leak on ViewRootImpl. If the view wasn't been set
to the VRI successfully, there would keep the registed listeners to the
AccessibilityManager and DisplayManager forever because there didn't
need to deatch anything from window.
Another reasonable way is to register all listeners after setView
success.

Bug: 200843755
Test: manual, hard code to force addWindow fail and monitor no more
ViewRootImpl object leaked to AccessibilityManager and DisplayManager.

Change-Id: I3c9cc52d0ca4595c74c1dc3c51d286d9e6e3897f
2021-10-21 09:47:01 +08:00
Brian Isganitis
e712904779 Merge "Expose mirror of wallpaper surface in WindowManagerGlobal." into sc-v2-dev 2021-10-19 23:47:17 +00:00
Brian Isganitis
5e3d35c102 Expose mirror of wallpaper surface in WindowManagerGlobal.
Test: Manual
Bug: 188222480
Change-Id: I92302053a797de76aec3c2a25e5d895cfc85e6d5
2021-10-19 15:27:55 -04:00
Sally Yuen
349f251acf Merge "Add drag and drop event ids to intdef" into sc-v2-dev 2021-10-18 21:37:45 +00:00
TreeHugger Robot
6ba778585f Merge "Synchronize screen turning on and unfold overlay" into sc-v2-dev 2021-10-18 12:28:26 +00:00
Nick Chameyev
c055dbb324 Synchronize screen turning on and unfold overlay
Changes unfold overlay implementation from a window
to surface control view host. To make sure that the
unfold overlay is drawn by the time when we remove
screen blocker we synchronously apply a transaction
with drawn overlay and apply another empty transaction
with vsyncId+1.

Also these changes disable the unfold transition when
using power button by filtering only first screen turning
on events after unfolding the device.

Bug: 197538198
Test: manual fold/unfolds
Test: killing SysUI process, checking rotation animation, magnification
Test: atest com.android.systemui.unfold.updates.DeviceFoldStateProviderTest
Change-Id: I8e0bc635b041595602145b313548b14fcabd157e
2021-10-15 12:55:16 +00:00
Sally Yuen
d05867d498 Merge "check for null listenerInfo for drag&drop" into sc-v2-dev 2021-10-14 20:35:23 +00:00
Vishnu Nair
fb19c89e4d Merge "ViewRootImpl: Replace usage of orientation with buffer transform for transform hint" into sc-v2-dev 2021-10-14 14:38:56 +00:00
Naomi Musgrave
a77d7425a4 PossibleMaximumWindowMetrics reports physical display insets for each
DisplayInfo (current and non-current display)

Changes behaviour from dumbly applying the insets of the current
DisplayInfo to all other DisplayInfo, to reading the insets of each
DisplayInfo into WindowMetrics. Additionally, applies the appropriate
rotation to the insets of each DisplayInfo, so the WindowMetrics
contain the correctly-rotated insets.

Bug: 201546646
Test: Manual
Change-Id: I5756a768b7544939d55d5759f838b27278ca1da6
2021-10-14 07:57:39 +00:00
sallyyuen
9e99ecb34d Add drag and drop event ids to intdef
Also add events to string method

Bug: 202102219
Test: n/a
Change-Id: Ia094f0b007a5158eb6b6911d834d35ef31795776
2021-10-13 06:52:18 -07:00
Wei Sheng Shih
f754d5df69 Merge "Fixes the flicker when transfer splash screen view to client" into sc-v2-dev 2021-10-13 09:32:59 +00:00
Pablo Gamito
efbec5ac8b Add API to allow SysUI/launcher to customize legacy task transition animations
Launcher needs to be able to customize the task transition to:

1. set the background color during task transitions to the taskbar color when the taskbar is visible.

and, temporarily, at least until tasks have rounded corners rather than being an overlay in the taskbar, we need:

2. a way to specify how much to crop the task by so that the task's rounded corners are visible above the taskbar during animation

3. a way to specify how much to crop the taskbar by so that the taskbar's rounded corners overlay is not visible over the tasks during the animation

Test: None
Bug: 200675009
Bug: 196387647
Merged-In: Ifb7f89e7fde47155eb987161fbbe30e7144103ab
Change-Id: Ifb7f89e7fde47155eb987161fbbe30e7144103ab
2021-10-12 20:47:53 +02:00
Vishnu Nair
1cc70404b1 ViewRootImpl: Replace usage of orientation with buffer transform for transform hint
Fixes: 202797234
Test: atest VulkanPreTransformTest#testVulkanPreTransformNotSetToMatchCurrentTransform
Change-Id: Iddb2e0b045096b4b86c0bc3f8222b61de67994bc
2021-10-12 09:44:15 -07:00
TreeHugger Robot
492bdf0074 Merge "Rename getSurfaceTransformHint API and switch to using NDK transform constants" into sc-v2-dev 2021-10-12 00:35:32 +00:00
Vishnu Nair
8eb0c64cf4 Rename getSurfaceTransformHint API and switch to using NDK transform constants
NDK exposes ANativeWindowTransform/NATIVE_WINDOW_TRANSFORM_*. These
constants are aligned with HAL definitions and are used internally to
specify buffer transforms. Native consumers of the transform hint
 are expected to generate ANativeWindowTransform from the hint.

Aligning the SDK and the NDK transform values will make the API
less confusing.

Bug: 196167822
Test: atest AttachedSurfaceControlTest
Change-Id: Ib20be045f6c8c6d7befef93a839a27098da55ffa
2021-10-11 16:28:20 -07:00
sallyyuen
84bcd89352 check for null listenerInfo for drag&drop
Bug: 201778218
Test: n/a
Change-Id: I9c50a429ee409e4a040c03bba9ac28729720a929
2021-10-11 07:23:08 -07:00
Joanne Chung
094b2085be Merge "Fix not show translation if call startTranslation after pauseTranslation" into sc-qpr1-dev am: e82a38a8ee
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16001112

Change-Id: Iaad1e9005b2442bd88a6f767fd774fea94bb26d9
2021-10-09 02:42:24 +00:00
Joanne Chung
5667540a7d Fix not show translation if call startTranslation after pauseTranslation
It is possible the developer calls pauseTranslation() to show the
original text but it calls startTranslation() to show translated
text. Ideally the developer should call resumeTranslation but it
also make sense to call startTranslation() to show translated text.

When receiving translation response, we avoid showing transaltion
if the view already has the response and it's the same. But it is
good to also check if the view is showing translated text or not.
If the view is not translated text, it is possible developer calls
startTranslation() instead if calling pauseTranslation() to show
translated again, the fixing can resolve this case.

The issue case can be fixed by this change. But there is a deeper
problem about it's useless the caller call finishTranslation(). This
is planned to be fixed in next release.

Bug: 201238016
Test: manual. The issue case is fixed.
Test: manual. Test some chat apps, it still works fine.
Test: atest CtsTranslationTestCases
Change-Id: I699d0fa1d60ac96db094adcc6e17f4203df03214
2021-10-07 06:04:06 +00:00
wilsonshih
379994b4f8 Fixes the flicker when transfer splash screen view to client
Use applyTransactionOnDraw to ensure all transaction happen
during the same frame, including
- hide the starting window.
- reparent the remote SurfaceView to client.

Bug: 198593932
Test: continues launch test app several times then verify with winscope
to ensure there is no flicker anymore.

Merged-In: I03c600afdc477ca0c8064b215f2b361468db9f3c
Change-Id: I03c600afdc477ca0c8064b215f2b361468db9f3c
2021-10-06 11:14:11 +08:00
Pablo Gamito
b88b5349d6 [DO NOT MERGE] Dump SurfaceControl's layerId to proto
Test: Data appears in Winscope
Bug: 197712697
Change-Id: Ida47f5506a56b19902fcaafc644d1df34ce6c4a3
(cherry picked from commit 120ee45bd0)
2021-09-30 13:31:22 +00:00