Commit Graph

23461 Commits

Author SHA1 Message Date
Lee Shombert
be4b6a53c1 Work-around for system property failures
Bug: 236932163

This change adds a work-around to PropertyInvalidatedCache for
failures to set a system property.  Such failures cause fatal crashes
in Android but it is believed that a simple retry will succeed.
(Note: the failures have only been reported on partner devices and
cannot be reproduced on Pixel phones, so no root-cause is available
yet.)

RuntimeExceptions (thrown from android_os_SystemProperties.cpp) are
caught and retried.  The retry limit is 5 times with a 200ms delay
between attempts.  This means that the maximum delay is 1s, whcih
should avoid triggering an ANR.

In addition to automated testing, a manual test was created with
ambush code in the system property component of libc.  The ambush code
injected an error into the set-property logic for cache keys.  It was
observed that the system recovered properly.

Test: atest:
 * FrameworksCoreTests:PropertyInvalidatedCacheTests
 * FrameworksCoreTests:IpcDataCacheTest

Change-Id: I3a124b185c7499a45b27df7cbf889ae6d1d33377
(cherry picked from commit 9b0f81025c)
2022-08-10 16:35:54 +00:00
Joanne Chung
9cc6ab62b2 Merge "Revert "[DO NOT MERGE] Remove selection toolbar code from build time"" into tm-qpr-dev 2022-08-10 08:38:51 +00:00
TreeHugger Robot
283b8e8680 Merge "Revert "Clear mEnterTransitionCoordinator after content shows."" into tm-qpr-dev 2022-08-08 17:51:50 +00:00
Joanne Chung
888e79f7a0 Revert "[DO NOT MERGE] Remove selection toolbar code from build time"
This reverts commit ade911b9c7.

Reason for revert: The feature is planned to run a study in QPR1
with the aim of launching in QPR-2. The code will be removed from
build time before QPR1 finalized.

Change-Id: Ida04260a1196121bb4084b527216aae1e4e6ec54
2022-08-08 11:02:44 +00:00
TreeHugger Robot
59565c560a Merge "Configure the number of tasks to scan to determine Home visibility." into tm-qpr-dev 2022-08-06 02:48:35 +00:00
Yuncheol Heo
0dfdd607b7 Merge "Allow getTasks to filter tasks by displayId." into tm-qpr-dev 2022-08-04 20:54:51 +00:00
Evan Rosky
9847d708d7 Merge "Strip transition information from activityoptions when sent to app" into sc-v2-dev am: eeab60091c am: 5a154b395a am: 85817e6590
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19518999

Change-Id: I97d1c2c87625ac8405452d64b922c9b06e6ed5a1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-04 05:48:25 +00:00
Evan Rosky
85817e6590 Merge "Strip transition information from activityoptions when sent to app" into sc-v2-dev am: eeab60091c am: 5a154b395a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19518999

Change-Id: Id85f7d2eeaf467cc5c77213379fff81b57c4a67f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-04 05:23:58 +00:00
Evan Rosky
5a154b395a Merge "Strip transition information from activityoptions when sent to app" into sc-v2-dev am: eeab60091c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19518999

Change-Id: I2996d813bc8a89c220e7c89efdd064d3c7ef3fdd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-04 04:58:41 +00:00
Evan Rosky
4c78e5c98e Merge "Revert "Strip transition information from activityoptions once it is read."" into sc-v2-dev am: 1099b25b2d am: d7ae033815 am: 2e763d31d2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19517194

Change-Id: If8f1ab91e07e72b49859593c77471f54d399a367
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-04 04:18:30 +00:00
Evan Rosky
2e763d31d2 Merge "Revert "Strip transition information from activityoptions once it is read."" into sc-v2-dev am: 1099b25b2d am: d7ae033815
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19517194

Change-Id: I75303fa1000a2a5ca6233daa8c75fbcdce1238ba
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-04 03:53:28 +00:00
Evan Rosky
d7ae033815 Merge "Revert "Strip transition information from activityoptions once it is read."" into sc-v2-dev am: 1099b25b2d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19517194

Change-Id: I0b8d234013f3551354f815533f2b4576b9100a48
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-04 03:26:51 +00:00
Evan Rosky
0d03e6f1fc Strip transition information from activityoptions when sent to app
The implementation of shared-element transitions takes the
ActivityOptions from the calling activity and sends them to
another activity. This means that any sensitive information
passed into ActivityManager via ActivityOptions can make its
way to an unrelated app. Recently a RemoteTransition object
was added which includes some sensitive information.

This CL strips the sensitive information from the activity
options before sending it to anonther app.

Bug: 237290578
Test: atest ActivityManagerTest#testActivityManager_stripTransitionFromActivityOptions
Change-Id: Ifa08fc195698f02bf70ca386178c67f6ba4a14ea
2022-08-04 01:30:53 +00:00
Evan Rosky
d1b32da845 Revert "Strip transition information from activityoptions once it is read."
This reverts commit 0b3ad39abf.

Reason for revert: Broke NexusLauncherTests:MemoryTests

Change-Id: Ibc8e9f516054f017e9db2e5608cf6806531ab554
2022-08-03 20:15:33 +00:00
Evan Rosky
fc301ed47c Merge "Strip transition information from activityoptions once it is read." into sc-v2-dev am: dc8ae7665a am: a824844cdf am: 7cb144249f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19505172

Change-Id: Ibded759578f05fe3dab6af5f0dc0e8579756e46d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-03 01:09:46 +00:00
Evan Rosky
7cb144249f Merge "Strip transition information from activityoptions once it is read." into sc-v2-dev am: dc8ae7665a am: a824844cdf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19505172

