Search in sources :

Example 81 with VisibleForTesting

use of androidx.annotation.VisibleForTesting in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class HardwareOverlaysPreferenceController method writeHardwareOverlaysSetting.

@VisibleForTesting
void writeHardwareOverlaysSetting(boolean isEnabled) {
    if (mSurfaceFlinger == null) {
        return;
    }
    try {
        final Parcel data = Parcel.obtain();
        data.writeInterfaceToken(SURFACE_COMPOSER_INTERFACE_KEY);
        final int disableOverlays = isEnabled ? SETTING_VALUE_ON : SETTING_VALUE_OFF;
        data.writeInt(disableOverlays);
        mSurfaceFlinger.transact(SURFACE_FLINGER_DISABLE_OVERLAYS_CODE, data, null, /* reply */
        0);
        data.recycle();
    } catch (RemoteException ex) {
    // intentional no-op
    }
    updateHardwareOverlaysSetting();
}
Also used : Parcel(android.os.Parcel) RemoteException(android.os.RemoteException) VisibleForTesting(androidx.annotation.VisibleForTesting)

Example 82 with VisibleForTesting

use of androidx.annotation.VisibleForTesting in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class StorageDashboardFragment method initializeCachedValues.

@VisibleForTesting
public void initializeCachedValues() {
    PrivateStorageInfo info = mCachedStorageValuesHelper.getCachedPrivateStorageInfo();
    SparseArray<StorageAsyncLoader.AppsStorageResult> loaderResult = mCachedStorageValuesHelper.getCachedAppsStorageResult();
    if (info == null || loaderResult == null) {
        return;
    }
    mStorageInfo = info;
    mAppsResult = loaderResult;
}
Also used : PrivateStorageInfo(com.android.settingslib.deviceinfo.PrivateStorageInfo) VisibleForTesting(androidx.annotation.VisibleForTesting)

Example 83 with VisibleForTesting

use of androidx.annotation.VisibleForTesting in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class GameDriverAppPreferenceController method createListPreference.

@VisibleForTesting
protected ListPreference createListPreference(Context context, String packageName, String appName) {
    final ListPreference listPreference = new ListPreference(context);
    listPreference.setKey(packageName);
    listPreference.setTitle(appName);
    listPreference.setDialogTitle(mPreferenceTitle);
    listPreference.setEntries(mEntryList);
    listPreference.setEntryValues(mEntryList);
    // from Settings.Global.GAME_DRIVER(_PRERELEASE)?_OPT_(IN|OUT)_APPS
    if (mDevOptOutApps.contains(packageName)) {
        listPreference.setValue(mPreferenceSystem);
        listPreference.setSummary(mPreferenceSystem);
    } else if (mDevPrereleaseOptInApps.contains(packageName)) {
        listPreference.setValue(mPreferencePrereleaseDriver);
        listPreference.setSummary(mPreferencePrereleaseDriver);
    } else if (mDevOptInApps.contains(packageName)) {
        listPreference.setValue(mPreferenceGameDriver);
        listPreference.setSummary(mPreferenceGameDriver);
    } else {
        listPreference.setValue(mPreferenceDefault);
        listPreference.setSummary(mPreferenceDefault);
    }
    listPreference.setOnPreferenceChangeListener(this);
    return listPreference;
}
Also used : ListPreference(androidx.preference.ListPreference) VisibleForTesting(androidx.annotation.VisibleForTesting)

Example 84 with VisibleForTesting

use of androidx.annotation.VisibleForTesting in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class BatterySaverSettings method setupFooter.

// Updates the footer for this page.
@VisibleForTesting
void setupFooter() {
    mFooterText = new SpannableStringBuilder(getText(com.android.internal.R.string.battery_saver_description_with_learn_more));
    mHelpUri = getString(R.string.help_url_battery_saver_settings);
    if (!TextUtils.isEmpty(mHelpUri)) {
        addHelpLink();
    }
}
Also used : SpannableStringBuilder(android.text.SpannableStringBuilder) VisibleForTesting(androidx.annotation.VisibleForTesting)

Example 85 with VisibleForTesting

use of androidx.annotation.VisibleForTesting in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class BatterySaverSettings method addHelpLink.

// Changes the text to include a learn more link if possible.
@VisibleForTesting
void addHelpLink() {
    FooterPreference pref = getPreferenceScreen().findPreference(KEY_FOOTER_PREFERENCE);
    if (pref != null) {
        SupportPageLearnMoreSpan.linkify(mFooterText, this, mHelpUri);
        pref.setTitle(mFooterText);
    }
}
Also used : FooterPreference(com.android.settingslib.widget.FooterPreference) 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