Commit Graph

17976 Commits

Author SHA1 Message Date
Jing Ji
5d4989646c Merge "DO NOT MERGE: ActivityManager#killBackgroundProcesses can kill caller's own app only" into rvc-dev 2023-03-03 00:43:37 +00:00
Christophe Pinelli
1d737c2fbd [DO NOT MERGE] Backport BAL restrictions from S to R, this blocks apps from using Alarm
Manager to bypass BAL restrictions.

Test: atest BackgroundActivityLaunchTest
Bug: 195756028
Change-Id: Ifa3f79bc74c10d0ac8322079f2e6e3e0ba476b0f
2023-01-09 18:11:26 +00:00
Jing Ji
8b382775b2 DO NOT MERGE: ActivityManager#killBackgroundProcesses can kill caller's own app only
unless it's a system app.

Bug: 239423414
Bug: 223376078
Test: atest CtsAppTestCases:ActivityManagerTest
Merged-In: I35d20539ffac055a6d61260445620f45584bd9c5
Merged-In: Ieed6af77da1bc31cfecc5272b9f97971db7ae7b2
Merged-In: I8b8a427ee87339cc038e53adc0912283b05d2cfc
Change-Id: Iac6baa889965b8ffecd9a43179a4c96632ad1d02
2022-11-01 21:53:49 +00:00
Yuri Lin
83d23fb275 [DO NOT MERGE] Fix conditionId string trimming in AutomaticZenRule
This change only applies to S branches and earlier.

Bug: 253085433
Bug: 242703460
Bug: 242703505
Bug: 242703780
Bug: 242704043
Bug: 243794204
Test: AutomaticZenRuleTest
Change-Id: Iae423d93b777df8946ecf1c3baf640fcf74990ec
Merged-In: Iae423d93b777df8946ecf1c3baf640fcf74990ec
2022-10-18 15:30:27 +00:00
TreeHugger Robot
539fea38c2 Merge "Stop managed profile owner granting READ_SMS" into qt-dev am: 62044e5099 am: 676cefb0ee
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15982545

Change-Id: I7a377d2787cb077e3d717558da0b21e297699112
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-08 12:36:21 +00:00
TreeHugger Robot
676cefb0ee Merge "Stop managed profile owner granting READ_SMS" into qt-dev am: 62044e5099
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15982545

Change-Id: I3bf51cd6e7046c7e128f1008ed830c5e02603f88
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-08 12:05:20 +00:00
TreeHugger Robot
62044e5099 Merge "Stop managed profile owner granting READ_SMS" into qt-dev 2022-10-08 11:41:10 +00:00
Julia Reynolds
23ffc379fe Merge "Fix NPE" into qt-dev am: 261b601d25
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19886859

Change-Id: I1d34705e2995a26c7f396fef7027031d62010990
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-22 19:31:57 +00:00
Julia Reynolds
a375542897 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
(cherry picked from commit 6f02c07176)
2022-09-08 14:05:01 +00:00
Julia Reynolds
ad30b85784 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
(cherry picked from commit 6f02c07176)
2022-09-08 14:04:25 +00:00
Yuri Lin
e5fdd7f0de Merge "Trim any long string inputs that come in to AutomaticZenRule" into qt-dev am: 380ec03dee
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19816794

Change-Id: I86c52b898436188c231a44b342c0ccd1672e07dd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-06 23:34:37 +00:00
Yuri Lin
c4b2c877ec 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
Merged-In: I110172a43f28528dd274b3b346eb29c3796ff2c6
(cherry picked from commit de172ba0d4)
2022-09-01 18:54:21 +00:00
Yuri Lin
1fcd99f5aa 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
Merged-In: I110172a43f28528dd274b3b346eb29c3796ff2c6
(cherry picked from commit de172ba0d4)
2022-09-01 18:54:01 +00:00
Julia Reynolds
f1c5754b97 Limit the size of NotificationChannel and NotificationChannelGroup am: c2d264989a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19696126

