Merge "Make sure the fragment manager is passed to BubblePreferenceController" into qt-dev
am: 0b37ea8b6d
Change-Id: I5b2295d59d00b9df0fa93a3d300baa8975994678
This commit is contained in:
@@ -61,7 +61,10 @@ public class AppBubbleNotificationSettings extends NotificationSettingsBase impl
|
|||||||
Context context, AppBubbleNotificationSettings fragment) {
|
Context context, AppBubbleNotificationSettings fragment) {
|
||||||
List<NotificationPreferenceController> controllers = new ArrayList<>();
|
List<NotificationPreferenceController> controllers = new ArrayList<>();
|
||||||
controllers.add(new HeaderPreferenceController(context, fragment));
|
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;
|
return controllers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -18,6 +18,7 @@ package com.android.settings.notification;
|
|||||||
|
|
||||||
import static android.provider.Settings.Secure.NOTIFICATION_BUBBLES;
|
import static android.provider.Settings.Secure.NOTIFICATION_BUBBLES;
|
||||||
|
|
||||||
|
import android.annotation.Nullable;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
|
||||||
@@ -41,11 +42,7 @@ public class BubblePreferenceController extends NotificationPreferenceController
|
|||||||
|
|
||||||
private FragmentManager mFragmentManager;
|
private FragmentManager mFragmentManager;
|
||||||
|
|
||||||
public BubblePreferenceController(Context context, NotificationBackend backend) {
|
public BubblePreferenceController(Context context, @Nullable FragmentManager fragmentManager,
|
||||||
super(context, backend);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BubblePreferenceController(Context context, FragmentManager fragmentManager,
|
|
||||||
NotificationBackend backend) {
|
NotificationBackend backend) {
|
||||||
super(context, backend);
|
super(context, backend);
|
||||||
mFragmentManager = fragmentManager;
|
mFragmentManager = fragmentManager;
|
||||||
@@ -96,7 +93,7 @@ public class BubblePreferenceController extends NotificationPreferenceController
|
|||||||
mChannel.setAllowBubbles(value);
|
mChannel.setAllowBubbles(value);
|
||||||
saveChannel();
|
saveChannel();
|
||||||
return true;
|
return true;
|
||||||
} else if (mAppRow != null) {
|
} else if (mAppRow != null && mFragmentManager != null) {
|
||||||
RestrictedSwitchPreference pref = (RestrictedSwitchPreference) preference;
|
RestrictedSwitchPreference pref = (RestrictedSwitchPreference) preference;
|
||||||
// if the global setting is off, toggling app level permission requires extra
|
// if the global setting is off, toggling app level permission requires extra
|
||||||
// confirmation
|
// confirmation
|
||||||
|
@@ -114,7 +114,8 @@ public class ChannelNotificationSettings extends NotificationSettingsBase {
|
|||||||
mControllers.add(new BadgePreferenceController(context, mBackend));
|
mControllers.add(new BadgePreferenceController(context, mBackend));
|
||||||
mControllers.add(new DndPreferenceController(context, mBackend));
|
mControllers.add(new DndPreferenceController(context, mBackend));
|
||||||
mControllers.add(new NotificationsOffPreferenceController(context));
|
mControllers.add(new NotificationsOffPreferenceController(context));
|
||||||
mControllers.add(new BubblePreferenceController(context, mBackend));
|
mControllers.add(new BubblePreferenceController(context, getChildFragmentManager(),
|
||||||
|
mBackend));
|
||||||
return new ArrayList<>(mControllers);
|
return new ArrayList<>(mControllers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user