Restore original importance when unblocking notif channel

Test: atest
Bug: 62355992
Change-Id: I5d764d0ade68b2ce5708ae79e9ef488ab57bb141
This commit is contained in:
Julia Reynolds
2020-07-08 15:09:41 -04:00
parent 4395ef199a
commit e2a8266328
3 changed files with 9 additions and 26 deletions

View File

@@ -106,8 +106,11 @@ public class BlockPreferenceController extends NotificationPreferenceController
// It's always safe to override the importance if it's meant to be blocked or if
// it was blocked and we are unblocking it.
if (blocked || originalImportance == IMPORTANCE_NONE) {
final int importance = blocked ? IMPORTANCE_NONE
: isDefaultChannel() ? IMPORTANCE_UNSPECIFIED : IMPORTANCE_DEFAULT;
final int importance = blocked
? IMPORTANCE_NONE
: isDefaultChannel()
? IMPORTANCE_UNSPECIFIED
: mChannel.getOriginalImportance();
mChannel.setImportance(importance);
saveChannel();
}