Change-Id: Ida57571c08e6c1be93b7b70adff8fce3759c109a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-23 18:44:15 +00:00
Julia Reynolds
c2d264989a 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
Merged-In: I0925583ab54d6c81c415859618f6b907ab7baada
(cherry picked from commit 3850857cb0)
2022-08-23 13:22:33 +00:00
Julia Reynolds
6d417539d7 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
(cherry picked from commit 3850857cb0)
2022-08-22 17:27:35 +00:00
Julia Reynolds
1eaa443544 Store DND rule owners am: eda171cffa
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19197499

Change-Id: I9014b79735494dd9ea763ec18490bb2b12b6ecf5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 21:26:47 +00:00
Julia Reynolds
eda171cffa Store DND rule owners
Test: uiservicestest, cts
Bug: 189332346
Bug: 235823407

Change-Id: Ie546c15c25fcbd193b67cb997220f075691e9bab
Merged-In: Ie546c15c25fcbd193b67cb997220f075691e9bab
2022-07-07 15:50:29 +00:00
Julia Reynolds
422cffbefa Store DND rule owners
Test: uiservicestest, cts
Bug: 189332346
Bug: 235823407

Change-Id: Ie546c15c25fcbd193b67cb997220f075691e9bab
Merged-In: Ie546c15c25fcbd193b67cb997220f075691e9bab
2022-07-07 15:50:11 +00:00
Jonathan Scott
9a83111755 [qt] RESTRICT AUTOMERGE Add finalizeWorkProfileProvisioning. am: c5037ec63c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17587088

Change-Id: I61409fd5cbe7409884dfe0e439d116b098cf9737
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-06 20:34:58 +00:00
Jonathan Scott
c5037ec63c [qt] RESTRICT AUTOMERGE Add finalizeWorkProfileProvisioning.
Test: atest android.devicepolicy.cts.DevicePolicyManagerTest
Bug: 210469972
Change-Id: I2de99f9ccd8b27ffdc2562fa451f132e73d54317
2022-04-06 09:23:04 +00:00
Jonathan Scott
bde28d286e [rvc] RESTRICT AUTOMERGE Add finalizeWorkProfileProvisioning.
Test: atest android.devicepolicy.cts.DevicePolicyManagerTest
Bug: 210469972
Change-Id: I2de99f9ccd8b27ffdc2562fa451f132e73d54317
2022-04-05 18:47:56 +00:00
Wu Ahan
14bfa0cbd0 Revert "DO NOT MERGE: Decode the input of both setStream and setResource calls first" am: b6509bdc18
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16630308

Change-Id: I27fbeb2579c5c9ff689b5e20593195bd66cb07de
2022-01-19 22:14:40 +00:00
Wu Ahan
cc4fe8984a Revert "DO NOT MERGE: Decode the input of both setStream and setResource calls first"
This reverts commit fa9c73975e.

Reason for revert: will deliver a better fix for that, ag/16580245.

Change-Id: I567f20b4f545bed906938731c27eac6eb7aeddff
2022-01-13 14:43:00 +00:00
Wu Ahan
b6509bdc18 Revert "DO NOT MERGE: Decode the input of both setStream and setResource calls first"
This reverts commit 4d91b5aa0b.

Reason for revert: will deliver a better fix for that, ag/16580245.

Change-Id: I8691f47251157aae83d326eb808dd1c06b13a420
2022-01-13 14:41:40 +00:00
Wu Ahan
6910c87745 DO NOT MERGE: Decode the input of both setStream and setResource calls first am: 4d91b5aa0b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16379915

Change-Id: Id96d35b0fe3a31764221a584faed10dd8780f849
2021-12-09 01:43:00 +00:00
Wu Ahan
4d91b5aa0b DO NOT MERGE: Decode the input of both setStream and setResource calls first
The size of the input of both setStream and setResource may very big
that system server got oom while handling it, so we try to decode it
first before copying it to the wallpaper path, if the decoding fails, we
treat the input as an invalid input.

Bug: 204087139
Test: Manually set wallpaper, no PDoS observed.
Change-Id: I014cf461954992782b3dfa0dde67c98a572cc770
2021-12-06 03:16:20 +00:00
Wu Ahan
fa9c73975e DO NOT MERGE: Decode the input of both setStream and setResource calls first
The size of the input of both setStream and setResource may very big
that system server got oom while handling it, so we try to decode it
first before copying it to the wallpaper path, if the decoding fails, we
treat the input as an invalid input.

