use of androidx.core.text.BidiFormatter in project android_packages_apps_Settings by DirtyUnicorns.
the class VirtualKeyboardPreferenceControllerTest method updateState_multiImeWithMixedLocale_setImeLabelToSummary.
@Test
public void updateState_multiImeWithMixedLocale_setImeLabelToSummary() {
final BidiFormatter formatter = BidiFormatter.getInstance();
final ComponentName componentName = new ComponentName("pkg", "cls");
final List<InputMethodInfo> imis = new ArrayList<>();
final String label1 = "label";
final String label2 = "Keyboard מִקְלֶדֶת";
imis.add(mock(InputMethodInfo.class));
imis.add(mock(InputMethodInfo.class));
when(mDpm.getPermittedInputMethodsForCurrentUser()).thenReturn(null);
when(mImm.getEnabledInputMethodList()).thenReturn(imis);
when(imis.get(0).getPackageName()).thenReturn(componentName.getPackageName());
when(imis.get(0).loadLabel(mPm)).thenReturn(label1);
when(imis.get(1).getPackageName()).thenReturn(componentName.getPackageName());
when(imis.get(1).loadLabel(mPm)).thenReturn(label2);
mController.updateState(mPreference);
verify(mPreference).setSummary(formatter.unicodeWrap(label1) + " and " + formatter.unicodeWrap(label2));
}
use of androidx.core.text.BidiFormatter in project android_packages_apps_Settings by SudaMod.
the class VirtualKeyboardPreferenceControllerTest method updateState_multiImeWithMixedLocale_setImeLabelToSummary.
@Test
public void updateState_multiImeWithMixedLocale_setImeLabelToSummary() {
final BidiFormatter formatter = BidiFormatter.getInstance();
final ComponentName componentName = new ComponentName("pkg", "cls");
final List<InputMethodInfo> imis = new ArrayList<>();
final String label1 = "label";
final String label2 = "Keyboard מִקְלֶדֶת";
imis.add(mock(InputMethodInfo.class));
imis.add(mock(InputMethodInfo.class));
when(mDpm.getPermittedInputMethodsForCurrentUser()).thenReturn(null);
when(mImm.getEnabledInputMethodList()).thenReturn(imis);
when(imis.get(0).getPackageName()).thenReturn(componentName.getPackageName());
when(imis.get(0).loadLabel(mPm)).thenReturn(label1);
when(imis.get(1).getPackageName()).thenReturn(componentName.getPackageName());
when(imis.get(1).loadLabel(mPm)).thenReturn(label2);
mController.updateState(mPreference);
verify(mPreference).setSummary(formatter.unicodeWrap(label1) + " and " + formatter.unicodeWrap(label2));
}
use of androidx.core.text.BidiFormatter in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class VirtualKeyboardPreferenceControllerTest method updateState_multiImeWithMixedLocale_setImeLabelToSummary.
@Test
public void updateState_multiImeWithMixedLocale_setImeLabelToSummary() {
final BidiFormatter formatter = BidiFormatter.getInstance();
final ComponentName componentName = new ComponentName("pkg", "cls");
final List<InputMethodInfo> imis = new ArrayList<>();
final String label1 = "label";
final String label2 = "Keyboard מִקְלֶדֶת";
imis.add(mock(InputMethodInfo.class));
imis.add(mock(InputMethodInfo.class));
when(mDpm.getPermittedInputMethodsForCurrentUser()).thenReturn(null);
when(mImm.getEnabledInputMethodList()).thenReturn(imis);
when(imis.get(0).getPackageName()).thenReturn(componentName.getPackageName());
when(imis.get(0).loadLabel(mPm)).thenReturn(label1);
when(imis.get(1).getPackageName()).thenReturn(componentName.getPackageName());
when(imis.get(1).loadLabel(mPm)).thenReturn(label2);
mController.updateState(mPreference);
verify(mPreference).setSummary(formatter.unicodeWrap(label1) + " and " + formatter.unicodeWrap(label2));
}
use of androidx.core.text.BidiFormatter in project android_packages_apps_Settings by omnirom.
the class VirtualKeyboardPreferenceControllerTest method updateState_multiImeWithMixedLocale_setImeLabelToSummary.
@Test
public void updateState_multiImeWithMixedLocale_setImeLabelToSummary() {
final BidiFormatter formatter = BidiFormatter.getInstance();
final ComponentName componentName = new ComponentName("pkg", "cls");
final List<InputMethodInfo> imis = new ArrayList<>();
final String label1 = "label";
final String label2 = "Keyboard מִקְלֶדֶת";
imis.add(mock(InputMethodInfo.class));
imis.add(mock(InputMethodInfo.class));
when(mDpm.getPermittedInputMethodsForCurrentUser()).thenReturn(null);
when(mImm.getEnabledInputMethodList()).thenReturn(imis);
when(imis.get(0).getPackageName()).thenReturn(componentName.getPackageName());
when(imis.get(0).loadLabel(mPm)).thenReturn(label1);
when(imis.get(1).getPackageName()).thenReturn(componentName.getPackageName());
when(imis.get(1).loadLabel(mPm)).thenReturn(label2);
mController.updateState(mPreference);
verify(mPreference).setSummary(formatter.unicodeWrap(label1) + " and " + formatter.unicodeWrap(label2));
}
use of androidx.core.text.BidiFormatter in project android_packages_apps_Settings by crdroidandroid.
the class VirtualKeyboardPreferenceControllerTest method updateState_multiImeWithMixedLocale_setImeLabelToSummary.
@Test
public void updateState_multiImeWithMixedLocale_setImeLabelToSummary() {
final BidiFormatter formatter = BidiFormatter.getInstance();
final ComponentName componentName = new ComponentName("pkg", "cls");
final List<InputMethodInfo> imis = new ArrayList<>();
final String label1 = "label";
final String label2 = "Keyboard מִקְלֶדֶת";
imis.add(mock(InputMethodInfo.class));
imis.add(mock(InputMethodInfo.class));
when(mDpm.getPermittedInputMethodsForCurrentUser()).thenReturn(null);
when(mImm.getEnabledInputMethodList()).thenReturn(imis);
when(imis.get(0).getPackageName()).thenReturn(componentName.getPackageName());
when(imis.get(0).loadLabel(mPm)).thenReturn(label1);
when(imis.get(1).getPackageName()).thenReturn(componentName.getPackageName());
when(imis.get(1).loadLabel(mPm)).thenReturn(label2);
mController.updateState(mPreference);
verify(mPreference).setSummary(formatter.unicodeWrap(label1) + " and " + formatter.unicodeWrap(label2));
}
Aggregations