Commit Graph

15773 Commits

Author SHA1 Message Date
Yuri Lin
7c930d9283 [DO NOT MERGE] Fix conditionId string trimming in AutomaticZenRule am: 303f6bde89
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20208339

Change-Id: I8183044f038567ba8061959e0ea372f3b047944f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-18 21:28:44 +00:00
Yuri Lin
303f6bde89 [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:15 +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
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
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
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
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
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
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
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
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
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
Julia Reynolds
8061246d4a Sanitize more of the notification text fields
Test: manual; monitor SystemUI performance when an app tries to
post a messaging style notification with messages with long text
Bug: 158304295
Bug: 147358092

Merged-In: c953fdf6bc
Change-Id: I0e2ea12fc3351b1a56645b556720ea2306f5422a
(cherry picked from commit c953fdf6bc)
2020-09-03 19:39:55 +00:00
Julia Reynolds
7857da6431 Sanitize more of the notification text fields
Test: manual; monitor SystemUI performance when an app tries to
post a messaging style notification with messages with long text
Bug: 158304295
Bug: 147358092

Merged-In: c953fdf6bc
Change-Id: I0e2ea12fc3351b1a56645b556720ea2306f5422a
(cherry picked from commit c953fdf6bc)
2020-09-03 19:38:08 +00:00
Linus Tufvesson
eb827bb278 RESTRICT AUTOMERGE am: 7faec2493b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11326773

Change-Id: I04e0d0d822ba6ecc65f9433ad5229ceef6f37468
2020-06-03 12:15:47 +00:00
Linus Tufvesson
d663d274ea RESTRICT AUTOMERGE
This change is the union of
I2aaab1903dee54190338f7b6e49888aa51437108 and I58834636e092f992e403342e36b475dc60e8f20ai

Original CL descriptions:

*** I2aaab1903dee54190338f7b6e49888aa51437108
Block TYPE_PRESENTATION windows on default display

... and any other display that isn't considered a public presentation
display, as per Display.isPublicPresentation()

*** I58834636e092f992e403342e36b475dc60e8f20a
Use TYPE_PRIVATE_PRESENTATION for private presentations
Detect if the Presenation is targeting a private virtual display, and if they
are use the windowType TYPE_PRIVATE_PRESENTATION.
***

Bug: 141745510
Test: atest CtsWindowManagerDeviceTestCases:android.server.wm.PresentationTest CtsDisplayTestCases:android.display.cts.VirtualDisplayTest

Change-Id: I9f1c4b140ab4bc6183151aafc5501e8648fbc3fa
2020-05-05 11:13:51 +01:00
Linus Tufvesson
7faec2493b RESTRICT AUTOMERGE
This change is the union of
I2aaab1903dee54190338f7b6e49888aa51437108 and I58834636e092f992e403342e36b475dc60e8f20a

Original CL descriptions:

*** I2aaab1903dee54190338f7b6e49888aa51437108
Block TYPE_PRESENTATION windows on default display

... and any other display that isn't considered a public presentation
display, as per Display.isPublicPresentation()

*** I58834636e092f992e403342e36b475dc60e8f20a
Use TYPE_PRIVATE_PRESENTATION for private presentations

Detect if the Presenation is targeting a private virtual display, and if they
are use the windowType TYPE_PRIVATE_PRESENTATION.
***

Bug: 141745510
Test: atest CtsWindowManagerDeviceTestCases:android.server.wm.PresentationTest CtsDisplayTestCases:android.display.cts.VirtualDisplayTest

Change-Id: I9f1c4b140ab4bc6183151aafc5501e8648fbc3fa
2020-05-01 18:34:59 +01:00
Linus Tufvesson
8f258aaee1 RESTRICT AUTOMERGE am: a9211d687d
Change-Id: I48884c93a30f03f0803ebfe939c2b5cedad70321
2020-04-02 13:47:14 +00:00
Linus Tufvesson
0b23243935 Merge "RESTRICT AUTOMERGE" into pi-dev 2020-04-02 13:31:56 +00:00
Linus Tufvesson
04897a9bbd Merge "RESTRICT AUTOMERGE" into qt-dev 2020-04-02 13:31:13 +00:00
Linus Tufvesson
a9211d687d RESTRICT AUTOMERGE
Revert submission 10383599-type-presentation-q

Reason for revert: Breaks apps using Presentation in combination with private virtual displays
Reverted Changes:
I2aaab1903:RESTRICT AUTOMERGE Block TYPE_PRESENTATION windows...
Ib5a24f8be:RESTRICT AUTOMERGE Add test for Presentation

Bug: 141745510

Change-Id: I0b3a332c286900952b65ece12435f981e324cb5b
2020-03-31 17:39:41 +00:00
Linus Tufvesson
b235ee8617 RESTRICT AUTOMERGE
Revert submission 10446362-type-presentation-p

Reason for revert: Breaks apps using Presentation in combination with private virtual displays
Reverted Changes:
Ib5a24f8be:RESTRICT AUTOMERGE Add test for Presentation
I2aaab1903:RESTRICT AUTOMERGE Block TYPE_PRESENTATION windows...

Bug: 141745510

Change-Id: I9e8a02d5162cd5f8fb0f1860c4d4f099c718a946
2020-03-31 17:37:45 +00:00
Automerger Merge Worker
20cd95a7f6 RESTRICT AUTOMERGE am: 60a6583adf
Change-Id: I387d6fcf719b56132baeff486aebce875d76f602
2020-03-11 20:05:08 +00:00
TreeHugger Robot
3d4cf34685 Merge "RESTRICT AUTOMERGE Block TYPE_PRESENTATION windows on default display" into qt-dev 2020-03-11 19:25:05 +00:00
TreeHugger Robot
5c1ada4bb3 Merge "RESTRICT AUTOMERGE Block TYPE_PRESENTATION windows on default display" into pi-dev 2020-03-11 04:55:07 +00:00
Christopher Tate
45a53e6cb8 DO NOT MERGE - Kill apps outright for API contract violations
...rather than relying on in-app code to perform the shutdown.

Bug: 128649910
Bug: 140108616
Test: manual
Test: atest OsHostTests#testForegroundServiceBadNotification
Change-Id: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
Merged-In: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
2020-03-10 22:32:13 +00:00
Linus Tufvesson
bf89805ea3 RESTRICT AUTOMERGE
Block TYPE_PRESENTATION windows on default display

... and any other display that isn't considered a public presentation
display, as per Display.isPublicPresentation()

Bug: 141745510
Test: cts-tradefed run cts -m CtsActivityManagerDeviceTestCases -t android.server.am.PresentationTest
Change-Id: I2aaab1903dee54190338f7b6e49888aa51437108
2020-03-04 10:05:55 -08:00
Linus Tufvesson
60a6583adf RESTRICT AUTOMERGE
Block TYPE_PRESENTATION windows on default display

... and any other display that isn't considered a public presentation
display, as per Display.isPublicPresentation()

Bug: 141745510
Test: cts-tradefed run cts -m CtsWindowManagerDeviceTestCases -t android.server.wm.PresentationTest
Change-Id: I2aaab1903dee54190338f7b6e49888aa51437108
2020-03-04 10:01:09 -08:00
Felipe Leme
85382ce4d2 Disabled some DEBUG constants.
Bug: 138939803
Bug: 142965266
Bug: 148457657

Test: echo 'in TH we trust!'

Change-Id: Ie3112fa1965d9b03bc142924ca17cf27dd6aa44d
(cherry picked from commit e966b8e76d26283163721620528eea0bfd77b43c)
2020-02-07 11:52:28 -08:00
Christopher Tate
38567a6051 DO NOT MERGE - Kill apps outright for API contract violations
...rather than relying on in-app code to perform the shutdown.

Bug: 128649910
Bug: 140108616
Test: manual
Test: atest OsHostTests#testForegroundServiceBadNotification
Change-Id: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
Merged-In: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
2020-02-05 12:32:21 -08:00
Christopher Tate
a79b6ba5c5 DO NOT MERGE - Kill apps outright for API contract violations
...rather than relying on in-app code to perform the shutdown.

Backport of security fix.

Bug: 128649910
Bug: 140108616
Test: manual
Test: atest OsHostTests#testForegroundServiceBadNotification
Change-Id: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
Merged-In: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
2020-02-04 16:59:47 -08:00
Automerger Merge Worker
895d932835 DO NOT MERGE: Adds artificial package handler latency am: de626c28d7
Change-Id: I5303926e34c973ca9e4a7d12d0f4cd46e2fbcde8
2020-01-27 20:14:59 +00:00
TreeHugger Robot
99fd132c3a Merge "DO NOT MERGE: Adds artificial package handler latency" into qt-dev 2020-01-27 20:08:14 +00:00
Philip P. Moltmann
73e2690ede DO NOT MERGE Remove unnecessary internal APIs.
Test: Built
Bug: 146463528
Bug: 146590200
Bug: 147649036
Change-Id: I5391ac4989d7d5712982f5608f9fc28cf7935b00
2020-01-14 19:42:44 +00:00