Search in sources :

Example 1 with AppBubbleListPreferenceController

use of com.android.settings.notification.AppBubbleListPreferenceController in project android_packages_apps_Settings by omnirom.

the class AppBubbleNotificationSettings method getPreferenceControllers.

protected static List<NotificationPreferenceController> getPreferenceControllers(Context context, AppBubbleNotificationSettings fragment, DependentFieldListener listener) {
    List<NotificationPreferenceController> controllers = new ArrayList<>();
    controllers.add(new HeaderPreferenceController(context, fragment));
    controllers.add(new BubblePreferenceController(context, fragment != null ? fragment.getChildFragmentManager() : null, new NotificationBackend(), true, /* isAppPage */
    listener));
    controllers.add(new AppBubbleListPreferenceController(context, new NotificationBackend()));
    return controllers;
}
Also used : NotificationBackend(com.android.settings.notification.NotificationBackend) ArrayList(java.util.ArrayList) AppBubbleListPreferenceController(com.android.settings.notification.AppBubbleListPreferenceController)

Example 2 with AppBubbleListPreferenceController

use of com.android.settings.notification.AppBubbleListPreferenceController in project android_packages_apps_Settings by omnirom.

the class AppBubbleListPreferenceControllerTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    ShadowApplication shadowApplication = ShadowApplication.getInstance();
    shadowApplication.setSystemService(Context.NOTIFICATION_SERVICE, mNm);
    shadowApplication.setSystemService(Context.USER_SERVICE, mUm);
    mContext = RuntimeEnvironment.application;
    List<ConversationChannelWrapper> convoList = new ArrayList<>();
    convoList.add(getConvo(-1, "default"));
    convoList.add(getConvo(1, "selected"));
    convoList.add(getConvo(0, "excluded"));
    mConvoList = new ParceledListSlice<>(convoList);
    when(mBackend.getConversations(anyString(), anyInt())).thenReturn(mConvoList);
    mController = new AppBubbleListPreferenceController(mContext, mBackend);
}
Also used : ConversationChannelWrapper(android.service.notification.ConversationChannelWrapper) ArrayList(java.util.ArrayList) AppBubbleListPreferenceController(com.android.settings.notification.AppBubbleListPreferenceController) ShadowApplication(org.robolectric.shadows.ShadowApplication) Before(org.junit.Before)

Aggregations

AppBubbleListPreferenceController (com.android.settings.notification.AppBubbleListPreferenceController)2 ArrayList (java.util.ArrayList)2 ConversationChannelWrapper (android.service.notification.ConversationChannelWrapper)1 NotificationBackend (com.android.settings.notification.NotificationBackend)1 Before (org.junit.Before)1 ShadowApplication (org.robolectric.shadows.ShadowApplication)1