Commit Graph

23421 Commits

Author SHA1 Message Date
Julia Reynolds
e01425ec92 Merge "Fix binder error when an app has many channels" into tm-qpr-dev 2022-07-21 20:30:21 +00:00
Louis Chang
f2a5491fda Merge "Prevent waiting if no new activity instance launched" into tm-qpr-dev 2022-07-20 08:14:27 +00:00
Chris Tate
3420a4e6fa Merge "BroadcastOption for "this is an alarm broadcast"" into tm-qpr-dev 2022-07-19 18:22:22 +00:00
Louis Chang
5a36e6bc9e Prevent waiting if no new activity instance launched
An existing task can be brought to front while starting
an Intent. In that case, the launching TaskFragment will
remain empty because no new activity instance created.

Monitor the activity launch result and prevent waiting
if the activity instance was not created and cleared the
pending appeared intent.

Bug: 233989810
Test: atest TaskFragmentContainerTest
Test: atest SplitControllerTest
Change-Id: I1bdf516673b71892921da14bdcdb9d1c23ce0a9a
2022-07-19 15:12:37 +00:00
Andrii Kulian
945dbc0427 Merge "Add a dedicated method to check task windowing mode" into tm-qpr-dev 2022-07-19 03:01:15 +00:00
Julia Reynolds
3d354d3ec2 Fix binder error when an app has many channels
By making the channel list inside of NotificationChannelGroup
a ParceledListSlice also

Test: NotificationChannelGroupTest
Test: NotificationManagerServiceTest
Test: PreferencesHelperTest
Bug: 215072888
Change-Id: I391ce0b104af99a11b3a5db31fb8d0321f3a4988
2022-07-18 20:12:14 +00:00
Christopher Tate
cd915062dc BroadcastOption for "this is an alarm broadcast"
Instead of a callback/observer mechanism between the alarm subsystem and
the broadcast delivery subsystem, there will be a direct
BroadcastOptions tag that the Alarm Manager uses to annotate broadcasts
that originate from an alarm firing.  Only the OS itself can use this
BroadcastOptions annotation.

Fixed unchecked null reference situation.

Bug: 161537193
Test: atest CtsAlarmManagerTestCases
Test: atest BroadcastOptionsTest
Test: atest FrameworksMockingServicesTests:AlarmManagerServiceTest

Merged-In: I70a7be35f198bcf9a3cfa232c309a381b2391e34
Change-Id: I70a7be35f198bcf9a3cfa232c309a381b2391e34
2022-07-18 13:06:20 -07:00
TreeHugger Robot
3d8c880d4c Merge "Clear mEnterTransitionCoordinator after content shows." into tm-qpr-dev 2022-07-18 15:29:41 +00:00
Andrii Kulian
356b008ce9 Add a dedicated method to check task windowing mode
Trying to get a task information via ActivityManager#getAppTasks()
will not report tasks that aren't associated with calling package
by the root activity package name. For activities that are from
a different package the task wasn't found, so the windowing mode
couldn't be checked and WM Extensions didn't report any display
features.

This CL adds a dedicated method to check the task windowing mode
for a given activity token.

Bug: 236295340
Test: ActivityEmbeddingIntegrationTests#testDisplayFeaturesWithEmbedding_differentPackage
Change-Id: If2dbc337c4b8cb909914cc28ae4db28a82ff9de3
2022-07-15 02:44:38 +00:00
Hongwei Wang
4805fa7d5b Merge "Adjust PiP source rect hint for window bounds" into tm-qpr-dev 2022-07-14 23:00:01 +00:00
Hongwei Wang
ccfa7d8b50 Adjust PiP source rect hint for window bounds
The source rect hint specified by the app is normally a result of
View#getGlobalVisibleRect (or equivalent) that does not count the window
offset in scenarios like the app is placed in the middle of display by
the system when
    - app specifies sensorLandscape
    - display is actually in portrait mode (on large screens)

Fixed this by adjust the source rect hint on ActivityRecord whenever the
internal PictureInPictureParams is updated.

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/dr7uy1qxB1RGjZVvElo7kr
Bug: 235599028
Test: Verify entering PiP animation working as intended for \
      app specifies sensorLandscape when auto-enter-pip and \
      make-launch-into-pip (aka. content-pip).
Test: atest WmTests:ActivityRecorderTests \
            WmTests:ActivityStarterTests
Change-Id: Id991adbae45a7b61d09105a9aee9cbfecd6b66be
2022-07-14 10:17:38 -07:00
Anushree Ganjam
85b632c71b Create a new Bundle object if mExtras is null.
Bug: 236191017
Test: Manual
Change-Id: I00d925e243335c447e1bb7513148f8735d160c0e
2022-07-14 00:07:17 +00:00
Louis Chang
3f4bbc3a41 Reland “Update the activity current config only if it is reported”
The current configuration in the client activity could be
updated via the other flow (from ViewRootImpl). So, it is
possible that the client activity configuration is different
from the last reported configuration that cached in the system.

