Commit Graph

24053 Commits

Author SHA1 Message Date
Nate Myren
f82b80203f Merge "Revert "Add GET_USAGE_STATS to RUNTIME_AND_APPOP_PERMISSIONS_OPS"" 2022-08-24 19:28:23 +00:00
Nate Myren
d7b3cdc705 Revert "Add GET_USAGE_STATS to RUNTIME_AND_APPOP_PERMISSIONS_OPS"
Revert submission 19682544-usage-stats

Reason for revert: b/243572246
Bug: 243572246
Reverted Changes:
Ib8b1bdff0:Add GET_USAGE_STATS to RUNTIME_AND_APPOP_PERMISSIO...
I1ac0ca320:Add test for app op permission mappings

Change-Id: I9f2da8d32a88566fc39ad3272fe4caa69d8d5aca
2022-08-24 16:14:29 +00:00
Michael Wright
ab40b0ffc2 Merge "Revert^3 "Fix binder error when an app has many channels"" into tm-qpr-dev am: 0b75242b7b am: 86af40a0e4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19713796

Change-Id: I647e57eb92b619b64797d2105ce3ad4ab816b89e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-24 16:11:16 +00:00
Michael Wright
86af40a0e4 Merge "Revert^3 "Fix binder error when an app has many channels"" into tm-qpr-dev am: 0b75242b7b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19713796

Change-Id: I09d1af14599bb9ddbd22fedea88322a054fe5712
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-24 16:05:15 +00: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
Hongwei Wang
63948c544c Merge "Ensure isInPictureInPicture result in onPause" into tm-qpr-dev am: 121302c41d am: 5c01efb41d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19489109

Change-Id: I699fc2a3ec669a22c90c165fe0dd55e0783b9fcb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-24 05:34:30 +00:00
Hongwei Wang
5c01efb41d Merge "Ensure isInPictureInPicture result in onPause" into tm-qpr-dev am: 121302c41d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19489109

Change-Id: I9dd06305bce7c87a4a0a09d705555d16a8dca228
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-23 23:05:04 +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
7434799347 DO NOT MERGE Add GET_USAGE_STATS to RUNTIME_AND_APPOP_PERMISSIONS_OPS am: 76718dd9f4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19682955

Change-Id: Ia256938a7fb30b903c7a51fdcadd3c77b8ddb3b0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-23 20:54:50 +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
Nate Myren
ac9f8b4b53 Merge "Add GET_USAGE_STATS to RUNTIME_AND_APPOP_PERMISSIONS_OPS" 2022-08-23 16:22:46 +00:00
Jay Sullivan
6f0d41b536 Merge "Combine AppOpsManager arrays into one" 2022-08-22 17:59:58 +00:00
Julia Reynolds
72c85722da Merge "Limit the size of NotificationChannel and NotificationChannelGroup" into tm-qpr-dev am: 829e25dfd3 am: 43d58096bf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19678343

Change-Id: I60566ea76b80b84cf508db23941023fd37f3b18d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-22 17:25:40 +00:00
Julia Reynolds
43d58096bf Merge "Limit the size of NotificationChannel and NotificationChannelGroup" into tm-qpr-dev am: 829e25dfd3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19678343

Change-Id: Ia5db4abaa6ca9c582c9cbc234e7705418e155f7f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-22 17:22:24 +00:00
Austin Borger
57b6c21a33 Merge "Revert "Add pids to AttributionSource."" 2022-08-22 17:22:01 +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
Julia Reynolds
f42db68412 Merge "Revert^2 "Fix binder error when an app has many channels"" into tm-qpr-dev am: c8d7e101ca am: 03cee85749
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19583472

Change-Id: I4f8a675f4555e508d1ff1c52d82a5b55f2fa2382
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-22 14:48:41 +00:00
Julia Reynolds
03cee85749 Merge "Revert^2 "Fix binder error when an app has many channels"" into tm-qpr-dev am: c8d7e101ca
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19583472

Change-Id: I9237fc4c49df8fcf01891b8fac0d7aa3293e387b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-22 14:18:35 +00:00
Austin Borger
7a8d805c63 Revert "Add pids to AttributionSource."
This reverts commit 20bcb3c4b8.

Reason for revert: Broken test (bug 243187237)

