Update NotificationChannelSettings Preferences in place to prevent re-layout.
Fixes: 110093185 Test: ChannelListPreferenceControllerTest Change-Id: If6acf305c44085e502a3304ea57e409ce049b40f
This commit is contained in:
@@ -23,6 +23,8 @@ import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.Switch;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.preference.PreferenceViewHolder;
|
||||
|
||||
import com.android.settings.R;
|
||||
@@ -101,6 +103,16 @@ public class PrimarySwitchPreference extends RestrictedPreference {
|
||||
return mSwitch != null && mChecked;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to validate the state of mChecked and mCheckedSet when testing, without requiring
|
||||
* that a ViewHolder be bound to the object.
|
||||
*/
|
||||
@Keep
|
||||
@Nullable
|
||||
public Boolean getCheckedState() {
|
||||
return mCheckedSet ? mChecked : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the checked status to be {@code checked}.
|
||||
*
|
||||
|
Reference in New Issue
Block a user