diff options
author | Elliot Sisteron <elliotsisteron@google.com> | 2023-10-04 14:48:28 +0000 |
---|---|---|
committer | Elliot Sisteron <elliotsisteron@google.com> | 2023-10-04 15:34:46 +0000 |
commit | 723041477a5ad2b026e9b8d10a06fb862224c30a (patch) | |
tree | 9af62b3c9536f84151a17eadcc640f9814464623 /service | |
parent | 9bb2b848f2a79a9de49849ce9fbac609ee91ab5a (diff) | |
download | Permission-723041477a5ad2b026e9b8d10a06fb862224c30a.tar.gz |
Speed up SafetyCenterNotificationTest.
These tests wait for all notifications to go away in teardown. This
includes the success notifications tests. But these notifications
have an auto cancel of 10s, so they wait unecessarily for 10s.
Fixed by cancelling these notifications manually instead.
Also fixes a bug where we would still attempt to show an empty
notification if the source doesn't specify an error message
(we should have either a default success message or skip sending
a notification). I realized this because the
`successfulNoSuccessMessage` test would still take 10s to complete.
Bug: 293611291
Test: atest SafetyCenterNotificationTest
Relnote: Fix an issue where an empty notification shows when
resolving issue from Safety Center notification
Change-Id: I24d963ffe0c477a76d419ff7675f60cc814838bf
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/safetycenter/notifications/SafetyCenterNotificationFactory.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/service/java/com/android/safetycenter/notifications/SafetyCenterNotificationFactory.java b/service/java/com/android/safetycenter/notifications/SafetyCenterNotificationFactory.java index 0624bad82..84001f249 100644 --- a/service/java/com/android/safetycenter/notifications/SafetyCenterNotificationFactory.java +++ b/service/java/com/android/safetycenter/notifications/SafetyCenterNotificationFactory.java @@ -84,6 +84,10 @@ final class SafetyCenterNotificationFactory { SafetySourceIssue issue, SafetySourceIssue.Action action, @UserIdInt int userId) { + if (action.getSuccessMessage() == null) { + return null; + } + String channelId = mNotificationChannels.getCreatedChannelId(notificationManager, issue); if (channelId == null) { return null; |