Migrate to using fixed permissions

When deciding which app/group/channel level fields are editable. If
an app has a fixed notification permission, no importance type fields
(including blocking, importance, minimizing, popping on screen, or
prioirty conversions) can be edited.

Test: Robotests
Bug: 194833441
Change-Id: Idc198ea05cd2ab6e43387ae4e8290f446ccfa0c6
This commit is contained in:
Julia Reynolds
2021-10-29 08:19:10 -04:00
parent e3f34ef7db
commit a024c10517
21 changed files with 272 additions and 211 deletions

View File

@@ -80,7 +80,7 @@ public class BlockPreferenceController extends NotificationPreferenceController
}
bar.setDisabledByAdmin(mAdmin);
if (mChannel != null && !isChannelBlockable()) {
if (mChannel != null && (!isChannelBlockable() || !isChannelConfigurable(mChannel))) {
bar.setSwitchBarEnabled(false);
}
@@ -88,8 +88,7 @@ public class BlockPreferenceController extends NotificationPreferenceController
bar.setSwitchBarEnabled(false);
}
if (mChannel == null && mAppRow.systemApp
&& (!mAppRow.banned || mAppRow.lockedImportance)) {
if (mChannel == null && !isAppBlockable()) {
bar.setSwitchBarEnabled(false);
}