Commit Graph

2368 Commits

Author SHA1 Message Date
Mariia Sandrikova
7617679a61 DO NOT MERGE Revert "[2/n] Camera Compat UI: Add interfaces for client-server..."
Revert submission 16468379

Reason for revert: Feature development is moving to T.

Reverted Changes:
Id9b9a8930:[3/n] Camera Compat UI: Add a camera compat contro...
Id6be4a954:Enable a camera app compat control on Large screen...
I083aa6718:[2/n] Camera Compat UI: Add interfaces for client-...

Bug: 206602997

Change-Id: I9ad876043fd61f708a8f468fffd1ef371bfa0866
2022-01-13 15:21:38 +00:00
Mariia Sandrikova
24f4d8a952 [2/n] Camera Compat UI: Add interfaces for client-server communication.
Changes:
- Listens to changes from the client coming through IActivityClientController#requestCompatCameraControl to ActivityRecord#updateCameraCompatState
- ActivityRecord#updateCameraCompatState sends updated state via TaskInfo to WM Shell
- ITaskOrganizerController#updateCameraCompatControlState to dispatch the user interactions with the control from WM Shell triggers callback to ActivityRecord#updateCameraCompatStateFromUser
- ActivityRecord#updateCameraCompatStateFromUser remembers the user's choice and asks client to apply treatment through ICompatCameraControlCallback

Feature is guarded with config_isCameraCompatControlForStretchedIssuesEnabled

Test: atest WMShellUnitTests:ShellTaskOrganizerTests, atest WmTests:ActivityRecordTests
Bug: 206602997
Change-Id: I083aa6718bd67456bedd9444e9b78740c041f870
2021-12-17 00:18:57 +00:00
TreeHugger Robot
3a1a4dbf89 Merge "CameraServiceProxy: Query recent tasks for top activity data" into sc-v2-dev 2021-12-10 18:58:45 +00:00
Emilian Peev
baeaad66d0 CameraServiceProxy: Query recent tasks for top activity data
Certain top activities will not trigger the "onTaskMovedToFront"
callback which can result in incorrect resizeability
queries. This can happen when a new activity is launched in the top
task.
To avoid this, retrieve the necessary information via the reported
recent tasks by activity manager for a given user id.

Bug: 203044281
Test: Manual using camera application

Change-Id: I61efd4282a2231e6354e5514fc25d7d27005335b
2021-12-09 10:16:04 -08:00
Issei Suzuki
bdc4e842cf Clean up windows which stuck in animatingExit state.
WM delays to destroy window surface if the window is running an exit
animation, and clean it up after the animation finishes. In case the
clean up process was not triggered, we do it before starting an app
transition.

Note that this is a safe guard for potential bugs. The surface shall
be destroyed as soon as an animation finishes, so the clean up should
have been done before an app transition starts.

Bug: 205335975
Test: atest AppTransitionControllerTest
Change-Id: I9c37ab9ebc57ef48827df25ecc52bf09101ad419
2021-11-24 12:54:13 +01:00
Hongwei Wang
0a53b766cb Allow auto-pip on launching new Task from TaskBar
Loosen the check on FLAG_RESUME_WHILE_PAUSING in
TaskFragment#startPausing for auto-enter-pip.

Fixed also the round corner radius calculation in WMShell component for
entering PiP transition.

Bug: 198227082
Bug: 202574512
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/bEPWcJSn8iGbLLNg6cM0E3
Test: no auto-enter on quick switch and does on launching new Task,
      see video for details
Test: atest PinnedStackTests#testAutoPipOnLaunchingAnotherActivity
Change-Id: I53e62a5f6e663b2d6df8cd0aaa858ff01ef073e8
2021-11-18 10:50:29 -08:00
Oscar Azucena
758a68da66 RESTRICT AUTOMERGE: Fixed permission issue in car shell
- Added missing private app permission to car shell.

Bug: 205404459
Test: m -j, flash device, boot completes
Change-Id: I23f3a890b4b28b758f6cce4ad63ef84bcda64427
2021-11-07 03:45:33 +00:00
TreeHugger Robot
91da8a2976 Merge "RESTRICT AUTOMERGE Fix the bootloop happening due to missing permission." into sc-v2-dev 2021-10-30 04:03:01 +00:00
Gaurav Bhola
9a2c897fea RESTRICT AUTOMERGE Fix the bootloop happening due to missing permission.
- This was missed during cherry-pick from master.

