Commit Graph

23403 Commits

Author SHA1 Message Date
TreeHugger Robot
8d296990a6 Merge "Update standby buckets for restored apps." into tm-qpr-dev 2022-06-27 23:22:37 +00: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
Lee Shombert
5513817c76 Avoid ANRs in dumpCacheInfo
Bug: 233566891

PropertyInvalidatedCache.dumpCacheInfo() sometimes triggers an ANR in
system_server, with a thread blocked writing to dumpsys TransferPipe
while holding a cache lock.  Other threads are blocked on the cache
lock.  There does not seem be a true deadlock, but if IO is slow then
all the threads slow down enough to trigger the ANR.

This change stages the output of dumpCacheInfo() in a byte array. The
byte array is written while holding the appropriate cache locks.  When
the byte array has been completely generated and all locks have been
released, the output is sent back to the caller over the dumpsys
TransferPipe.

The two PrintWriter objects are properly closed now.  The previous
code worked as a side effect of the many calls to flush(), which are
unnecessary now.

As a consequence of this change, it will be possible add a unit-test
for the output of 'dumpsys cacheinfo' by calling the method that
creates the byte array.  Such a unit test is not part of this commit.cache.

Tested manually by running 'dumpsys cacheinfo' and verifying that the
output is correct.

Test:
 * FrameworksCoreTests:IpcDataCacheTest

Change-Id: Icbd0197ca883cf0560ba2eb637951abee033eced
2022-06-07 15:25:03 +00:00
Jing Ji
60e5470d35 Add field to note if a process has a foreground service
..into ProcessMemorySnapshot and AppProcessDied

Bug: 234618899
Test: statsd_testdrive 10064
Test: statsd_testdrive 373
Test: atest CtsStatsdAtomHostTestCases:ProcessMemoryStatsTests
Test: atest CtsAppExitTestCases
Change-Id: I1dc3e4ac54d0e46195b508a3e53e287192b3adc9
2022-06-06 15:50:30 -07:00
TreeHugger Robot
58db11b551 Merge "Extend the max count for retrying to request DirectActions to 7." into tm-dev am: fcf090345b am: cc83c18df3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18693166

Change-Id: Ie008735144c486d434f5661728821500e720c16f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-01 09:17:18 +00:00
Charles Chen
cc0966bfd7 Merge "Respect minimum dimensions for embedded Activities" into tm-qpr-dev 2022-06-01 09:02:22 +00:00
TreeHugger Robot
cc83c18df3 Merge "Extend the max count for retrying to request DirectActions to 7." into tm-dev am: fcf090345b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18693166

Change-Id: I146bf4dea15d7e958d1ad48055d7352afae01282
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-01 08:53:27 +00:00
Peter Li
c80818f9ed Extend the max count for retrying to request DirectActions to 7.
Bug: 224789902
Change-Id: I986f1b5534c8cae69c770fb67cf9ebbbeb7c75dd
Test: atest CtsVoiceInteractionTestCases
2022-06-01 04:44:50 +00:00
TreeHugger Robot
199d93fd54 Merge "Postpone the request direct actions before onStart" into tm-dev am: 0d84708056 am: cf05c79ea0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18628126

Change-Id: Ibbfcc51b996298ce0880e4a95dbbb042aedeb75d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-01 04:11:34 +00:00
TreeHugger Robot
cf05c79ea0 Merge "Postpone the request direct actions before onStart" into tm-dev am: 0d84708056
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18628126

Change-Id: Ieb1eaeb742bf3a98c466d32fb6fff3ba5d795daf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-01 03:53:37 +00:00
TreeHugger Robot
0d84708056 Merge "Postpone the request direct actions before onStart" into tm-dev 2022-06-01 03:29:35 +00:00
James O'Leary
b2d0ee2998 Merge "Revert "Update light/dark detection."" into tm-dev am: d88a6933e8 am: a5f967a20a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18675018

Change-Id: I4957dd990bfe07a05db1439e80885342d1685a22
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-01 01:52:32 +00:00
James O'Leary
a5f967a20a Merge "Revert "Update light/dark detection."" into tm-dev am: d88a6933e8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18675018

Change-Id: I3e5e4dca8fe95314e5ee935f688fac29ef199175
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-01 01:34:00 +00:00
James O'Leary
d88a6933e8 Merge "Revert "Update light/dark detection."" into tm-dev 2022-06-01 01:29:41 +00:00
James O'Leary
676c0c450d Revert "Update light/dark detection."
Revert "Update smartspace shadow"

Revert "Update app icon shadows"

Revert submission 17935777-lightDarkDetection

Reason for revert: Talked with Adam Cohen, white shadows are controverstial and we'd need to escalate to senior UX if we want to ship. James would rather do it in U timeframe, will flag to UXers we work with that the opportunity to escalate is available if needed.
Reverted Changes:
Ia91221427:Update light/dark detection.
Ie12d3d054:Update app icon shadows
Icc88c3496:Update smartspace shadow

Change-Id: I7d6b972d29b328a7d5ca7ac7241156b6e51a2cd6
2022-05-31 21:12:38 +00:00
Charles Chen
482fbfabd7 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

Change-Id: Ib46c2cec2a0735b9e3f3420f2cb94754801b86b9
2022-05-31 23:25:18 +08:00
lpeter
f8342c8db5 Postpone the request direct actions before onStart
By the original design, we register the activity event in the
ActivityManagerService. After getting the activity event, we will
query current visible activities and report them to Assistant.
Assistant will start to get direct actions of those visible
activities. But sometimes they can not get the direct actions
due to the stage of activity lifecycle before onStart().

We will postpone the request direct actions a few times
before onStart().

Bug: 224789902
Test: atest CtsVoiceInteractionTestCases
Change-Id: If7cd52c5ba749523e575c0be5595e8f20704c4f2
2022-05-31 14:59:42 +08:00
Ricky Wai
143b95ec82 Merge "Only add boolean extra to bundle when the value is false" into tm-dev am: 76f37a5d74 am: 06a00ac6f6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18628215

Change-Id: I1312e0090d9e814d2bc5569d4bac5e4cac096ce4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-30 10:36:34 +00:00
Ricky Wai
06a00ac6f6 Merge "Only add boolean extra to bundle when the value is false" into tm-dev am: 76f37a5d74
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18628215

Change-Id: Ic15c3703b5258b6f058e5028db580de0803fde10
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-30 10:21:24 +00:00
Ricky Wai
76f37a5d74 Merge "Only add boolean extra to bundle when the value is false" into tm-dev 2022-05-30 10:01:52 +00:00