Migrate to TwoStatePreference
SwitchPreference and SwitchPreferenceCompat are both TwoStatePreference. Using TwoStatePreference in Java will helps migration in the future. Bug: 306771414 Test: manual - check Settings pages Change-Id: I84e1d7b09451106797c2b23d127855c6976678ca
This commit is contained in:
@@ -23,7 +23,7 @@ import android.provider.Settings;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.SwitchPreference;
|
||||
import androidx.preference.TwoStatePreference;
|
||||
|
||||
import com.android.settings.core.PreferenceControllerMixin;
|
||||
import com.android.settingslib.development.DeveloperOptionsPreferenceController;
|
||||
@@ -69,7 +69,7 @@ public final class EnableBlursPreferenceController extends DeveloperOptionsPrefe
|
||||
public void updateState(Preference preference) {
|
||||
boolean isEnabled = Settings.Global.getInt(mContext.getContentResolver(),
|
||||
Settings.Global.DISABLE_WINDOW_BLURS, 0) == 0;
|
||||
((SwitchPreference) mPreference).setChecked(isEnabled);
|
||||
((TwoStatePreference) mPreference).setChecked(isEnabled);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user