Merge "App Bubble control page should always be available, even if off globally" into qt-dev am: f7f1dd37c2 am: 4740a76fd4

am: 34c7eac424

Change-Id: I64398601c3d1f37a124c04f4e042a34ae1c45673
This commit is contained in:
Mady Mellor
2019-05-24 16:36:57 -07:00
committed by android-build-merger
4 changed files with 21 additions and 5 deletions

View File

@@ -64,7 +64,7 @@ public class AppBubbleNotificationSettings extends NotificationSettingsBase impl
controllers.add(new BubblePreferenceController(context, fragment != null
? fragment.getChildFragmentManager()
: null,
new NotificationBackend()));
new NotificationBackend(), true /* isAppPage */));
return controllers;
}

View File

@@ -41,11 +41,13 @@ public class BubblePreferenceController extends NotificationPreferenceController
static final int SYSTEM_WIDE_OFF = 0;
private FragmentManager mFragmentManager;
private boolean mIsAppPage;
public BubblePreferenceController(Context context, @Nullable FragmentManager fragmentManager,
NotificationBackend backend) {
NotificationBackend backend, boolean isAppPage) {
super(context, backend);
mFragmentManager = fragmentManager;
mIsAppPage = isAppPage;
}
@Override
@@ -58,7 +60,7 @@ public class BubblePreferenceController extends NotificationPreferenceController
if (!super.isAvailable()) {
return false;
}
if (!isGloballyEnabled()) {
if (!mIsAppPage && !isGloballyEnabled()) {
return false;
}
if (mChannel != null) {

View File

@@ -115,7 +115,7 @@ public class ChannelNotificationSettings extends NotificationSettingsBase {
mControllers.add(new DndPreferenceController(context, mBackend));
mControllers.add(new NotificationsOffPreferenceController(context));
mControllers.add(new BubblePreferenceController(context, getChildFragmentManager(),
mBackend));
mBackend, false /* isAppPage */));
return new ArrayList<>(mControllers);
}
}