Bug: 187720593
Test: Manually verified by building and observing no bootloop.
Change-Id: Ib36186380ce6d786b0f0272b8866b5eab51920c2
2021-10-30 00:20:56 +00:00
Issei Suzuki
3e469aec5a Add display sleep token information to winscope dump.
Change-Id: Ia25854feed3bb6b037d4510a6b5000d906d27313
Merged-In: Ia25854feed3bb6b037d4510a6b5000d906d27313
Bug: 198593156
Test: manual. capture winscope dump and see it.
2021-10-26 12:13:37 +02:00
Evan Rosky
c6d5abe414 Fix PiP Shell Transitions
PiP Shell Transitions needs to be more robust to pass CTS tests
reliably.

Some changes:

1. DELIVERED_TO_TOP intents don't create a transition since there is
   no change to the WM hierarchy. This way the app-launch transition
   won't conflict with activityRestartAttempt.

2. If PiP started an expand transition while an enter transition is
   ongoing, cancel the enter transition.
   a. Additionally, because PiP doesn't resize task until the enter
      transition finishes, the expand transition will actually be
      a no-op. If we see this pattern, also cancel the enter
      transition.

3. When taskVanished, make sure to call any pending finishCallback
   because it doesn't allow the running animator to properly finish.
   Transition systems require the finish callback to function
   properly.

4. Minimize the uses of finishTransition with a sync callback. We
   probably need to phase this out because it can conflict with
   subsequent startTransition calls (because only 1 sync is supported
   at a time).

Bug: 183993924
Test: atest PinnedStackTests
Change-Id: Ieb573032839a2f31b0bb371410484fc93a1714fa
2021-10-19 15:50:41 -07:00
Issei Suzuki
cd9c90750a Merge "Migrate WALLPAPER_LIGHT debug message to ProtoLog." into sc-v2-dev 2021-10-12 15:09:42 +00:00
Issei Suzuki
bde317e6b1 Migrate WALLPAPER_LIGHT debug message to ProtoLog.
Test: manual
Bug: 191438572
Bug: 202392340
Change-Id: Ibf538fce834715dc32741f4b52808f99020f741e
2021-10-12 09:38:58 +02:00
Chris Li
53e7502809 Don't override with TasmFragmentRemoteAnimation for wallpaper/non-app
We don't want to allow the client to animate for wallpaper or any
non-app windows.

Bug: 201482129
Bug: 196173550
Test: atest WmTests:AppTransitionControllerTest
      #testOverrideTaskFragmentAdapter_noOverrideWithWallpaper
Change-Id: Ic29db59fc9f9695df9c8ba3a6d812ad217cdd641
2021-10-12 10:03:29 +08:00
Yuncheol Heo
e5581e9925 RESTRICT AUTOMERGE: Give the priv permission CONTROL_CAR_APP_LAUNCH to KitchenSync and CarLauncher.
- The permission is need to assign an Activity to TDA in CarLauncher.
- The permission is used in CarActivityManagerTest.

Bug: 200044674
Test: atest CarActivityManagerTest.
Change-Id: I1d5d520ec44f86c1220e89a0a756757d96676da6
2021-10-06 21:15:45 -07:00
Chris Li
54d2b20371 Allow organizer to handle transition for non-embedded activity
We want to allow organizer to handle the transition in case like
launching split TaskFragments from a non-embedded activity.

Bug: 200496784
Test: atest WmTests:AppTransitionControllerTest
Test: test with demo app to launch split from non-embedded
Change-Id: Iaf1d07c8cf43fa773fede3c031855085147be263
2021-09-30 20:12:50 +08:00
Chris Li
abdb320b70 Merge "Don't start app transition when there is empty TaskFragment" into sc-v2-dev 2021-09-24 03:34:03 +00:00
Keun young Park
5ffbc2c1c5 add CONTROL_APP_BLOCKING permission to car ks app.
- This is for testing purpose.