If the configuration changed again in that case, the
ActivityConfigurationChangeItem could end up without reporting
Activity#onConfigurationChanged if the differences between
the new configuration and the current client activity
configuration contains the configuration changes that the
activity cannot handle.

Update the activity current config only when reported, so
the configuration differences can be correctly evaluated from
the new configuration and the configuration last reported.

Bug: 231312158
Bug: 236415038
Test: repro steps on the bug
Test: atest ActivityThreadClientTest
Test: atest OverlayHostTest
Change-Id: I56a871fb30809f5f75f0007601a7629f9435e03a
2022-07-04 05:22:55 +00:00
Iris Yang
483981c639 Merge "Take the snapshot if the thumbnail cache returns empty." into tm-qpr-dev 2022-07-01 05:52:34 +00:00
TreeHugger Robot
362a8f75c1 Merge "Revert "Update the activity current config only if it is reported"" into tm-qpr-dev 2022-06-30 17:40:30 +00:00
Prabir Pradhan
d890dd0e2f Revert "Update the activity current config only if it is reported"
This reverts commit b51ecdf1fc.

Reason for revert: Broken tests: b/236415038

Change-Id: I7a8587bf0d157f385f95d4715834ff1ce3e60cd8
2022-06-29 20:42:01 +00:00
Iris Yang
8b1aed0247 Take the snapshot if the thumbnail cache returns empty.
To avoid Recents thumbnail being empty, a snapshot is triggered if no
cache exists.

Bug: 191272693
Test: manually test with Exo (Host apps on virtual display.) to check if
the Recents displays non-empty thumbnail.

Change-Id: I2a898d5127e18e6209ff236d3a72aa22c2a0ca82
2022-06-29 15:58:01 +08:00
TreeHugger Robot
8d296990a6 Merge "Update standby buckets for restored apps." into tm-qpr-dev 2022-06-27 23:22:37 +00:00
George Mount
8aef548893 Clear mEnterTransitionCoordinator after content shows.
Fixes: 233975804

After content has been shown, we should clear the
mEnterTransitonCoordinator so that the exit doesn't
accidentally try to use the enter transition information
to remove Views.

Test: manually tested example from bug report
Change-Id: Ida7ca354cb75953d1d5ecffc159da0d7320d4349
2022-06-24 15:12:38 -07:00
TreeHugger Robot
630304370c Merge "Immediately notify VM of TOP process state" into tm-dev am: 37e033dbc3 am: a4355499cb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19024046

Change-Id: Ife2dfca42943ff2c06f7095113b16128b675f6f5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-23 07:17:26 +00:00
TreeHugger Robot
a4355499cb Merge "Immediately notify VM of TOP process state" into tm-dev am: 37e033dbc3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19024046

Change-Id: I1324664c559bd17a359db2e08860273e8a315280
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-23 06:52:41 +00:00
Jared Duke
f0f1fb99fe Immediately notify VM of TOP process state
The delay was introduced to suppress JIT activity during startup.
However, ART no longer uses the expicit process state signal as an input
to informing JIT activity, so the delay can be removed.

By forwarding the process state immediately, ART can make more informed
decisions about activity based on process state, e.g., suppressing
madvise calls for less important (non-foreground) processes.

Bug: 235390330
Test: m + presubmit + boot tests
Change-Id: Ia95a76f86cf4c38bf89e56f954dbf59e0083ec50
Merged-In: Ia95a76f86cf4c38bf89e56f954dbf59e0083ec50
2022-06-21 15:41:46 -07:00
Vadim Caen
9e2a134dde Merge "Prevent callback registration when back flag is disabled" into tm-dev am: 1c6de844ce am: 0592820f44
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18794217

Change-Id: I367c3888b726f0f7c83d382881741478e715d549
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-20 21:19:32 +00:00
Elis Elliott
fd92519d16 Merge "Update the docs for the provisioning extra AllowOffline." into tm-dev am: 2dc5f6e9f5 am: 7162d46aba
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18909940

Change-Id: I624e37886433308a5624aa29ca95bb3e47a4f7a6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-20 21:18:42 +00:00
Vadim Caen
0592820f44 Merge "Prevent callback registration when back flag is disabled" into tm-dev am: 1c6de844ce
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18794217

Change-Id: I990a9bf95d596c867a972b916518c7d9d1c4355e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-20 21:02:31 +00:00
Elis Elliott
7162d46aba Merge "Update the docs for the provisioning extra AllowOffline." into tm-dev am: 2dc5f6e9f5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18909940

