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:
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user