Bug: 193247516
Test: build, check boot up
Change-Id: I6c6d860a4b884d8856ede3aa4c73c64a9c568dd5
Merged-In: I6c6d860a4b884d8856ede3aa4c73c64a9c568dd5
(cherry picked from commit d8a331bdcb)
2021-09-23 23:39:44 +00:00
Chris Li
c6ab0bb710 Don't start app transition when there is empty TaskFragment
TaskFragment can be empty for either 1. wait for new launch activity, or
2. last activity just removed.

For 1, we want to wait for the activity launch.
For 2, we want to wait for organizer to remove the TaskFragment.

Bug: 196173550
Test: atest WmTests:AppTransitionControllerTest
      #testTransitionGoodToGoForTaskFragments
Change-Id: I73ac239ef2e5a75d05af6f6ae97e3f2278ebb4c3
2021-09-23 21:53:55 +08:00
Vishnu Nair
d6f2c5882f WM: Handle primary display orientation when calculating the transform hint
Query the surface flinger property
ro.surface_flinger.primary_display_orientation to determine the
primary display's install orientation. If the window is on the
primary display, then update the transform hint passed on to the
client.

Bug: 196167822
Test: check initial buffer transforms on displays with a different
install orientation

Change-Id: Idf010cd6be73172ba708820f87046c3ba3cf8001
2021-09-22 17:06:10 +00:00
Evan Rosky
e7b6834733 Merge "Don't let IME move to recents activity during recents transition" into sc-v2-dev 2021-09-13 19:37:56 +00:00
Rui Qiu
936f28842e Merge "[RESTRICT AUTOMERGE][CarTelemetryService] Add permission to kitchen sink for CarServiceTest" into sc-v2-dev 2021-09-08 17:04:49 +00:00
Evan Rosky
e02fc4cbba Don't let IME move to recents activity during recents transition
In shell transitions, recents opens on top, but in transient mode
(meaning it doesn't cause the other apps to pause). This means the
other apps should be running un-interrupted. This includes not
taking the IME away.

To handle this, adjust the IME logic so that transient-launching
activities are NOT canBeImeTarget.

Also fix a bug in isVisibleOrAdding where it was using
visibleRequested instead of visible (if you look at the change
history, !hiddenRequested was incorrectly replaced by
visibleRequested instead of visible).

Also fix a bug where a defer/continue of updateImeTarget was
updating the target even when an update was never requested while
it was deferred. This was causing it to be called prematurely
during activitystarter (where global lock is held).

Bug: 193565597
Test: atest ReOpenImeWindowTest SwitchImeWindowsFromGestureNavTest
Change-Id: Ic537d77c8b0e10e80444dd46d7b49e5a9bd63d6c
2021-09-07 11:33:50 -07:00
Rui Qiu
2fbcfd327b [RESTRICT AUTOMERGE][CarTelemetryService] Add permission to kitchen sink for CarServiceTest
Adds the USE_CAR_TELEMETRY_SERVICE permission to the allowlist.
This permission is needed for CarTelemetryManagerTest to pass. Otherwise
there will be a security exception whenever the CarTelemetryManager API
is invoked.

Bug: 198309792
Test: atest CarServiceTest:CarTelemetryManagerTest in ag/15752577

Change-Id: I4f95c71f0d9c1891f600e83f7f90f33144300a5c
2021-09-07 18:29:12 +00:00
Naomi Musgrave
fcef782559 [MediaProjection] Do not start layer mirroring without a surface
An app may pass a null surface to MediaProjection#createVirtualDisplay,
and later set the surface on the VirtualDisplay. The display's state
will change from off to on when the surface is set.

When determining if layer mirroring should be started/updated in
DisplayContent, take the presence of the surface/display state
into account, to prevent the app from crashing.

Bug: 197863746
Test: atest WmTests:DisplayContentTests
Change-Id: I01af07fff681aab6fc8235c861375eb79118cbfe
2021-09-03 14:42:52 +01:00
Chris Li
9541f4a48a Merge "Allow TaskFragmentOrganizer to set remote animation" into sc-v2-dev 2021-08-31 17:49:33 +00:00
Ming-Shin Lu
6902904e97 Refine WindowInsets logs
- Add WM_DEBUG_WINDOW_INSETS ProtoLogGroup to use for logging
  general Insets logs in WM core.
- Refine InsetsSourceProvider#updateVisibility proto log format
  to add insets type information.
- Add InsetsSurceControl#toString to print control target info.

Bug: 197189357
Test: adb shell wm logging enable-text WM_DEBUG_WINDOW_INSETS
Test: atest ProtoLogImplTest \
            ProtoLogViewerConfigReaderTest \
            WmTests:ProtoLogIntegrationTest \
            LogDataTypeTest \
            protologtool-tests
Change-Id: I1f01ce4d9fe5cb17f7bd60a424689260682b1dfc
2021-08-30 22:43:46 +08:00
TreeHugger Robot
a1a0c3c59a Merge "Grant CHANGE_COMPONENT_ENABLED_STATE permission for CarLauncher app." into sc-v2-dev 2021-08-28 01:44:15 +00:00
Chris Li
14ac35839a Allow TaskFragmentOrganizer to set remote animation
When all windows in the transition is belong to organized TaskFragments,
have the TaskFragmentOrganizer to control the animation on client side.

Bug: 196173550
Test: atest WmTests:TaskFragmentOrganizerControllerTest
Test: atest WmTests:AppTransitionControllerTest
Change-Id: I835467e23863286a5bd34380424cc9eca2c7372f
2021-08-27 12:02:45 -07:00
Lakshman Annadorai
4e537fb6c1 Grant CHANGE_COMPONENT_ENABLED_STATE permission for CarLauncher app.
Test: Launcher can enable apps.
Bug: 195697674

Change-Id: Iea613b997921934b2d8b0b29f699a266838fa4b9
2021-08-26 16:48:48 +00:00
Louis Chang
40fc6de5a7 Keeps the intercepted activity on the existing secondary container
When intercepting an activity start request, a new split pair
was always created and launch the activity to the side of the
caller activity.

This CL launches the activity on top of the caller activity
if the caller activity is already on the secondary container.

This is needed for the case that the activity is started
into a new Task, or new Task will be escaped from the current
host Task and be displayed in fullscreen.

However, the interception won't work if the activity is started
from another process.

Also adding logs for TaskFragment errors.

Bug: 194997356
Test: manually, start activity with sample app
Change-Id: I268c1dad191cdfdbf48cac84e18f1dfda761b0d3
2021-08-13 13:47:06 +08:00
Chris Li
8c67051b97 Do not preload recents activity if it will be visible
Before, even if the launcher was not launched, RecentsAnimation would
start the activity in background as invisible. It would cause issue
because ensureVisibility would make it visible because there is no
opaque activity on top, while that may not be collected in any app
transition.

Now, in case the recents activity should be visible, we ignore the
 preload recents activity.

Bug: 193565751
Test: pass failed launcher test
Change-Id: I93f5a716177bcbf69f5e4d5915826bd9f61f53a4
2021-07-20 23:48:51 -07:00
Evan Rosky
466cda4ec3 Add multi-display support to shell transitions
This tracks ready state in groups. Currently the groups are
display-contents (to match legacy transitions). The transition
will be considered ready when all groups are ready.

This also adds a couple of inTransition checks in places that
are used by CTS tests.

Bug: 183993924
Test: atest MultiDisplaySystemDecorationTests
Change-Id: Iea81b3c689d948d60aa8e1a2d3bf168723058a2f
2021-07-11 17:49:36 -07:00
Grace Cheng
34f39c86ba Merge "Grants WRITE_SECURE_SETTINGS permission to AdasLocationTestApp" into sc-v2-dev 2021-07-09 23:53:49 +00:00
Nikita Ioffe
454d31beff Merge "Grant INSTALL_PACKAGE_UPDATES permission to Shell" into sc-dev am: 1d2cbb6f50
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15235316

Change-Id: Ia145803bd4b9db56e12833ec324a77d9fd313bf1
2021-07-09 11:42:34 +00:00
Louis Chang
cac8caf2bd Merge "Allow changing focus between embedded activities in a Task" into sc-v2-dev 2021-07-09 05:08:42 +00:00
Nikita Ioffe
65eb22cc56 Grant INSTALL_PACKAGE_UPDATES permission to Shell
Bug: 188062003
Test: m
Change-Id: I342f64e666afa4202b8af69f04d64b05d40fac40
2021-07-09 00:52:08 +01:00
Grace Cheng
be8d77ab5c Grants WRITE_SECURE_SETTINGS permission to AdasLocationTestApp
Test: manually.
Bug:191180940

Change-Id: I2bd96a9a87fdbb079b1182a4c36f5a212732447e
2021-07-08 23:44:14 +00:00
Chris Li
e7ed99bfc2 Merge "Remove TaskInfo#topActivityToken usage in size compat for security" into sc-dev 2021-07-08 18:05:40 +00:00
Chris Li
1245aefa49 Remove TaskInfo#topActivityToken usage in size compat for security
Security report shows that this can cause leak token of different app.

Replace the functionality with a callback to the TaskOrganizerController
to restart activity when size compat restart button is clicked.

Bug: 186776724
Test: manually verify the restart button still works
Change-Id: I097b9f02e8435e6765695b9d5a531a4e165bac66
Merged-In: I097b9f02e8435e6765695b9d5a531a4e165bac66
2021-07-07 21:09:24 -07:00
Louis Chang
73d277117d Allow changing focus between embedded activities in a Task
The focused window was determined by looking up the focusable windows
from top to bottom.

In order to switch the focus between the embedded activities in the
same leaf Task without reordering the position of the activities, the
focused app can also be updated based on the window that user was
touched, and the focusable windows that were on other TaskFragment
in the same Task cannot be focused.

Bug: 189385926
Test: changing focused app by touching embedded activity
Change-Id: Id84461572cc768f474ffa313da1c10ff4010408e
2021-07-08 11:37:47 +08:00
Chris Li
ae54032e9a Remove TaskInfo#topActivityToken usage in size compat for security
Security report shows that this can cause leak token of different app.

Replace the functionality with a callback to the TaskOrganizerController
to restart activity when size compat restart button is clicked.

Bug: 186776724
Test: manually verify the restart button still works
Change-Id: I097b9f02e8435e6765695b9d5a531a4e165bac66
2021-07-07 12:50:53 -07:00
TreeHugger Robot
dbd662eb1e Merge "Add READ_PRIVILEGED_PHONE_STATE to dialer" into sc-dev am: b3075bc5dc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14908986

Change-Id: Ib142f1e5a7df1631341295058a5a6a8660666b32
2021-07-01 21:48:48 +00:00
TreeHugger Robot
b3075bc5dc Merge "Add READ_PRIVILEGED_PHONE_STATE to dialer" into sc-dev 2021-07-01 21:45:06 +00:00
TreeHugger Robot
660f78ebf8 Merge "Give Shell the NOTIFY_PENDING_SYSTEM_UPDATE permission" into sc-dev am: 69a0939764
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15107816

Change-Id: If6acdea694ed3ba9972ec1bccd05b514a42125c3
2021-06-29 17:03:52 +00:00
TreeHugger Robot
69a0939764 Merge "Give Shell the NOTIFY_PENDING_SYSTEM_UPDATE permission" into sc-dev 2021-06-29 16:57:01 +00:00
Alex Kershaw
1f5ef8e31d Give Shell the NOTIFY_PENDING_SYSTEM_UPDATE permission
This is required for GTS testing it, rather than having to instrument
GMS Core.

Bug: 182271592
Test: tested as part of other CLs in this topic
Change-Id: Id56e0d206afe0a9069d1510a3dae9a07141fff60
2021-06-29 11:52:04 +01:00
Kohsuke Yatoh
200f796356 Merge "Extract flag font from NotoColorEmoji" into sc-dev am: 80a8cf86c0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14970179

Change-Id: If931b95a73d977ee2bd7d0389e7a78d5b1dca2b2
2021-06-29 00:57:43 +00:00
Kohsuke Yatoh
80a8cf86c0 Merge "Extract flag font from NotoColorEmoji" into sc-dev 2021-06-29 00:40:27 +00:00
Peter Li
8a21ab4d9b Add READ_PRIVILEGED_PHONE_STATE to dialer
Fix: 192017986
Bug: 188396041
Test: Manual

Change-Id: I5f85013c7373093030961392e61e86bc7376b346
2021-06-28 22:35:44 +00:00