Change-Id: Ib13c6851c1f1842a72e6182567ecb8d2ce16a17b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-20 21:00:45 +00:00
Vadim Caen
1c6de844ce Merge "Prevent callback registration when back flag is disabled" into tm-dev 2022-06-20 18:53:00 +00:00
Elis Elliott
2dc5f6e9f5 Merge "Update the docs for the provisioning extra AllowOffline." into tm-dev 2022-06-20 17:10:01 +00:00
Elis Elliott
d38bf5adac Update the docs for the provisioning extra AllowOffline.
update to reflect the new usage of the extra in forcing platform side
provisioning.

Bug: 236597525

Test: n/a
Change-Id: Ie98e9aaa790d1c0bd4b2d5e2b85a81bd8e3c92e3
2022-06-20 12:34:11 +00:00
Vadim Caen
a2e45f1ed1 Prevent callback registration when back flag is disabled
When the enableOnBackInvokedCallback is set to false (or not set),
registering an OnBackInvokedCallback should be a no-op to avoid
overriding the default compat callback.

Test: Manual testing registering a callback on an app with the flag
disabled and doing a back gesture. Currently we don't have test
executing a back gesture so automated tests are not possible

Bug: 235206960

Change-Id: I54d843f11130a78ed5a68cbe4722e601a2086ee1
Merged-In: I54d843f11130a78ed5a68cbe4722e601a2086ee1
(cherry picked from commit aa48dc3c2d)
2022-06-20 11:40:18 +02:00
TreeHugger Robot
0e759fa649 Merge "Set adminExtras as an empty persistable bundle if left null in builder." into tm-dev am: 95ac43c8bd am: 0a6bc03b73
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18799650

Change-Id: I262d63b6196dc7bd0f485c611b82ce2d37da19cc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-17 19:51:47 +00:00
TreeHugger Robot
0a6bc03b73 Merge "Set adminExtras as an empty persistable bundle if left null in builder." into tm-dev am: 95ac43c8bd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18799650

Change-Id: Ia2e250a28117690c24384272a0940def19f8d9a2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-17 19:29:13 +00:00
TreeHugger Robot
95ac43c8bd Merge "Set adminExtras as an empty persistable bundle if left null in builder." into tm-dev 2022-06-17 10:49:38 +00:00
Louis Chang
5a9a25e80b Merge "Update the activity current config only if it is reported" into tm-qpr-dev 2022-06-17 00:19:50 +00:00
Varun Shah
dfd04f3547 Update standby buckets for restored apps.
When apps are restored, set their standby bucket to RARE if
they have been used within the past 90 days, based on the
restored UsageStats data.

Bug: 214580000
Test: atest UsageStatsDatabaseTest
Change-Id: I9d63032ef84fef97734b51323f41b797caa4f554
(cherry picked from commit 89f69113ad)
2022-06-15 21:07:38 +00:00
Jason Parks
e2438acb46 Merge "Add method to check to see if the component is the supervison component." into tm-dev am: 4492604de8 am: 44effc426c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18815896

Change-Id: I2983c6a801e99290d26dff7983027ba68831ba6f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-15 13:42:02 +00:00
Jason Parks
44effc426c Merge "Add method to check to see if the component is the supervison component." into tm-dev am: 4492604de8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18815896

Change-Id: I7a59f9a5a22f5b73453a7bfaa7cd4d41a1a34cc4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-15 13:14:53 +00:00
Jason Parks
4492604de8 Merge "Add method to check to see if the component is the supervison component." into tm-dev 2022-06-15 12:54:00 +00:00
Louis Chang
b51ecdf1fc Update the activity current config only if it is reported
The current configuration in the client activity could be
updated via the other flow (from ViewRootImpl). So, it is
possible that the client activity configuration is different
from the last reported configuration that cached in the system.

If the configuration changed again in that case, the
ActivityConfigurationChangeItem could end up without reporting
Activity#onConfigurationChanged if the differences between
the new configuration and the current client activity
configuration contains the configuration changes that the
activity cannot handle.

Update the activity current config only when reported, so
the configuration differences can be correctly evaluated from
the new configuration and the configuration last reported.

Bug: 231312158
Test: repro steps on the bug
Test: atest ActivityThreadClientTest
Change-Id: Ifa27d222bb0905053cf12e08c423bf7bfad904cd
2022-06-15 14:27:27 +08:00
Charles Chen
8671151aee Merge "Respect minimum dimensions for embedded Activities" into tm-dev am: eb86759eec
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18482931

