use of androidx.annotation.VisibleForTesting in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class VideoCallingPreferenceController method isVideoCallEnabled.
@VisibleForTesting
boolean isVideoCallEnabled(int subId, ImsManager imsManager) {
final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(subId);
final TelephonyManager telephonyManager = TelephonyManager.from(mContext).createForSubscriptionId(subId);
return carrierConfig != null && imsManager != null && imsManager.isVtEnabledByPlatform() && imsManager.isVtProvisionedOnDevice() && MobileNetworkUtils.isImsServiceStateReady(imsManager) && (carrierConfig.getBoolean(CarrierConfigManager.KEY_IGNORE_DATA_ENABLED_CHANGED_FOR_VIDEO_CALLS) || telephonyManager.isDataEnabled());
}
use of androidx.annotation.VisibleForTesting in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class BottomLabelLayout method setStacked.
@VisibleForTesting
void setStacked(boolean stacked) {
setOrientation(stacked ? LinearLayout.VERTICAL : LinearLayout.HORIZONTAL);
setGravity(stacked ? Gravity.START : Gravity.BOTTOM);
final View spacer = findViewById(R.id.spacer);
if (spacer != null) {
spacer.setVisibility(stacked ? View.GONE : View.VISIBLE);
}
}
use of androidx.annotation.VisibleForTesting in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class RadioButtonPickerFragment method updateCheckedState.
@VisibleForTesting
public void updateCheckedState(String selectedKey) {
final PreferenceScreen screen = getPreferenceScreen();
if (screen != null) {
final int count = screen.getPreferenceCount();
for (int i = 0; i < count; i++) {
final Preference pref = screen.getPreference(i);
if (pref instanceof RadioButtonPreference) {
final RadioButtonPreference radioPref = (RadioButtonPreference) pref;
final boolean newCheckedState = TextUtils.equals(pref.getKey(), selectedKey);
if (radioPref.isChecked() != newCheckedState) {
radioPref.setChecked(TextUtils.equals(pref.getKey(), selectedKey));
}
}
}
}
}
use of androidx.annotation.VisibleForTesting in project SeriesGuide by UweTrottmann.
the class TimeTools method getShowReleaseDateTime.
@VisibleForTesting
@NonNull
public static ZonedDateTime getShowReleaseDateTime(@NonNull LocalTime time, int weekDay, @NonNull ZoneId timeZone, @Nullable String country, @Nullable String network, @NonNull Clock clock) {
// create current date in show time zone, set local show release time
LocalDateTime localDateTime = LocalDateTime.of(LocalDate.now(clock), time);
// for daily shows (weekDay == 0) just use the current day
if (weekDay >= 1 && weekDay <= 7) {
// so if we want a week day earlier in the week, advance by 7 days first
if (weekDay < localDateTime.getDayOfWeek().getValue()) {
localDateTime = localDateTime.plusWeeks(1);
}
localDateTime = localDateTime.with(ChronoField.DAY_OF_WEEK, weekDay);
}
localDateTime = handleHourPastMidnight(country, network, localDateTime);
// get a valid datetime in the show time zone, this auto-forwards time if inside DST gap
ZonedDateTime dateTime = localDateTime.atZone(timeZone);
// handle time zone effects on release time for US shows (only if device is set to US zone)
String localTimeZone = TimeZone.getDefault().getID();
if (localTimeZone.startsWith(TIMEZONE_ID_PREFIX_AMERICA)) {
dateTime = applyUnitedStatesCorrections(country, localTimeZone, dateTime);
}
return dateTime;
}
use of androidx.annotation.VisibleForTesting in project android by nextcloud.
the class FileDetailSharingFragment method search.
@VisibleForTesting
public void search(String query) {
SearchView searchView = getView().findViewById(R.id.searchView);
searchView.setQuery(query, true);
}
Aggregations