use of com.android.settingslib.dream.DreamBackend.DreamInfo in project android_packages_apps_Settings by crdroidandroid.
the class CurrentDreamPickerTest method setDefaultShouldUpdateActiveDream.
@Test
public void setDefaultShouldUpdateActiveDream() {
DreamInfo mockInfo = mock(DreamInfo.class);
ComponentName mockName = mock(ComponentName.class);
mockInfo.componentName = mockName;
when(mockName.flattenToString()).thenReturn(COMPONENT_KEY);
when(mBackend.getDreamInfos()).thenReturn(new ArrayList<>(Arrays.asList(mockInfo)));
mPicker.setDefaultKey(COMPONENT_KEY);
verify(mBackend).setActiveDream(mockName);
}
use of com.android.settingslib.dream.DreamBackend.DreamInfo in project android_packages_apps_Settings by SudaMod.
the class CurrentDreamPickerTest method setDefaultShouldUpdateActiveDream.
@Test
public void setDefaultShouldUpdateActiveDream() {
DreamInfo mockInfo = mock(DreamInfo.class);
ComponentName mockName = mock(ComponentName.class);
mockInfo.componentName = mockName;
when(mockName.flattenToString()).thenReturn(COMPONENT_KEY);
when(mBackend.getDreamInfos()).thenReturn(new ArrayList<>(Arrays.asList(mockInfo)));
mPicker.setDefaultKey(COMPONENT_KEY);
verify(mBackend).setActiveDream(mockName);
}
use of com.android.settingslib.dream.DreamBackend.DreamInfo in project android_packages_apps_Settings by DirtyUnicorns.
the class CurrentDreamPickerTest method setDefaultShouldUpdateActiveDream.
@Test
public void setDefaultShouldUpdateActiveDream() {
DreamInfo mockInfo = mock(DreamInfo.class);
ComponentName mockName = mock(ComponentName.class);
mockInfo.componentName = mockName;
when(mockName.flattenToString()).thenReturn(COMPONENT_KEY);
when(mBackend.getDreamInfos()).thenReturn(new ArrayList<>(Arrays.asList(mockInfo)));
mPicker.setDefaultKey(COMPONENT_KEY);
verify(mBackend).setActiveDream(mockName);
}
use of com.android.settingslib.dream.DreamBackend.DreamInfo in project platform_packages_apps_Settings by BlissRoms.
the class CurrentDreamPreferenceController method setGearClickListenerForPreference.
private void setGearClickListenerForPreference(Preference preference) {
if (!(preference instanceof GearPreference))
return;
GearPreference gearPreference = (GearPreference) preference;
Optional<DreamInfo> info = getActiveDreamInfo();
if (!info.isPresent() || info.get().settingsComponentName == null) {
gearPreference.setOnGearClickListener(null);
return;
}
gearPreference.setOnGearClickListener(gearPref -> launchScreenSaverSettings());
}
use of com.android.settingslib.dream.DreamBackend.DreamInfo in project platform_packages_apps_Settings by BlissRoms.
the class CurrentDreamPickerTest method setDefaultShouldUpdateActiveDream.
@Test
public void setDefaultShouldUpdateActiveDream() {
DreamInfo mockInfo = mock(DreamInfo.class);
ComponentName mockName = mock(ComponentName.class);
mockInfo.componentName = mockName;
when(mockName.flattenToString()).thenReturn(COMPONENT_KEY);
when(mBackend.getDreamInfos()).thenReturn(new ArrayList<>(Arrays.asList(mockInfo)));
mPicker.setDefaultKey(COMPONENT_KEY);
verify(mBackend).setActiveDream(mockName);
}
Aggregations