Commit Graph

23368 Commits

Author SHA1 Message Date
Vadim Caen
b38e19fdc3 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: I8054556537104bb80d940272b367ed9b8ffa520c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-20 21:02:34 +00:00
Elis Elliott
bd04837ecb 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: Iff5171f233650802dc84140501bd076a4f115f2d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-20 20:58:55 +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
be95f2a8da Merge "Immediately notify VM of TOP process state" am: f80f2e450d am: fb5a1ede51
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2124252

Change-Id: I1a79b86501d7efae4c45adf83e9e5089f0f8f2d3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-17 19:56:30 +00:00
TreeHugger Robot
1ef250b44c 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: I31fe2bdeef6ae9fd7df77a3f5eba7ac390bb44e6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-17 19:30:17 +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
Treehugger Robot
f80f2e450d Merge "Immediately notify VM of TOP process state" 2022-06-17 05:46:05 +00:00
Xin Li
195b02b570 Merge "Merge Android 12 QPR 3" 2022-06-16 18:51:54 +00:00
Jared Duke
95a0e9ab7d 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
2022-06-16 09:02:47 -07:00
Chilun
3be8e11bdc Store pending override config instead of creating ActivityClientRecord
Create ActivityClientRecord early in preExecute may cause
NullPointerException. If two LaunchActivityItem using the same token
and the 1st postExecute() comes after 2nd preExecute(), the
corresponding launching activity will be removed and cause 2nd
execute() get NullPointerException.

Since the only use case to get ActivityClientRecord in preExecute() is
just to use it to store the pending override config. We can directly
store the latest pending override config from preExecute() in
ActivityThread instead of creating ActivityClientRecord.

Bug: 201668069
Test: atest TransactionExecutorTests
      atest ActivityThreadTest
Merged-In: If350e942254e54c9ec90bc63a6e50eb67d038183
Change-Id: If350e942254e54c9ec90bc63a6e50eb67d038183
2022-06-15 13:01:33 -07:00
Jason Parks
d90e84069c 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: I35b7e3139d91ba64a4539b05d158bf71fa9c0be2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-15 13:13:24 +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
Charles Chen
29212ed0e6 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: I6accbf1754f25e0dec67cf3b887f7f43402adc6c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-15 03:49:38 +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
Lee Shombert
d6e8f8a644 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: I4f673b5513eb25c5e7ba1754f4d84596c1323f05
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-07 22:52:43 +00:00
Lee Shombert
8dc0bab75e Merge "Avoid ANRs in dumpCacheInfo" into tm-dev 2022-06-07 22:13:06 +00:00
Jing Ji
33ef13be79 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: I427f955b0bcddcc515e56edd523178aeec4b9f02
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-07 21:36:57 +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
dafef79073 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: I134a1b49ca1eb5366d6df09c2d6dfe480204599f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-01 08:52:09 +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
07b67c2bd5 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: Id3b8fbaf50f0b55e64fe34f34dc256be147627ea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-01 03:52:14 +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
4739705e53 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: I35fb7afce801ace371638f78dfdbd457249bd6bb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-01 01:57:40 +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
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
43fb7b6be4 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: I0beb4a6bcce2d1164970c01c18e2c14b83fa70dd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-30 10:20:05 +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
James O'Leary
8a21df0c92 Merge "Update light/dark detection." into tm-dev am: 4e6dfca5ed
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18164065

Change-Id: I326ffa04f784f8edb405104edb8bc6789d690ed9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-27 20:04:05 +00:00
James O'Leary
4e6dfca5ed Merge "Update light/dark detection." into tm-dev 2022-05-27 19:44:39 +00:00
James O'Leary
ee04476acf Update light/dark detection.
Reset implementation based on design being comfortable with white
shadows now, so there doesn't need to be a bias toward saying the
wallpaper is dark.

- use luminance/tone instead of HSL to judge contrast
- if the median pixel has a luminance/tone less than mid-gray, the
wallpaper is dark.
- add a method to ColorUtils that returns luminance from a hex code
without any allocations (avoids converting to LAB)

End result is we move from judging a wallpaper as dark ~99% of the time
to 54% of the time, based on Monet Studio implementation checking ~1000
wallpapers, including Google's default wallpapers.

