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();
}
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;
}
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;
}
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();
}
}
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);
}
}
Aggregations