Change-Id: Ie71cac684b4e1c6ea0190432c9ef8ad38646a2ec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-15 03:50:46 +00:00
Jason Parks
fb4a46067c Add method to check to see if the component is the supervison component.
Bug: 219025233
Test: manual && atest --no-bazel-mode FrameworksServicesTests:DevicePolicyManagerTest
Change-Id: Icfa6ba0b7300261d49d62fc8b7840fbb964a255a
2022-06-14 17:15:37 +00:00
Charles Chen
fa3f9ca94c Respect minimum dimensions for embedded Activities
Before this CL, minimum dimensions of Activity wasn't respected,
that said, an Activity could be embedded in a TaskFragment of which
bounds are smaller its minimum dimensions.
This CL add the minimum dimensions on several places:

WM core:
1. Verify minimum dimension requirement before adding an Activity to
   a TaskFragment. It'll be early return if the requirement is not
   satisfied.
2. Propagate the minimum dimensions to the client side through
   TaskFragmentInfo to notify the requirement.
3. If TaskFragmentOrganizer tries to shrink a TaskFragment to
   the bounds that smaller than minimum dimensions of its children
   Activity, switch to match the parent bounds.
AndroidX Window extensions:
1. Early return if TaskFragment is resized to the bounds that smaller
   than minimum dimensions which dispatched from the server side.
2. When organizer tries to show Activities side-by-side, verify if
   minimum dimensions requirement of the primary Activiy. If the
   requirement is not satisfied, show Activities in fullscreen
   instead.
TODO: Add an API to check if an Activity intent is allowed to embed
   in a TaskFragment.

Bug: 232871351
Test: atest TaskFragmentOrganizerControllerTest
Test: atest TaskFragmentOrganizerTest TaskFragmentOrganizerPolicyTest
Test: atest SplitActivityLifecycleTest
Test: atest CtsWindowManagerJetpackTestCases
Test: atest WmJetpackUnitTests

Merged-In: Ib46c2cec2a0735b9e3f3420f2cb94754801b86b9
Change-Id: Ib46c2cec2a0735b9e3f3420f2cb94754801b86b9
2022-06-15 00:32:34 +08:00
Elis Elliott
498fb25fcd Set adminExtras as an empty persistable bundle if left null in builder.
Bug: 235282962

Test: atest android.devicepolicy.gts.ManagedProvisioningRequiredAppsTest#newlyProvisionedManagedProfile_hasRequiredApps
Test: atest
android.devicepolicy.gts.ManagedProvisioningRequiredAppsTest#newlyProvisionedFullyManagedDevice_hasRequiredApps

Change-Id: I7242d370a85e9e74bdc5792809c57aa9db9de7a7
2022-06-13 12:33:23 +00:00
Naomi Musgrave
15229543c6 Merge "[Partial Screenshare] introduce a hidden, permission-protected Activity API" into tm-qpr-dev 2022-06-08 09:48:06 +00:00
Lee Shombert
c8d7b7c691 Merge "Avoid ANRs in dumpCacheInfo" into tm-dev am: 8dc0bab75e am: 50ee494d30
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18717283

Change-Id: I6b68521b6692ff796e47f3cd2a394307a113ef1e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-07 23:17:48 +00:00
Lee Shombert
50ee494d30 Merge "Avoid ANRs in dumpCacheInfo" into tm-dev am: 8dc0bab75e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18717283

Change-Id: I41e4d72763ea5c7f50eeb6ea190b590a2c2c9c08
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-07 22:53:09 +00:00
Lee Shombert
8dc0bab75e Merge "Avoid ANRs in dumpCacheInfo" into tm-dev 2022-06-07 22:13:06 +00:00
Jing Ji
2456f4957d Merge "Add field to note if a process has a foreground service" into tm-dev am: b6c06687dd am: 4fe78f6476
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18764698

Change-Id: I5d411e13b722989aac4c93e9cbf6aaab7cda1585
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-07 21:58:43 +00:00
Jing Ji
4fe78f6476 Merge "Add field to note if a process has a foreground service" into tm-dev am: b6c06687dd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18764698

Change-Id: Ie22cbaf2289d9910d4488bc89958d3bd84d171dd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-07 21:38:39 +00:00
Naomi Musgrave
12f5992e4d [Partial Screenshare] introduce a hidden, permission-protected Activity API
Hidden Activity API allows a component holding permission
MANAGE_MEDIA_PROJECTION to declare that the result of setting up the
MediaProjection session should be returned immediately to the host VC app.

The host VC app will cycle through the resumed state when the activity
result is delivered to it, and return to its original state.

Manually tested with test MediaProjection app.

Test: atest WmTests:ActivityRecordTests
Bug: 230607871
Change-Id: Ic85fe8657b9e7f526bbc37a52011d16afa8aef2c
2022-06-07 16:23:12 +00:00