Bug: 213314628
Test: Manual inspection at runtime, long-running prototyping in Monet
Studio with UX across ~1000 wallpapers
Change-Id: Ia9122142728a8de9390b3e0471d7803376487864
2022-05-27 15:27:43 +00:00
Ricky Wai
57c032bf43 Only add boolean extra to bundle when the value is false
As the default value is false, we don't need to put it in bundle if the value is false.

Bug: 234070143
Test: atest android.app.cts.BroadcastOptionsTest#testTemporaryAppAllowlistBroadcastOptions_defaultValues
Change-Id: Ia23d2a03f8c3c64d25b47ed9a8d02ae22ce9246b
2022-05-27 15:01:33 +00:00
TreeHugger Robot
cb9bd3a153 Merge "Add hidden flag for allowing system app to use BAL permission to launch pending intent in background" into tm-dev am: 9cb2bb4e2a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18486605

Change-Id: I7037275612ae249a378c4cd0254f4e59fc230ad3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-26 20:08:59 +00:00
TreeHugger Robot
9cb2bb4e2a Merge "Add hidden flag for allowing system app to use BAL permission to launch pending intent in background" into tm-dev 2022-05-26 19:53:34 +00:00
Ricky Wai
e5a896d56a Add hidden flag for allowing system app to use BAL permission to launch pending intent in background
Priv-app no longer use its BAL permission to launch background activity by default,
it needs to use this new flag to allow this operation.

Bug: 232921553
Test: PackageInstaller.Session.commit() no longer able to start BAL.
Change-Id: Ifbc642a32dbebdf8854e7e5b1366cb899e971fa7
2022-05-26 15:03:49 +00:00
Hongwei Wang
2484a6a5e5 Merge "Use snapshot in enter content-pip animation" into tm-dev am: a143492a2b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18501932

Change-Id: I5ba1c038807bd8d61ebeec36e98084bc8937e8ea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-26 07:33:29 +00:00
Hongwei Wang
fe5078f026 Use snapshot in enter content-pip animation
When entering content-pip
- We take a snapshot for the host task within the
  ActivityStarter#startActivityInner function, this is to make sure that
  the snapshot is taken before an app switches to the placeholder content
- We retrieve the snapshot in WM Shell when animating the newly created
  content-pip task, and use that snapshot during the animation
- This works similar to the solid color content overlay when app enters
  PiP without specifying a valid source rect hint. Therefore, we
  abstract the functionality to a dedicated PipContentOverlay class

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/dRSTf7prHc0krPhTKZ0kXx
Bug: 220191201
Test: enter content-pip from ApiDemos app, see also Video
Change-Id: I2420402341a910b44bd8f64e3ad518ebef41bc19
2022-05-25 14:35:25 -07:00
Vadim Caen
e8e4c63aed DO NOT MERGE Only rely on developer option for back animation am: ab58191c7f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18310267

Change-Id: Ibf27183e26a5a8dca9f2856de7e84016ee6e0b29
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-23 19:30:18 +00:00
Vadim Caen
451dc8a3d3 Merge "DO NOT MERGE Only rely on developer option for back animation" into tm-dev 2022-05-23 19:05:48 +00:00
Vadim Caen
ab58191c7f DO NOT MERGE Only rely on developer option for back animation
BackNavigationController was still relying on a debug setting. Now the
animation request is handled via a boolean parameter passed by sysui,
which has access to the developer option.

Test: Existing test modified
Bug: 231502692
Change-Id: Icda4692e05396407d961610de0ce709492adadc1
Merged-In: Icda4692e05396407d961610de0ce709492adadc1
2022-05-23 10:43:04 +00:00
Louis Chang
9d1a566357 Merge "Do not propagate always-on-top config to child containers" into tm-dev am: 0e52eb3aa7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18492569

Change-Id: I54f96c851b246caf76659d10e89d1fca6c361e99
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-23 05:17:10 +00:00
Louis Chang
0e52eb3aa7 Merge "Do not propagate always-on-top config to child containers" into tm-dev 2022-05-23 04:53:00 +00:00
Antoan Angelov
abdc4f1e49 Merge "Also parse integer, long and boolean extras for NFC" into tm-dev am: 79e7d4b5f6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18281174

Change-Id: I9610c7c5a7ab6873cc49089217028dc06b78d9ac
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 22:17:25 +00:00
Antoan Angelov
79e7d4b5f6 Merge "Also parse integer, long and boolean extras for NFC" into tm-dev 2022-05-20 21:12:56 +00:00