use of androidx.slice.Slice in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class LocationSliceTest method getLocationSlice_correctSliceContent.
@Test
public void getLocationSlice_correctSliceContent() {
final Slice LocationSlice = new LocationSlice(mContext).getSlice();
final SliceMetadata metadata = SliceMetadata.from(mContext, LocationSlice);
assertThat(metadata.getTitle()).isEqualTo(mContext.getString(R.string.location_settings_title));
final List<SliceAction> toggles = metadata.getToggles();
assertThat(toggles).isEmpty();
final SliceAction primaryAction = metadata.getPrimaryAction();
final IconCompat expectedToggleIcon = IconCompat.createWithResource(mContext, com.android.internal.R.drawable.ic_signal_location);
assertThat(primaryAction.getIcon().toString()).isEqualTo(expectedToggleIcon.toString());
}
use of androidx.slice.Slice in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class WifiCallingSliceHelperTest method test_CreateWifiCallingPreferenceSlice_wfcOff.
@Test
public void test_CreateWifiCallingPreferenceSlice_wfcOff() {
when(mMockImsManager.isWfcEnabledByPlatform()).thenReturn(true);
when(mMockImsManager.isWfcProvisionedOnDevice()).thenReturn(true);
when(mMockImsManager.isWfcEnabledByUser()).thenReturn(false);
when(mMockImsManager.isNonTtyOrTtyOnVolteEnabled()).thenReturn(true);
mWfcSliceHelper.setIsWifiCallingPrefEditable(true);
final Slice slice = mWfcSliceHelper.createWifiCallingPreferenceSlice(CustomSliceRegistry.WIFI_CALLING_PREFERENCE_URI);
assertThat(mWfcSliceHelper.getDefaultVoiceSubId()).isEqualTo(1);
testWifiCallingSettingsUnavailableSlice(slice, null, getActivityIntent(WifiCallingSliceHelper.ACTION_WIFI_CALLING_SETTINGS_ACTIVITY), mContext.getString(R.string.wifi_calling_mode_title));
}
use of androidx.slice.Slice in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class WifiCallingSliceHelperTest method test_CreateWifiCallingSlice_invalidSubId.
@Test
public void test_CreateWifiCallingSlice_invalidSubId() {
mWfcSliceHelper.setDefaultVoiceSubId(-1);
final Slice slice = mWfcSliceHelper.createWifiCallingSlice(CustomSliceRegistry.WIFI_CALLING_URI);
assertThat(slice).isNull();
}
use of androidx.slice.Slice in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class WifiCallingSliceHelperTest method test_SettingsSliceProvider_getWfcPreferenceSlice.
@Test
public void test_SettingsSliceProvider_getWfcPreferenceSlice() {
when(mMockImsManager.isWfcEnabledByPlatform()).thenReturn(true);
when(mMockImsManager.isWfcProvisionedOnDevice()).thenReturn(true);
when(mMockImsManager.isWfcEnabledByUser()).thenReturn(true);
when(mMockImsManager.isNonTtyOrTtyOnVolteEnabled()).thenReturn(true);
when(mMockImsManager.getWfcMode(false)).thenReturn(ImsConfig.WfcModeFeatureValueConstants.WIFI_PREFERRED);
when(mSlicesFeatureProvider.getNewWifiCallingSliceHelper(mContext)).thenReturn(mWfcSliceHelper);
mWfcSliceHelper.setIsWifiCallingPrefEditable(true);
final Slice slice = mProvider.onBindSlice(CustomSliceRegistry.WIFI_CALLING_PREFERENCE_URI);
assertThat(mWfcSliceHelper.getDefaultVoiceSubId()).isEqualTo(1);
testWifiCallingPreferenceSlice(slice, null, getActivityIntent(WifiCallingSliceHelper.ACTION_WIFI_CALLING_SETTINGS_ACTIVITY));
}
use of androidx.slice.Slice in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class WifiCallingSliceHelperTest method test_CreateWifiCallingSlice_wfcNotSupported.
@Test
public void test_CreateWifiCallingSlice_wfcNotSupported() {
when(mMockImsManager.isWfcEnabledByPlatform()).thenReturn(false);
final Slice slice = mWfcSliceHelper.createWifiCallingSlice(CustomSliceRegistry.WIFI_CALLING_URI);
assertThat(mWfcSliceHelper.getDefaultVoiceSubId()).isEqualTo(1);
assertThat(slice).isNull();
}
Aggregations