Bug: 204087139
Test: Manually set wallpaper, no PDoS observed.
Change-Id: I014cf461954992782b3dfa0dde67c98a572cc770
2021-12-06 03:13:06 +00:00
Varun Shah
d95ce6779d Update deletion conditions for a package's UsageStats.
If a profile owner is defined for a specific user, do not delete usage
stats for a package on package deletion.

Bug: 197399948
Test: atest  UsageStatsTest [all]
Change-Id: I94a8e3dfca8ef4c7616f77944d61726e06043b85
Merged-In: I94a8e3dfca8ef4c7616f77944d61726e06043b85
2021-11-11 10:13:47 -08:00
Alex Johnston
d5146f80cc Stop managed profile owner granting READ_SMS
Reason: There is only one telephony stack shared
between the personal and work profile.

Bug: 194382185
Bug: 189942529
Test: build
Change-Id: If0d27a317a7c0ee46af371b30208327e5636c7cf
2021-10-05 11:44:37 +00:00
Bernardo Rufino
f7c195b4e9 Merge "Fix background bypass via notifications" into qt-dev am: 22500563c1 am: 57af3050d2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14937196

Change-Id: I0bf46422d4f7d2621a33776a4c98375d566af117
2021-06-30 15:41:55 +00:00
Bernardo Rufino
57af3050d2 Merge "Fix background bypass via notifications" into qt-dev am: 22500563c1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14937196

Change-Id: I193bfe3aa08c2f397d037c2d5c71cfe854cd343d
2021-06-30 15:30:23 +00:00
Bernardo Rufino
14c1c7b4a7 Fix background bypass via notifications
This is a CP of ag/14736230 to qt-dev.

Apps were able to bypass BAL and BG-FGS restrictions by retrieving their
own notifications and firing their PI since those were allowlisted for
those operations.

Now we strip the token that granted them that ability
from notifications returned via NM.getActiveNotifications(), which
returns the notifications of the caller.

Notifications returned via notification listener APIs still contain such
token, as they should.

Bug: 185388103
Bug: 169821287
Test: Manually tested
Change-Id: I2ede0d639a560f6acacec3864a0a7d23af152ba5
Merged-In: I2ede0d639a560f6acacec3864a0a7d23af152ba5
(cherry picked from commit 5fbeff59df)
2021-06-24 18:15:04 +00:00
Aemon Cannon
d2317d0fac Merge "Add instrumented app to JAR path (isolated splits)" into qt-qpr1-dev 2021-04-28 22:38:41 +00:00
Christopher Tate
3c507386ca DO NOT MERGE - Disallow deletion of channels with FGS notifications am: 88380a00d5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13728411

Change-Id: I5c649a005fb5ad7bd904b64d03488a6be6ff30f7
2021-04-27 21:22:35 +00:00
Jason O'Brien
472e9444ac Add instrumented app to JAR path (isolated splits)
The base APK is loaded during normal execution even when isolated splits
are requested. This preserves that behavior during instrumented tests,
which previously skipped the base APK (causing class loading errors).

Test: tested on device with a trivial automated instrumented test
Bug: 146183755
Change-Id: Ia54072ee91b7c06cb4a787a8954ad2e69b322cac
(cherry picked from commit 6f2978c9fc)
2021-04-19 22:04:25 +00:00
Christopher Tate
88380a00d5 DO NOT MERGE - Disallow deletion of channels with FGS notifications
Bug: 156090809
Test: atest CtsAppTestCases:NotificationManagerTest
Test: atest CtsAppTestCases:android.app.cts.ServiceTest
Change-Id: I1c2bb78d86f194585d273661cecf3419f51965df
Merged-In: I1c2bb78d86f194585d273661cecf3419f51965df
2021-03-19 04:24:45 +00:00
Christopher Tate
8cb7e0a881 DO NOT MERGE - Disallow deletion of channels with FGS notifications
Bug: 156090809
Test: atest CtsAppTestCases:NotificationManagerTest
Test: atest CtsAppTestCases:android.app.cts.ServiceTest
Change-Id: I1c2bb78d86f194585d273661cecf3419f51965df
(cherry picked from commit 39b3890268913bc2dc8b90671d042c0e9b4090d2)
2021-03-18 08:11:45 -07:00
Kevin Hufnagle
05efe90a8d Merge "docs: Remove error in requestPermissions doc" into rvc-dev 2021-01-11 18:56:59 +00:00
Tiem Song
a9565b2cb0 Update link for Permissions samples in Javadoc
Bug: 158042826
Change-Id: I71ab17b21b31ff6584facd023e4c4818b0ab1b55
Merged-In: I71ab17b21b31ff6584facd023e4c4818b0ab1b55
Test: N/A
2020-12-02 20:50:04 -08:00
Kevin Hufnagle
bd7aba8cbf docs: Remove error in requestPermissions doc
If an app has already been granted a permission and it requests that
permission again, the user shouldn't see a system dialog. Update the
documentation to reflect this intended behavior.

