Commit Graph

15758 Commits

Author SHA1 Message Date
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
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
Automerger Merge Worker
fc94ebae09 docs: Fix typo in IMPORTANCE_SERVICE description am: 08a4e470b8 am: edcfda720b
Change-Id: Id0683ebab467f7baaac1650b15dd8e98f8057306
2020-01-06 18:24:58 +00:00
Automerger Merge Worker
edcfda720b docs: Fix typo in IMPORTANCE_SERVICE description am: 08a4e470b8
Change-Id: I32360f63be584c4223c6aae692beb48c0bdf4802
2020-01-06 18:13:01 +00:00
Kevin Hufnagle
08a4e470b8 docs: Fix typo in IMPORTANCE_SERVICE description
Test: make ds-docs -j32

Bug: 140783404

Change-Id: Ife86109eebefe9c87f7c9ed4a0587676e3392d90
Exempt-From-Owner-Approval: Docs-only change
2020-01-03 20:05:31 +00:00
Patrick Baumann
de626c28d7 DO NOT MERGE: Adds artificial package handler latency
This change introduces a means of introducing an artificial long task to
the package handler to help reproduce timing issues related to it.

Bug: 141413692
Test: atest PackageManagerTest
Change-Id: I61ddee1fe8b94f5803d981a77babb4bb19e31662
2019-12-18 20:15:26 +00:00
Chris Wren
bc487b5759 track and report packages with undecorated remoteviews
print query results with:
  adb shell dumpsys notification --remote-view-stats

test the pulled atom with:
  make statsd_testdrive
  ./out/host/linux-x86/bin/statsd_testdrive 10066

Bug: 144855217
Test: atest frameworks/base/services/tests/uiservicestests/src/com/android/server/notification
Change-Id: I6dcc9871f78298a8b213a051223c7316f8feefc5
Merged-In: I773378fc7cfb47a9f9c7495404ddafa63f39cfaf
2019-12-09 15:48:14 -05:00
TreeHugger Robot
659f477f65 Merge "Fixes usage of WallpaperManager to make it optional." into qt-qpr1-dev 2019-11-23 00:05:20 +00:00
TreeHugger Robot
d6dfaf4c9d Merge "Update equals and hashCode methods of NoMan.Policy" into qt-qpr1-dev 2019-11-22 00:51:41 +00:00
Jay Aliomer
381e3300e8 Dark theme twilight mode backend and tile
When the user has Dark theme scheduling turned on (b/141567787), the quick settings tile subtext should reflect the following:
If Dark theme is on: "Until sunrise"
If Dark theme is off: "On at sunset"
If the user does not have Dark theme scheduled, the text should not appear.
This matches the appearance of the Night Light QS tile.
All starting windows snapshots will be deleted and splash screens
will be used instead.

Test: atest UiModeManagerServiceTest
Fix: 143874807
Merged-In: Ie2ce64b5c5544fffe76be7ec3f971eb7461f8c4d

Change-Id: Ie2ce64b5c5544fffe76be7ec3f971eb7461f8c4d
(cherry picked from commit 8b2671b029)
2019-11-21 18:05:22 +00:00
Satakshi Rana
73b4e1923a Merge "Screenshot Notification Smart Action: AiAi and - Sys UI integration" into qt-qpr1-dev 2019-11-19 17:14:49 +00:00
Felipe Leme
8d4c825ce3 Fixes usage of WallpaperManager to make it optional.
As the main javadoc states:
"An app can check whether wallpapers are supported for the current user,
by calling {@link #isWallpaperSupported()}, and whether setting of
wallpapers is allowed, by calling {@link #isSetWallpaperAllowed()}."

Test: manual verification on automotive
Test: atest CtsAppTestCases:android.app.cts.WallpaperManagerTest # on automotive

Bug: 138939803
Bug: 132111956

Change-Id: I88946f92ff54e556d289c41c28e22da3a4b8c8b8
Merged-In: I88946f92ff54e556d289c41c28e22da3a4b8c8b8
(cherry picked from commit 34a861add1)
2019-11-19 01:24:52 +00:00
Satakshi
ce35ce9f08 Screenshot Notification Smart Action: AiAi and - Sys UI integration
Create a constant in ContentSuggestionsManager, which will
be used to pass a hardware bitmap to ContentSuggestionsService.
In the presence of this key in the request extras, we skip taking a
snapshot in ContentSuggestionsPerUserService.
Bitmap is extracted from reading this value from extras in
ContentSuggestionsService.

Create ScreenshotNotificationSmartActionsProvider, which is overridden
in GoogleSystemUI.
Calling AiAi is guarded by a device config flag created in cl/277143225.

(cherry picked from commit d2010f2628 and c45d86fc15)

Test: Manually tested the code in this CL and corresponding change in SystemUIGoogle.
Took a screenshot and verified that AiAi gets invoked and the screenshot notification
shows smart actions.
Ran new tests added in this CL
'atest ScreenshotNotificationSmartActionsTest'
'atest ContentSuggestionsPerUserServiceTest'
Bug: 141634285
Change-Id: I439a4be9aac53fb02b566ae4d438afe3edf2b37a
Merged-In: I439a4be9aac53fb02b566ae4d438afe3edf2b37a
2019-11-18 16:06:08 -08:00
Kevin Hufnagle
0f18e3444e Merge "docs: Updated desc. of lockNow() method and its overload" into qt-dev am: 1ec7235ebe
am: c54b10fa62

Change-Id: I60ce7afd84eae7b1c297e6cc0f246680d84f5cc0
2019-11-18 14:10:11 -08:00
Kevin Hufnagle
c54b10fa62 Merge "docs: Updated desc. of lockNow() method and its overload" into qt-dev
am: 1ec7235ebe

Change-Id: Iec60117a620bf655859555e8d5e3bc028e73b8a0
2019-11-18 14:06:10 -08:00
Kevin Hufnagle
1ec7235ebe Merge "docs: Updated desc. of lockNow() method and its overload" into qt-dev 2019-11-18 21:47:10 +00:00
Kevin Hufnagle
496c0bae14 docs: Updated desc. of lockNow() method and its overload
Explains in more complete detail who should call lockNow(), when to call the method,
and what happens when there's no lock set on a device.

Test: make ds-docs -j32

Bug: 28831838
Change-Id: I5acc0cbfa63dffe8676e8b60476b584fd43b5bde
2019-11-15 19:44:11 +00:00