Change-Id: Id7de444318f392c3d8e9735df2dd78834fc79eee
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-03 00:18:31 +00:00
Evan Rosky
a824844cdf Merge "Strip transition information from activityoptions once it is read." into sc-v2-dev am: dc8ae7665a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19505172

Change-Id: I489c233fea52fff948c5b4d92cd61163904e974d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-02 23:52:01 +00:00
Evan Rosky
0b3ad39abf Strip transition information from activityoptions once it is read.
The implementation of shared-element transitions takes the
ActivityOptions from the calling activity and sends them to
another activity. This means that any sensitive information
passed into ActivityManager via ActivityOptions can make its
way to an unrelated app. Recently a RemoteTransition object
was added which includes some sensitive information.

This CL strips the sensitive information from the activity
options after it is extracted so that it can't be sent
to the target.

Bug: 237290578
Test: atest ActivityManagerTest#testActivityManager_stripTransitionFromActivityOptions
Change-Id: Ic9f8062e67ab895292af75e97a9ce2f4aa45d467
2022-08-02 20:37:50 +00:00
Yuncheol Heo
cfefeb72f4 Configure the number of tasks to scan to determine Home visibility.
- Auto uses the multi display and its Home uses TaskView, so it's not enough to peek the top Tasks to get the visibility of Home.
- Set the default number of tasks to retrieve as 10 to scan all visible tasks.
- Don't query PM to check if the task is Home, check the ActivityType instead.

Bug: 236099098
Test: atest android.app.cts.ActivityManagerTest#testHomeVisibilityListener

Change-Id: I10b6d84292d3180f095dd9f8cf76b4c9db641091
2022-08-01 18:27:37 -07:00
Yuncheol Heo
5c8fd0ddbf Allow getTasks to filter tasks by displayId.
Bug: 236099098
Test: atest WmTests:RunningTasksTest WmTests:RecentTasksTest
Change-Id: I4fe5955a075f1482df3acdff8baefc7126ef9bd0
2022-08-01 18:27:25 -07:00
Andrew Solovay
81d565f643 Merge "docs: Fixing typo in Activity reference" into tm-dev am: 22dd45bd59 am: 7d00787cbf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19278953

Change-Id: Ia80b98fd6b6e1f21af32d74b4af7367c60540fc5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-01 19:58:32 +00:00
Andrew Solovay
7d00787cbf Merge "docs: Fixing typo in Activity reference" into tm-dev am: 22dd45bd59
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19278953

Change-Id: Iaa1ea8164208ef999ceb58a8eb25b8e6e5385888
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-01 19:40:06 +00:00
Tiger Huang
93a238d15d Merge "Send size-compat scale to the client" into tm-qpr-dev 2022-07-29 08:56:14 +00:00
Arthur Hung
e3476afe2a Cancel back invoke when window focus has lost
This reverts commit 0099ca8fab and provide
new mechanism.

The back invoke target could lost focus during back navigation gesture.
To prevent the non-focused window could still trigger back action cause
some unexpected behavior, this CL will listen the focus change of
current focused window and cancel back gesture when its focus has lost.

Bug: 238050065
Bug: 239792909
Test: atest BackNavigationControllerTests
Test: atest BackNavigationLegacyGestureTest BackNavigationLegacyTest
Test: atest BackNavigationTests
Test: atest WindowOnBackInvokedDispatcherTest BackNavigationTest
Test: atset BackAnimationControllerTest

Change-Id: I65eb19371020ce39977eeb2a2a80c7f08600aaec
2022-07-28 06:42:10 +00:00
Tiger Huang
c77eaf873d Send size-compat scale to the client
The client computes the window frame on its own in ViewRootImpl#setView.
However, the bounds obtained from WindowConfiguration is not size-
compatible, which makes legacy apps produce wrong frames. The frame is
larger than expected, so when computing WindowInsets with size-
compatible InsetsState, the window cannot receive insets.

Although the client will receive the correct window frame from relayout,
but the first WindowInsets has been dispatched before that.

This CL sends the size-compat scale to the client, so the client can use
the correct WindowConfiguration to compute frames.

This is also a step to enable the client to perform local window layout.

Bug: 237749017
Bug: 161810301
Bug: 175861127
Test: atest StartingSurfaceDrawerTests WindowAddRemovePerfTest
      ActivityRecordTests WindowManagerServiceTests
Change-Id: I6b23901f4b1f009444c04da7e078ea971a386ad7
2022-07-27 14:10:10 +08:00
George Mount
716b33e323 Revert "Clear mEnterTransitionCoordinator after content shows."
This reverts commit 8aef548893.

Fixes: 239497474
Fixes: 239595736
Fixes: 240211711

Reason for revert: b/240211711 b/239595736 b/239497474

Change-Id: I3b13b49c91d38055b3e5b9d772dfe21e054911b6
2022-07-26 21:18:24 +00:00
Julia Reynolds
517d2b2293 Merge "Revert "Fix binder error when an app has many channels"" into tm-qpr-dev 2022-07-26 14:56:20 +00:00
Neha Jain
34b3e4b51c Revert "Fix binder error when an app has many channels"
Revert submission 19290255-jr-bind-flicker

Reason for revert: b/240100577
Reverted Changes:
I9a1c96f75:Improve App notification loading
I391ce0b10:Fix binder error when an app has many channels

Change-Id: I43777d003de5742056f600980ab52d58dbdb3ad8
2022-07-25 22:16:16 +00:00
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
Andrew Solovay
ca59840e0f docs: Fixing typo in Activity reference
Bug: 175529330
Change-Id: Ic6f667e773b771fd913b3dd76247bae5f026bbc8
Test: (built docs with go/abtd: go/abort-ui/run/L95400000955473009 )
2022-07-13 23:41:10 +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