Test: m ds-docs-java

Bug: 157530031

Exempt-From-Owner-Approval: Docs-only change
Change-Id: I7096e17480831324dee72f4093cdaa064e3b9165
2020-11-24 18:30:38 -05:00
TreeHugger Robot
8b1151e4d5 Merge "[RESTRICT AUTOMERGE] Revert "[RESTRICT AUTOMERGE] Revert "Require permission to create trusted displays""" into rvc-dev 2020-10-16 18:26:02 +00:00
Charles Chen
c947b10f99 [RESTRICT AUTOMERGE] Revert "[RESTRICT AUTOMERGE] Revert "Require permission to create trusted displays""
This reverts commit ae03031efe.

Reason for revert: Merge the reverted patch by accident.

Bug: 162627132
Change-Id: Ic2f072730050cb47926cec6ed24af7ef9e5e7055
2020-10-13 01:14:25 +00:00
Linus Tufvesson
334190f26e Update javadoc for setLaunchDisplayId
.. to match behavior post I1f9662c2bd14b34e00fbc8ebb926538f0329c37a

Bug: 167593637
Test: Javadoc change only.
Change-Id: I4cb9fe4a5ae74b1474f9da39b6aeb3a374f8cf12
2020-10-09 09:54:40 +00:00
Pinyao Ting
df8bc34ba6 Fix the issue provider can be wrong when requesting slice permission am: e3eba1322b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12687714

Change-Id: Ie3fefe8638c85c5b887b62612cfd5c5a338b827b
2020-10-05 23:01:26 +00:00
Charles Chen
5c393cb830 Merge "[RESTRICT AUTOMERGE] Revert "Require permission to create trusted displays"" into rvc-dev 2020-09-29 05:59:59 +00:00
Charles Chen
ae03031efe [RESTRICT AUTOMERGE] Revert "Require permission to create trusted displays"
This reverts commit f21c885ca7.

Reason for revert: Have regression b/168268396.
Needs to pull out from Nov. builds.

Bug: 162627132

Change-Id: I29fa3937d1655a0cc7591abcfa2067f4fb2b2bcb
2020-09-29 03:21:52 +00:00
Pinyao Ting
149bb7e038 Fix the issue provider can be wrong when requesting slice permission
SlicePermissionActivity reads provider_pkg from intent, which can be
modified at will. As a result user might see incorrect package name in
the dialog granting slice permission.

Bug: 159145361
Test: manual
Merged-In: I8b66c02786df4096dad74b7e76255d5ddd1d609d
Change-Id: I8b66c02786df4096dad74b7e76255d5ddd1d609d
(cherry picked from commit 0ad32a2d70)
2020-09-24 19:06:32 +00:00
Pinyao Ting
e3eba1322b Fix the issue provider can be wrong when requesting slice permission
SlicePermissionActivity reads provider_pkg from intent, which can be
modified at will. As a result user might see incorrect package name in
the dialog granting slice permission.

Bug: 159145361
Test: manual
Merged-In: I8b66c02786df4096dad74b7e76255d5ddd1d609d
Change-Id: I8b66c02786df4096dad74b7e76255d5ddd1d609d
(cherry picked from commit 0ad32a2d70)
2020-09-24 19:06:07 +00:00
TreeHugger Robot
06adb3f55c Merge "Sanitize more of the notification text fields" into pi-dev am: c0ec138c47
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12512485

Change-Id: Ie8e9b9a1273f5fd48a038f16749a7ecdd85078cf
2020-09-09 23:57:36 +00:00