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:
@@ -22,7 +22,7 @@ import android.util.Log;
|
||||
import android.util.Pair;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.SwitchPreference;
|
||||
import androidx.preference.TwoStatePreference;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
@@ -47,7 +47,7 @@ public class ZenRuleCustomSwitchPreferenceController extends
|
||||
return;
|
||||
}
|
||||
|
||||
SwitchPreference pref = (SwitchPreference) preference;
|
||||
TwoStatePreference pref = (TwoStatePreference) preference;
|
||||
pref.setChecked(mRule.getZenPolicy().isCategoryAllowed(mCategory, false));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user