summaryrefslogtreecommitdiff
path: root/core/java/android/app/NotificationChannel.java
Commit message (Collapse)AuthorAgeFilesLines
* Limit the size of NotificationChannel and NotificationChannelGroupJulia Reynolds2022-08-191-7/+16
| | | | | | | | | | | | | | | | | 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
* Fix blockable system notificationsJulia Reynolds2022-05-111-16/+5
| | | | | | | | | | | | | | | | Notifications can be non-blockable if their app has the permission fixed or if the app holds certain roles. Calculate that on device boot and role change, and use the same source of truth for all UIs. As a bonus, we can remove some systemui binder calls. Test: SystemUiTests & FrameworkUiServicesTests TesT: verify that 'usb debugging connected' notifs are non blockable but magnification ones are, in systemui and settings Fixes: 231662091 Change-Id: I980718ab61196901d976f9ea8ee035eafc021fc8
* Remove notification permission feature flagJulia Reynolds2022-05-041-8/+0
| | | | | | | | And the related obsolete code. Test: SystemUITests, framework services tests, NotificationManagerTest Fixes: 231344755 Change-Id: Id14941f82305b0216f2a12221d4195f8afcc65ab
* Migrate to fixed permission checkingJulia Reynolds2021-11-021-6/+4
| | | | | | | | | To move towards removing the role-based and allowlist methods for preventing notification blocking Test: atest ui services tests, cts NotificationChannelTest Bug: 194833441 Change-Id: I91b0f87863229402a10d8b617502538bbe8686b4
* Revert "Don't restore notification channel if its sound is unavailable"Julia Reynolds2021-08-301-12/+2
| | | | | | | | | This reverts commit 6a5ca92e75738e605090feab3b6f95bf4ff37d84. Reason for revert: This is affecting notification channels that are using the system sound and is resulting in users losing most of their notification settings Change-Id: I350cf8190eec6296a597bef38b711900336ddf75 Fixes: 197129198
* Don't restore notification channel if its sound is unavailableRuslan Tkhakokhov2021-05-041-2/+12
| | | | | | | | | | | | | | | If the sound we're trying to restore is unavailable on the device, we set the sound for that channel to system default. Instead, skip restore of that channel altogether. Bug: 158351264 Test: 1. Make sure the notification sound in Calendar is set to 'App provided sound' -> Run backup -> Wipe the device -> Restore -> Make sure notification sound is still 'App provided sound'. 2. Set notification sound in Calendar to some pre-bundled sound. -> Run backup -> Wipe the device -> Restore -> Make sure notification sound for Calendar is restored correctly. Change-Id: Id0d0a762b381ca1ef7f4cb8305f03e9716282161
* Rename notificationchannel constant valuesJulia Reynolds2021-03-171-2/+2
| | | | | | Test: make Fixes: 183052700 Change-Id: Ib44c142f4aecbd7f834034ef392ff53a05e7ae0e
* Add apis for notification channel editingJulia Reynolds2021-02-161-0/+42
| | | | | | | | | | Allow apps to launch a mini notification channel editing UI targeted at the fields the user wants to edit depending on the launch context. Test: Settings robotests Bug: 177246841 Change-Id: I4ca552ff80e7c55c6845022ef94361fae4cd8e20
* Add retention policy to delete channelsJulia Reynolds2021-01-151-2/+31
| | | | | | | | | | | - On initial upgrade, all currently deleted channels will be cleaned up - Moving forward, deleted channels will be retained for 30 days before being permanently removed Test: atest PreferencesHelperTest, NotificationChannelTest Bug: 177246841 Change-Id: Ibfd33d38e9c7cef51e00ac0b63f295c8734009a6
* Hand-migration to TypedXml interface.Jeff Sharkey2020-12-021-14/+2
| | | | | | | | | | | | Previous changes have applied mechanical refactorings, but this change hand-migrates the remaining logic which was too complex to identify. This change should have no behavior change; famous last words. Bug: 171832118 Test: manual Exempt-From-Owner-Approval: trivial refactoring Change-Id: I85cd830eb6bfde18fca6e73ee7adfdc385a890de
* Mechanically apply TypedXml refaster template.Jeff Sharkey2020-11-301-22/+18
| | | | | | | | | | | This is a purely mechanical CL that applies the output of the recently added refaster templates to help guide towards more efficient TypedXml methods. There is no behavior change. Bug: 171832118 Test: manual Exempt-From-Owner-Approval: trivial refactoring Change-Id: Ic95dd3de77c60482ad36b31706e6b701929f40b3
* Mechanical refactoring to new typed XML classes.Jeff Sharkey2020-11-301-11/+14
| | | | | | | | | | | Related changes are introducing new TypedXmlSerializer and TypedXmlPullParser interfaces which offer efficient access to primitive attributes. Bug: 171832118 Test: manual Exempt-From-Owner-Approval: trivial refactoring Change-Id: Ibd93f353ff3cb1f0b7073ebbeae17fe5194b046b
* Add some missing conversation log fieldsJulia Reynolds2020-11-021-2/+10
| | | | | | Test: cts, manual Fixes: 157240045 Change-Id: I5c77649596612115c8db99d7e32221b07bf1bda6
* Apply fixes for EfficientStrings.Jeff Sharkey2020-10-201-1/+1
| | | | | | | | | Refactoring to avoid StringBuffer synchronization overhead. Bug: 170978902 Test: none Exempt-From-Owner-Approval: trivial refactoring Change-Id: Ibf843ed780c1202d5d96a11eaca889e592f19263
* Remove @TestApi from @SystemApi symbolsAnton Hansson2020-10-201-2/+0
| | | | | | | | | | | | | I ran these commands: cd frameworks/base grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \ 's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs' grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \ 's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs' Bug: 171179806 Test: m checkapi Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789
* Add @Nullable annotation to the parameter of Object.equals() methods.Roman Kalukiewicz2020-10-151-1/+1
| | | | | | | | | | | | | | | | | | Those annotations could be inferred by some tools (like Kotlin), but the https://checkerframework.org/ doesn't check inherited annotations complaining about all equals() invocations that get nullable argument. The change was generated by running find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /' in the frameworks/base directory and by automatically adding and formatting required imports if needed. No manual edits. Bug: 170883422 Test: Annotation change only. Should have not impact. Exempt-From-Owner-Approval: Mechanical change not specific to any component. Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
* Let apps see if their conversations have been demotedJulia Reynolds2020-07-271-1/+4
| | | | | | Test: cts Bug: 154140688 Change-Id: Ief3c2535f3f253e60470c63fde9325e06ceda484
* Fix CTSMady Mellor2020-04-281-6/+13
| | | | | | | | | * fix BubbleExtractor tests to work with this & better test things now that the channel is a tristate Test: atest NotificationManagerTest BubbleExtractorTest Bug: 155025024 Change-Id: I8b75c1b0087ca79cea29741e32c7c524cb056d04
* Make bubble channel setting 3 state with unset / on / offMady Mellor2020-04-211-10/+29
| | | | | | | | | | | Test: atest NotificationManagerTest (with CTS cl) Test: manual - have test app on "all" setting - get a bubble - hit "unbubble" from notification => no longer bubble - get update to that notif, it shouldn't bubble Bug: 154232758 Change-Id: I1611002418cad18ec2426e7d8b4cd4dc93e6df24
* Make bubble settings a pref with an int rather than a boolMady Mellor2020-04-091-13/+8
| | | | | | | | | | | | | This will allow us to do all/selected/none preferences for bubbles in settings. - Feature is on by default - App is none by default - Channel is off by default Test: atest NotificationManagerServiceTest BubbleExtractorTest Bug: 138116133 Change-Id: Ifad1c22525123354f76959c2d44392a25d56347d
* Rename NotificationChannel#setBlockableSystemHall Liu2020-03-131-12/+15
| | | | | | | | | Rename the method to setBlockable. Also rename isBlockableSystem in the same way. Fixes: 151311073 Test: atest NotificationChannelTest Change-Id: Ie25f8aed3c22b74d9ad2329863c4ffebbace03f7
* Increase test coverage for NotificationChannelJulia Reynolds2020-03-101-0/+2
| | | | | | Test: cts Bug: 149361682 Change-Id: I548e42800cf89a225ef1030c53cbbce6ae9a0116
* Address api feedbackJulia Reynolds2020-02-231-4/+6
| | | | | | Test: make Fixes: 150008110 Change-Id: I5163cd49b11444e856cd9bd8ae2fd634da5f6a39
* Separate concept of VIC from DNDJulia Reynolds2020-02-041-4/+33
| | | | | | | | | | | (Very important conversations). Track VICs in a different field, and update DND (and public apis) to allow all, important, or no conversations through. Test: atest, cts Bug: 137397357 Change-Id: Iae04546eb7c0b1e79cfdbeec7311628cd7ad634a
* Do not use @SystemApi(client = MODULE_APPS) (documents/settings)Makoto Onuki2020-01-311-3/+1
| | | | | | | | | | | | There will be no special protection mechanisms around MODULE_APPS, so we're going to remove it for now. All the MODULE_APPS should be protected with a permission, etc, so the change should be safe. Bug: 148177503 Test: Build / treehugger Change-Id: I76328c2d5aaa3f171bf8afde5b3d1accad8c2e2b
* Merge "Expose NotificationChannel#setBlockableSystem as SystemApi"TreeHugger Robot2020-01-171-1/+7
|\
| * Expose NotificationChannel#setBlockableSystem as SystemApiHall Liu2020-01-161-1/+7
| | | | | | | | | | | | | | | | Expose setBlockableSystem as a module-apps-only SystemApi. Bug: 138401571 Test: atest android.app.cts.NotificationChannelTest Change-Id: I0b6a14360e9278a092476ada6533e63a46d4e4fe
* | Allow conversations to be demoted out of the conversation spaceJulia Reynolds2020-01-161-5/+29
|/ | | | | | | | | Also default the flag to allow more notifications into that space to on. Test: atest Bug: 137397357 Change-Id: I225f462879bdb28411cc631a3e259b4c71ba7394
* Add conversation-centric inline controlsJulia Reynolds2020-01-151-4/+5
| | | | | | | | | Round one - needs polish, and actions may be added or removed in the future, and demote isn't working yet. Bug: 137397357 Test: atest Change-Id: Ia52598bec58fc54b8bde29168cd419a24d1e4dab
* Add support for conversation notification channelsJulia Reynolds2020-01-101-25/+88
| | | | | | Bug: 137397357 Test: atest, cts Change-Id: I3d8f9ec2f318ba8a16e6b82f656884cf142adf9c
* Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-1/+1
| | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I8789f8499d4dca08580672e9e45ed9a7026dd686
* Rename writeToProto to be dumpDebugJeffrey Huang2019-12-051-2/+2
| | | | | | | | | We want to eventually migrate some of these APIs to be @SystemApi for mainline modules. The #dumpDebug name is more appropriate than #writeToProto. Bug: 142279786 Test: Manual Change-Id: I60793e91cedf6b720d4ecef6a8484f4fed4ff30f
* Address API review feedbackJulia Reynolds2019-09-051-0/+8
| | | | | | | | | Make methods fully public, add documentation, swap what method is public Test: make Fixes: 139833596 Bug: 138589409 Change-Id: If39d6423efedcf8578dc2942274f6fbb341d164a
* Make some APIs used by ExtService module @SystemApiJulia Reynolds2019-08-191-0/+1
| | | | | | | | | | These are all pieces of data apps could get anyway; these are code nice-to-haves to reduce code replication Test: make Bug: 122138479 Bug: 138589409 Change-Id: Ie8ffacb6c28840f779c68f7aa95f1405e70f5ce5
* Record initial app given importanceJulia Reynolds2019-06-251-4/+34
| | | | | | | | | | | | | To allow users an easy way to 'go back to how it was' (also migrate some tests to other files) Test: atest, cts Bug: 135751328 (cherry picked from commit 03de363ce278b6d708a6d30f83468584a14a65d5) Change-Id: I949f366410d2cb2ab424b1b03222743e6e60d867
* Noti importance from certain Roles cannot be modifiedJulia Reynolds2019-03-291-3/+27
| | | | | | | | | by the notification assistant or user, like the default phone app. Fixes: 129358763 Test: atest Change-Id: I40ef7ff403e2b0d81abe09f15c8804c2d3d2fb8a
* All Parcelable CREATOR fields are @NonNull.Jeff Sharkey2019-02-281-1/+1
| | | | | | | | | If they were null, then the Parcelable would fail to work. Bug: 126726802 Test: manual Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014 Exempt-From-Owner-Approval: Trivial API annotations
* Add settings for notification bubblingJulia Reynolds2019-02-051-9/+1
| | | | | | | | | And a new api to consolidate that information for notification listeners Test: atest Bug: 123543052 Change-Id: I61d1718ef5b5bb8ab824d4c3efff511669266313
* Create BubbleMetadata use it instead of app overlay intentMady Mellor2019-01-151-25/+25
| | | | | | | | | | * BubbleMetadata encapsulates necessary info to display a bubble * Replaces app overlay intent usages with BubbleMetadata * Renames existing bubble APIs to use 'bubble' rather than 'app overlay' Bug: 111236845 Test: existing tests pass Change-Id: I6a85d3c41dda47139fb8d960cadf1c8e109cf29b
* Don't allow importance updates for oem locked channelsJulia Reynolds2019-01-141-20/+44
| | | | | | | Test: atest, make sure missed call notifications are no longer demoted by aosp notification assistant Change-Id: I80728bae67501d64359e0dac02dca928c34a7e95 Fixes: 122657004
* Add APIs for notification app overlaysJulia Reynolds2018-10-251-46/+79
| | | | | | | | | - Can be enabled/disabled at channel and channel group levels - An activity to launch can be added to notification Test: atest, cts Bug: 111236845 Change-Id: I9a4832211676cca4649d1f28e6e3e3157954d268
* Additional functionality for the noti asstJulia Reynolds2018-10-221-2/+3
| | | | | | | | | | | - Allow apps to learn if users chose the importance of a given channel - Allow the asst to query channels and channel groups of installed apps Change-Id: Ic65dfdc79d5135940c1debb101b849b5837d78b5 Fixes: 118140597 Test: runtest systemui-notification
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | For packages: android.app.usage android.app.trust android.app.timezonedetector android.app.timezone android.app.timedetector android.app.job android.app.backup android.app.assist android.app.admin android.app This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: I618c5dc4462ae990d9df45c3e9ed3f092cc5138c
* The quietening round 2 part 1Julia Reynolds2018-08-101-0/+7
| | | | | | | | | | | | | | | Allow the notification assistant to block or silence incoming notifications, or demote notifications after they are posted Also temporarily silence everything by default Plus: bonus refactoring of the cancel notification runnable so I could write just one of those tests :) Bug: 111475013 Test: manual, runtest systemui-notification Change-Id: Ifa04a21919f60d06080cd63e7d7747180b641308
* Merge "Move channel logging to dump method and redact name."Aaron Heuckroth2018-07-101-0/+27
|\
| * Move channel logging to dump method and redact name.Aaron Heuckroth2018-07-091-0/+27
| | | | | | | | | | | | Test: Generate bug report and confirm that NotificationChannel logs contain redacted name strings. Change-Id: Iebaf7b165de0276e69ead862aa7ec864ef912282 Fixes: 78326066
* | Improve backup and restore for empty soundsJulia Reynolds2018-06-221-2/+2
|/ | | | | | Test: runtest systemui-notification Change-Id: Iab2eebb0da8163f520af95c2ad5fd8f35333a9d5 Fixes: 109777940
* Work on issue #77931346: The notification that should not be named appearedDianne Hackborn2018-05-011-0/+25
| | | | | | | | | | | Keep track of whether a foreground service has been shown in a notification channel and, the first time one is, make sure the channel is sufficiently important regardless of what the user or app last set for it. Bug: 77931346 Test: runtest systemui-notification Change-Id: Idecad2dceb8cc918feec91ca1ee26edf3d3ab7de
* Update incorrect documentationJulia Reynolds2018-04-101-9/+14
| | | | | | Test: make Change-Id: I3a35ed86600b3b12ced4aecc35a0415e8e05a502 Fixes: 77862126
* Update notification blocking documentation.Julia Reynolds2018-03-291-1/+5
| | | | | | Change-Id: I3e5425321d127fbf11adfa1c4ac5bed53fc73e03 Fixes: 73750866 Test: make