Change-Id: I2eb033ed06e2c0c56155e4848de1b399b69ffc6d
2022-08-22 00:56:14 +00:00
Nate Myren
77ff81bc42 Add GET_USAGE_STATS to RUNTIME_AND_APPOP_PERMISSIONS_OPS
Fixes: 243182796
Test: atest AppOpDefinitionTest
Change-Id: Ib8b1bdff066b2b69a42854ae7cfa652ad8f8b1f4
2022-08-19 16:21:52 -07:00
Suprabh Shukla
887324d34b Merge "Add push messaging as a trigger for proc start" 2022-08-19 22:31:25 +00:00
Siim Sammul
13349be4e5 Merge "Revert "Initialize binder latency histograms collection via Bind..."" 2022-08-19 20:59:37 +00:00
Austin Borger
caa20c20e6 Merge "Add pids to AttributionSource." 2022-08-19 20:32:17 +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
Suprabh Shukla
84c7a05dbb Add push messaging as a trigger for proc start
Adding identification for process starts when the trigger was a
push_message.
When the push_message was over quota it may be deferred, but counting it
separately is still useful, as it could still cause cold process starts.

Test: Manual:
Run `./out/host/linux-x86/bin/statsd_testdrive 169`
Then use a sample app to send it an FCM message when it is not running.

Bug: 242928495
Change-Id: I55c56601af4eb60173ae039d8de7f9e7916c81e8
2022-08-19 00:04:10 -07:00
Rhed Jao
fd1f59b3f3 Merge changes Ia69ff3b5,I56d9466d,I6c405116
* changes:
  Applying package visibility rules to the broadcast of overlay changed
  Do not split intents into multiple ones
  Do not split the suspended packages intent into multiple ones
2022-08-19 05:39:32 +00:00
Felipe Leme
e5b4ecaf97 Merge "Improvements on "start bg user on secondary display":" 2022-08-18 22:34:26 +00:00
Felipe Leme
1c3c948716 Merge "Initial implementation of "start bg user on secondary display"." 2022-08-18 20:46:50 +00:00
Jay Thomas Sullivan
5f2bc22d36 Combine AppOpsManager arrays into one
AppOpsManager currently has multiple arrays which are all related:

- sOpToSwitch
- sOpToString
- sOpNames
- sOpPerms
- sOpRestrictions
- sOpAllowSystemRestrictionBypass
- sOpDefaultMode
- sOpDisableReset
- sOpRestrictRead

Despite being different arrays, they're essentially a single list of
objects with each field sliced into a different array.

As the entries in these arrays grows, they are are difficult to keep
track of. To simplify things, we can simply join them all into a single
list of objects. Because there are so many fields, we use the builder
pattern to prevent the array from becoming unreadable.

Test: presubmit
Bug: 242097113
No-Typo-Check: typo EMERGECY is preexisting and non-trivial to fix
Change-Id: I1c54a18fc8ca2de6c5ab4a2ae62d1943fcbaea62
2022-08-17 20:02:57 -07:00
Siim Sammul
e683a42455 Revert "Initialize binder latency histograms collection via Bind..."
Revert "Initialize binder latency histograms collection via Bind..."

Revert submission 17123043-binder-latency-wifi

Reason for revert: unexpected increased memory usage
Reverted Changes:
I2cb0f7b69:Initialize binder latency histograms collection vi...
Id12e3a515:Fix unit tests due to change to binder latency col...
I26dbd757b:Add cts test for WifiFrameworkInitializer for bind...
I0d76cbcb3:Initialize binder latency histograms collection vi...

Change-Id: Ic1450c59e5fdea37133856711f50c90c97e42325
2022-08-17 15:25:34 +00:00
Rhed Jao
04cded96f5 Do not split the suspended packages intent into multiple ones
Previously, we splitted the intent into multiple ones to prevent
from the disclosure of information of packages. This approach impacts
system health. A lots of intents were sent when hundreds of packages
information stored in the intent extras.

This cl stopped splitting of intent. Instead, it passes a filter to the
am#broadcastIntent api for intent broadcast to filter the intent extras
by using the rules of package visibility when passing the intent to the
receiver.

Bug: 238448280
Test: atest AppEnumerationTests
Test: atest SuspendPackagesTest
Test: atest SuspendPackageHelperTest
Change-Id: I6c4051168b855155b49b0bd6b19e0de7dc826df7
2022-08-17 16:37:21 +08:00
Daniel Norman
1e924c4709 Merge "Revert "Limit off-label accessibility access using a new property."" 2022-08-16 23:17:30 +00:00
Thiébaud Weksteen
f6a893c60b Merge "Remove lowpan internal API" 2022-08-16 21:59: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
Daniel Norman
ff3c059c29 Revert "Limit off-label accessibility access using a new property."
Revert submission 19246592-accessibility-tool-only

