Commit Graph

23489 Commits

Author SHA1 Message Date
Darrell Shi
05dfa43c03 Merge "DO NOT MERGE: add interim startDream api." into tm-qpr-dev 2022-09-15 16:00:34 +00:00
Lee Shombert
a6b4f410f2 Refactor PropertyInvalidatedCache locks
Bug: 241763149

Refactor the sCorkLock into sCorkLock, which protects code that
specifically supports corking, and sGlobalLock, which protects all
other code that touches global objects (like the list of all caches).

Deadlock was not actually observed in the bug and has never been
reported, but the possibility was identified and is being fixed here.

Bypass the bulk of disableLocal(name) if the name has already been
bypassed.  This speeds repeated calls to disableLocal() by not
iterating over sCaches.

Many threads were terminated by a watchdog while iterating over
sCaches inside disableLocal().  It is not known why this block of code
was running so often when the time out expired.

An open question is whether or not disabled caches should be removed
from the sCaches array.  The only reason to leave them in the array is
to report on them during dumpsys, but this seems like a small benefit

Test: atest
 * FrameworksCoreTests:IpcDataCacheTest
 * FrameworksCoreTests:PropertyInvalidatedCacheTests
 * CtsOsTestCases:IpcDataCacheTest
Change-Id: I4c298f380044c0be93cdb47d66d7d7e2b260004f
2022-09-14 23:59:46 +00:00
Darrell Shi
93e654d66c DO NOT MERGE: add interim startDream api.
DreamManager#startDream has been updated on QPR and master which removes
the unnecessary component name parameter, but it breaks TM CTS tests.
The interim api added in this change will prevent breakage on TM, and
should not be merged downstream.

Test: atest DreamManagerServiceTests
Fix: 245223722
Fix: 245058392
Fix: 245070240
Change-Id: Id9e8cc67003da9fc3e03bffd6ec50643d10652b5
2022-09-14 20:42:20 +00:00
TreeHugger Robot
efff8e9f03 Merge "Only use return transition when requested." into tm-qpr-dev 2022-09-10 00:00:16 +00:00
Julia Reynolds
6527863444 Merge "Fix NPE" into tm-qpr-dev 2022-09-08 14:01:08 +00:00
Julia Reynolds
6f02c07176 Fix NPE
Test: NotificationChannelGroupTest
Test: view notification settings for an app that doesn't use groups
Fixes: 244574602
Bug: 241764350
Bug: 241764340
Bug: 241764135
Bug: 242702935
Bug: 242703118
Bug: 242703202
Bug: 242702851
Bug: 242703217
Bug: 242703556
Change-Id: I9c681106f6d645e62b0e44903d40aa523fee0e95
2022-09-06 17:49:18 -04:00
TreeHugger Robot
379c38b1ae Merge "Update TaskFragmentToken for Activity relaunch" into tm-qpr-dev 2022-09-01 21:51:47 +00:00
Yuri Lin
f5f9c1ec1d Merge "Trim any long string inputs that come in to AutomaticZenRule" into tm-qpr-dev 2022-09-01 18:47:55 +00:00
Darrell Shi
68e81c211e Merge "Add hidden system dream API in DreamManagerService." into tm-qpr-dev 2022-09-01 16:41:32 +00:00
Yuri Lin
de172ba0d4 Trim any long string inputs that come in to AutomaticZenRule
This change both prevents any rules from being unable to be written to disk and also avoids risk of running out of memory while handling all the zen rules.

Bug: 242703460
Bug: 242703505
Bug: 242703780
Bug: 242704043
Bug: 243794204
Test: cts AutomaticZenRuleTest; atest android.app.AutomaticZenRuleTest; manually confirmed each exploit example either saves the rule successfully with a truncated string (in the case of name & conditionId) or may fail to save the rule at all (if the owner/configactivity is invalid). Additionally ran the memory-exhausting PoC without device crashes.

