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

am: c3b47925e3

Change-Id: I7c9a07543340992e8bd3ff15538d74d28a1aab22
This commit is contained in:
Antony Sargent
2017-09-06 16:53:28 +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) {