Reason for revert: Jank regression b/242267091
Reverted Changes:
I0685e6dd4:CTS tests for the accessibilityDataPrivate propert...
I1c02af88c:Limit off-label accessibility access using a new p...

Change-Id: I701b811fd4fb2634872a759134356736a7e8b7dd
2022-08-16 16:13:28 +00:00
Austin Borger
20bcb3c4b8 Add pids to AttributionSource.
The cameraserver has a need for attributing connect calls to particular
processes. This patch introduces pids as a property of an
AttributionSource.

Test: Smoke test on cuttlefish
Bug: 190657833
Bug: 199526514
Change-Id: I6cdffed62447bbb741290dd9c2e5937254d02e3c
2022-08-15 16:59:53 -07:00
Thiébaud Weksteen
7640656825 Remove lowpan internal API
This API is not used: marked as @hide with a commented out @SystemApi;
the AIDL server is not implemented in AOSP nor internally. There is one
extra client from the SEPolicy: wpantund; but there is no build rule for
this binary, and no reference for it in AOSP. This API appears be an
artifact from the initial import of Android Things back in 2017.

I confirmed with the previous owners that there is no intention to use
this API in the future (see bug).

This changes reduces the size of framework.jar by 77kb on
bramble-userdebug.

Bug: 235018188
Test: TH
Change-Id: Id66f5ed23ed26c7185f36454f168e34997be3f8f
2022-08-15 10:13:16 +10:00
Felipe Leme
cf9d95ffe0 Improvements on "start bg user on secondary display":
- Adds hidden API on ActivityManager
- Checks if feature is supported
- Adds shell command to check if user is visible
- Includes (visible) on 'cmd user list -v'

Test: atest CtsMultiUserTestCases:android.multiuser.cts.UserManagerTest#testIsUserVisible_backgroundUserOnSecondaryDisplay
Test: m update-api
Test: adb shell cmd user is-user-visible --display 0 cur

Bug: 239982558

Change-Id: Ie7fe8c832ef2a3ffe4869a67fd35a0da363d0039
2022-08-12 16:45:57 +00:00
Ben Miles
a59b1ed8dc Merge "Add TimeoutRecord" 2022-08-12 12:21:14 +00:00
Daniel Norman
f003dd10b2 Merge "Limit off-label accessibility access using a new property." 2022-08-11 17:04:57 +00:00
Ben Miles
e4cfe35ee9 Add TimeoutRecord
This class contains structured data about a timeout. In this context a timeout is something about to become an ANR (as long as it passes the various ANR deduping/skipping checks). Types of timeout include input dispatch timeout, broadcast receiver timeout etc.

It wraps the ANR subject and contains useful metadata like the value of the system uptime clock when the timeout actually triggered. This is foundational work so that ANR stack latency can be measured and tracked. It will also enable us to log more useful ANR information in perfetto traces.

go/timeout-record

Bug: b/239390223
Test: atest FrameworkServicesTests
Change-Id: I6541b13b4862f6878383d17ba96058b39d36718c
2022-08-11 16:25:31 +00:00
Felipe Leme
4264560e7a Initial implementation of "start bg user on secondary display".
This API will be used on automotives that support multiple displays
to start a passenger user on secondary displays. Once a user is
started this way, it will be "visible"
(i.e. UserManager.isUserVisible() will return true).

This CL provides the very minimum support to such API
(A.K.A. "My Dog, it's full of TODOs!" :-), so it can unblock other
efforts (like changing WindowManager to allow activities to be
launched).

Bug: 239982558

Test: adb shell am start-user --display 42 10
Test: adb shell dumpsys user | egrep '(Users on secondary|isUserVisible)'

Change-Id: I21dc85720da7d0adc24ca9f4573b85ef5a380239
2022-08-10 17:06:18 -07:00
Lee Shombert
1062bc02e8 Merge "Work-around for system property failures" into tm-qpr-dev am: 1b9cdb02a5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19583569

Change-Id: I85f30bed516912222e2b2df01c1c9bebae1fca58
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 22:58:00 +00: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
c4d1b9e6d6 Revert "[DO NOT MERGE] Remove selection toolbar code from build time" am: 888e79f7a0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19204106

Change-Id: I2eed4842d349cb38bd488793cd4bfdf672d4c3cf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 09:19:11 +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
4f879a5565 Merge "Revert "Clear mEnterTransitionCoordinator after content shows."" into tm-qpr-dev am: 283b8e8680 am: ba155b7847
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19435238

Change-Id: Ic4c827f1695a9a0ef1cd3ce2d1e70bda4a60b2a5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-08 18:16:55 +00:00