Merge "Fix Bluetooth switch status in Connected devices screen" into oc-mr1-dev am: c3b47925e3

am: f92f6c24f1

Change-Id: I81d955471c420647b884533cf09656cf7cae28c1
This commit is contained in:
Antony Sargent
2017-09-06 16:55:27 +00:00
committed by android-build-merger
2 changed files with 99 additions and 8 deletions

View File

@@ -157,7 +157,9 @@ public final class BluetoothEnabler implements SwitchWidgetController.OnSwitchCh
}
private void setChecked(boolean isChecked) {
if (isChecked != mSwitchWidget.isChecked()) {
final boolean currentState =
(mSwitchWidget.getSwitch() != null) && mSwitchWidget.getSwitch().isChecked();
if (isChecked != currentState) {
// set listener to null, so onCheckedChanged won't be called
// if the checked status on Switch isn't changed by user click
if (mValidListener) {