Change-Id: I110172a43f28528dd274b3b346eb29c3796ff2c6
2022-08-31 14:59:18 -04:00
Chris Li
f1bf8d6d9d Update TaskFragmentToken for Activity relaunch
Before, we store the TaskFragmentToken in ActivityClientRecord from
LaunchActivityItem, which won't update if the Activity is relaunched.
Now, we update the token when the activity is reparented to make sure
the token is up-to-date when relaunched.

Also make sure that when activity is destroyed, it is no longer
available using SplitController#getContainerWithActivity(Activity).

Bug: 243330085
Test: atest WMJetpackUnitTests:TaskFragmentContainerTest
Change-Id: I37f1a442c6f1bfb40f04f61eb4f9a3d8d09733ee
2022-08-31 11:37:17 +08:00
Lili Zou
81f52b053d AmbientContextManager API changes to support quick-tap detection
Test: "atest CtsAmbientContextServiceTestCases", "atest FrameworksServicesTests:AmbientContextManagerServiceTest"
BUG: 242480433
Ignore-AOSP-First: to prevent new feature leak.

Change-Id: If445894f0d68fbb336156d2817e0dea884182a10
2022-08-31 02:28:09 +00:00
Darrell Shi
3c94bacacd Add hidden system dream API in DreamManagerService.
This change
- adds a new private API in dream manager that allows a client with
  write dream permission to set a system dream component, which takes
  precedence over user configured dream
- fixes startDream() API in DreamManager which shouldn't take in a
  component name

Test: atest SystemDreamTest
Bug: 222529147
Change-Id: Iee9a0af1071e5ed57fa5bd4b0d06d8178118116e
2022-08-30 23:19:44 +00:00
Kathy Chen
7a168cc8c1 Fix shell command bugs for supporting CTS test. Add service unit test. Fix javadoc.
Test: unit test and cts test
Ignore-AOSP-First: confidential feature
BUG: 242480433
Change-Id: I0fd2950eea267d56fbd8e89ecc52fdd590992e75
Merged-In: I0fd2950eea267d56fbd8e89ecc52fdd590992e75
(cherry picked from commit 44eafb8f58)
2022-08-30 02:37:59 +00:00
Nate Myren
04f6c9fa6a Merge "Revert "DO NOT MERGE Add GET_USAGE_STATS to RUNTIME_AND_APPOP_PERMISSIONS_OPS"" into tm-qpr-dev 2022-08-26 17:01:32 +00:00
Wei Sheng Shih
4ec0b52029 Merge "[RESTRICT AUTOMERGE]BackGestureAnimation: a lightweight recents animation controller" into tm-qpr-dev 2022-08-25 14:04:21 +00:00
Nate Myren
768e9f12d6 Revert "DO NOT MERGE Add GET_USAGE_STATS to RUNTIME_AND_APPOP_PERMISSIONS_OPS"
This reverts commit 76718dd9f4.

Reason for revert: b/243646481

Change-Id: I6b200a3269e2a4fd1943c20e3074f19afe46f6dd
2022-08-24 20:49:02 +00:00
George Mount
70ce9e0487 Only use return transition when requested.
Fixes: 233975804

When exiting back, the activity transition should not
run unless an activity transition has been requested.

Test: existing ActivityTransitionTests, manually use Settings
Change-Id: Ice2cf6d82c25c65076a9656ddd847a9e2aa68b80
2022-08-24 10:24:06 -07:00
Michael Wright
0b75242b7b Merge "Revert^3 "Fix binder error when an app has many channels"" into tm-qpr-dev 2022-08-24 15:24:09 +00:00
Michael Wright
6e662a45b5 Revert^3 "Fix binder error when an app has many channels"
f6d322577a

Change-Id: Ib42bf11c154e287119a5af0a4f92510cfb3a6cc7
2022-08-24 12:22:12 +00:00
wilsonshih
c9c9a757a8 [RESTRICT AUTOMERGE]BackGestureAnimation: a lightweight recents
animation controller

