Search in sources :

Example 91 with VisibleForTesting

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());
}
Also used : PersistableBundle(android.os.PersistableBundle) TelephonyManager(android.telephony.TelephonyManager) VisibleForTesting(androidx.annotation.VisibleForTesting)

Example 92 with VisibleForTesting

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);
    }
}
Also used : View(android.view.View) VisibleForTesting(androidx.annotation.VisibleForTesting)

Example 93 with VisibleForTesting

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));
                }
            }
        }
    }
}
Also used : PreferenceScreen(androidx.preference.PreferenceScreen) Preference(androidx.preference.Preference) VisibleForTesting(androidx.annotation.VisibleForTesting)

Example 94 with VisibleForTesting

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;
}
Also used : LocalDateTime(org.threeten.bp.LocalDateTime) ZonedDateTime(org.threeten.bp.ZonedDateTime) VisibleForTesting(androidx.annotation.VisibleForTesting) NonNull(androidx.annotation.NonNull)

Example 95 with VisibleForTesting

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);
}
Also used : SearchView(androidx.appcompat.widget.SearchView) VisibleForTesting(androidx.annotation.VisibleForTesting)

Aggregations

VisibleForTesting (androidx.annotation.VisibleForTesting)385 Intent (android.content.Intent)36 ArrayList (java.util.ArrayList)36 Context (android.content.Context)34 Bundle (android.os.Bundle)30 Uri (android.net.Uri)18 View (android.view.View)18 Preference (androidx.preference.Preference)18 TextView (android.widget.TextView)16 SubSettingLauncher (com.android.settings.core.SubSettingLauncher)16 MetricsFeatureProvider (com.android.settingslib.core.instrumentation.MetricsFeatureProvider)16 SuppressLint (android.annotation.SuppressLint)15 Activity (android.app.Activity)14 RemoteException (android.os.RemoteException)14 SubscriptionInfo (android.telephony.SubscriptionInfo)12 ImageView (android.widget.ImageView)12 BluetoothDevice (android.bluetooth.BluetoothDevice)11 ComponentName (android.content.ComponentName)11 Drawable (android.graphics.drawable.Drawable)11 SharedPreferences (android.content.SharedPreferences)10