Merge "Make sure the fragment manager is passed to BubblePreferenceController" into qt-dev am: 0b37ea8b6d

am: 03e5e847f7

Change-Id: Ia51e59cccfe66bba4b636a0ebad757b24b64f8b6
This commit is contained in:
Mady Mellor
2019-05-23 08:06:18 -07:00
committed by android-build-merger
3 changed files with 9 additions and 8 deletions

View File

@@ -61,7 +61,10 @@ public class AppBubbleNotificationSettings extends NotificationSettingsBase impl
Context context, AppBubbleNotificationSettings fragment) {
List<NotificationPreferenceController> controllers = new ArrayList<>();
controllers.add(new HeaderPreferenceController(context, fragment));
controllers.add(new BubblePreferenceController(context, new NotificationBackend()));
controllers.add(new BubblePreferenceController(context, fragment != null
? fragment.getChildFragmentManager()
: null,
new NotificationBackend()));
return controllers;
}

View File

@@ -18,6 +18,7 @@ package com.android.settings.notification;
import static android.provider.Settings.Secure.NOTIFICATION_BUBBLES;
import android.annotation.Nullable;
import android.content.Context;
import android.provider.Settings;
@@ -41,11 +42,7 @@ public class BubblePreferenceController extends NotificationPreferenceController
private FragmentManager mFragmentManager;
public BubblePreferenceController(Context context, NotificationBackend backend) {
super(context, backend);
}
public BubblePreferenceController(Context context, FragmentManager fragmentManager,
public BubblePreferenceController(Context context, @Nullable FragmentManager fragmentManager,
NotificationBackend backend) {
super(context, backend);
mFragmentManager = fragmentManager;
@@ -96,7 +93,7 @@ public class BubblePreferenceController extends NotificationPreferenceController
mChannel.setAllowBubbles(value);
saveChannel();
return true;
} else if (mAppRow != null) {
} else if (mAppRow != null && mFragmentManager != null) {
RestrictedSwitchPreference pref = (RestrictedSwitchPreference) preference;
// if the global setting is off, toggling app level permission requires extra
// confirmation

View File

@@ -114,7 +114,8 @@ public class ChannelNotificationSettings extends NotificationSettingsBase {
mControllers.add(new BadgePreferenceController(context, mBackend));
mControllers.add(new DndPreferenceController(context, mBackend));
mControllers.add(new NotificationsOffPreferenceController(context));
mControllers.add(new BubblePreferenceController(context, mBackend));
mControllers.add(new BubblePreferenceController(context, getChildFragmentManager(),
mBackend));
return new ArrayList<>(mControllers);
}
}