Update NotificationChannelSettings Preferences in place to prevent re-layout.

Fixes: 110093185
Test: ChannelListPreferenceControllerTest
Change-Id: If6acf305c44085e502a3304ea57e409ce049b40f
This commit is contained in:
Jeff DeCew
2020-08-18 10:59:35 -04:00
parent 4acf477987
commit b409b64045
3 changed files with 600 additions and 82 deletions

View File

@@ -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}.
*