Remove wrapper class for NotificationGroup.

It's no longer needed as Robolectric can natively support framework
classes

Bug: 76167422
Test: robotests
Change-Id: If0ac597370240b8efaa8df8783a5c309a2322a3f
This commit is contained in:
Fan Zhang
2018-03-30 15:50:11 -07:00
parent 234854cb04
commit 1781cf2cef
13 changed files with 74 additions and 157 deletions

View File

@@ -56,7 +56,7 @@ public class BlockPreferenceController extends NotificationPreferenceController
}
if (mChannel != null) {
return isChannelBlockable();
} else if (mChannelGroup != null && mChannelGroup.getGroup() != null) {
} else if (mChannelGroup != null) {
return isChannelGroupBlockable();
} else {
return !mAppRow.systemApp || (mAppRow.systemApp && mAppRow.banned);
@@ -80,7 +80,7 @@ public class BlockPreferenceController extends NotificationPreferenceController
if (mChannel != null) {
bar.setChecked(!mAppRow.banned
&& mChannel.getImportance() != NotificationManager.IMPORTANCE_NONE);
} else if (mChannelGroup != null && mChannelGroup.getGroup() != null) {
} else if (mChannelGroup != null) {
bar.setChecked(!mAppRow.banned && !mChannelGroup.isBlocked());
} else {
bar.setChecked(!mAppRow.banned);
@@ -107,9 +107,9 @@ public class BlockPreferenceController extends NotificationPreferenceController
mAppRow.banned = blocked;
mBackend.setNotificationsEnabledForPackage(mAppRow.pkg, mAppRow.uid, !blocked);
}
} else if (mChannelGroup != null && mChannelGroup.getGroup() != null) {
} else if (mChannelGroup != null) {
mChannelGroup.setBlocked(blocked);
mBackend.updateChannelGroup(mAppRow.pkg, mAppRow.uid, mChannelGroup.getGroup());
mBackend.updateChannelGroup(mAppRow.pkg, mAppRow.uid, mChannelGroup);
} else if (mAppRow != null) {
mAppRow.banned = blocked;
mBackend.setNotificationsEnabledForPackage(mAppRow.pkg, mAppRow.uid, !blocked);