Copy most of code from RecentsAnimationController to back gesture
animation controller(BackNaviAnimationController), the infrastructure
can be reused for either back-to-home/back-to-task/back-to-activity
animations if needed. Since the infrasturcture of legacy recents
animation controller should be stable already, we don't need to
worry about issues like leak leashes/flickers/fixed rotation.

BackAnimationAdaptor is a temporary class to help migrate to shell
transition, the target is to replace it by RemoteTransition.

Next step: Migrate to shell transition, decouple animation info from
BackNavigationInfo.
Test: manually play back to home animation to verify no flicker/black
background/leak surface. Also test that there can play back to home
animation even when quick swipe.
Test: atest BackNavigationTest
Test: atest BackNavigationControllerTests BackAnimationControllerTest
Bug: 237642535

Change-Id: I436a3dcf5011c56c08d131b40168f19128cc8723
2022-08-24 02:35:46 +00:00
Hongwei Wang
121302c41d Merge "Ensure isInPictureInPicture result in onPause" into tm-qpr-dev 2022-08-23 22:43:31 +00:00
Nate Myren
43c3022f19 Merge "DO NOT MERGE Add GET_USAGE_STATS to RUNTIME_AND_APPOP_PERMISSIONS_OPS" into tm-qpr-dev 2022-08-23 19:45:46 +00:00
Julia Reynolds
829e25dfd3 Merge "Limit the size of NotificationChannel and NotificationChannelGroup" into tm-qpr-dev 2022-08-22 17:18:05 +00:00
Nate Myren
76718dd9f4 DO NOT MERGE Add GET_USAGE_STATS to RUNTIME_AND_APPOP_PERMISSIONS_OPS
Fixes: 243182796
Test: atest AppOpDefinitionTest
Change-Id: Ib8b1bdff066b2b69a42854ae7cfa652ad8f8b1f4
2022-08-22 16:11:38 +00:00
Hongwei Wang
ac611a1249 Ensure isInPictureInPicture result in onPause
We use to set Activity#mIsInPictureInPictureMode to be true when app
requests Activity#enterPictureInPictureMode and therefore when they
receive the onPause callback, Activity#isInPictureInPictureMode can be
true. With the new auto-enter-pip API, this code path is no more
relevant and here we add extra info to PauseActivityItem to set the same
flag when WM puts the Activity into PiP mode due to auto-enter.

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/yXi24xi6TgYGhoqB31Oov
Bug: 239618513
Test: follow the reproduce steps in bug, see video
Test: atest PinnedStackTests
Change-Id: I81ece7d3aad8eb868d95f106f6825612e0741a19
2022-08-19 09:41:02 -07:00
Julia Reynolds
3850857cb0 Limit the size of NotificationChannel and NotificationChannelGroup
Test: android.app.NotificationChannelGroupTest
Test: android.app.NotificationChannelTest
Test: cts NotificationChannelTest
Test: cts NotificationChannelGroupTest
Bug: 241764350
Bug: 241764340
Bug: 241764135
Bug: 242702935
Bug: 242703118
Bug: 242703202
Bug: 242702851
Bug: 242703217
Bug: 242703556
Change-Id: I0925583ab54d6c81c415859618f6b907ab7baada
2022-08-19 14:41:44 +00:00
Julia Reynolds
f6d322577a Revert^2 "Fix binder error when an app has many channels"
34b3e4b51c

Test: NotificationChannelGroupTest
Test: NotificationManagerServiceTest
Test: PreferencesHelperTest (new test for revert:
testGetNotificationChannelGroup)
Test: long press on a conversation notification in the shade
Bug: 215072888

Change-Id: Ib9c671b0fd1f97e01ef02957839ebad2cadb5e44
2022-08-16 13:25:56 -04:00
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