use of android.service.notification.ConversationChannelWrapper in project android_packages_apps_Settings by omnirom.
the class ConversationListPreferenceControllerTest method testCompareSpans.
@Test
public void testCompareSpans() {
ConversationChannelWrapper one = new ConversationChannelWrapper();
String text1 = "one one";
SpannableStringBuilder builder1 = new SpannableStringBuilder(text1);
Object first1 = new SubscriptSpan();
builder1.setSpan(first1, 2, 4, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
ShortcutInfo s1 = new ShortcutInfo.Builder(mContext, "one").setShortLabel(builder1).build();
one.setShortcutInfo(s1);
ConversationChannelWrapper two = new ConversationChannelWrapper();
String text2 = "two two";
SpannableStringBuilder builder2 = new SpannableStringBuilder(text2);
Object first2 = new SubscriptSpan();
builder2.setSpan(first2, 2, 4, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
ShortcutInfo s2 = new ShortcutInfo.Builder(mContext, "two").setShortLabel(builder2).build();
two.setShortcutInfo(s2);
assertThat(mController.mConversationComparator.compare(one, two)).isLessThan(0);
}
use of android.service.notification.ConversationChannelWrapper in project android_packages_apps_Settings by omnirom.
the class BubblePreferenceControllerTest 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;
when(mFragmentManager.beginTransaction()).thenReturn(mock(FragmentTransaction.class));
mController = spy(new BubblePreferenceController(mContext, mFragmentManager, mBackend, false, /* isAppPage */
mListener));
mAppPageController = spy(new BubblePreferenceController(mContext, mFragmentManager, mBackend, true, /* isAppPage */
mListener));
List<ConversationChannelWrapper> convos = new ArrayList<>();
convos.add(mock(ConversationChannelWrapper.class));
when(mBackend.getConversations(anyString(), anyInt())).thenReturn(new ParceledListSlice<>(convos));
}
Aggregations