am 59d33dbd
: Merge "Fixed a Setting Bluetooth Airplane mode bug." into lmp-dev
* commit '59d33dbd25d8ca968e03bdeefedea9b0fe2e01f3': Fixed a Setting Bluetooth Airplane mode bug.
This commit is contained in:
@@ -90,12 +90,10 @@ public final class BluetoothEnabler implements SwitchBar.OnSwitchChangeListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setupSwitchBar() {
|
public void setupSwitchBar() {
|
||||||
mSwitchBar.addOnSwitchChangeListener(this);
|
|
||||||
mSwitchBar.show();
|
mSwitchBar.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void teardownSwitchBar() {
|
public void teardownSwitchBar() {
|
||||||
mSwitchBar.removeOnSwitchChangeListener(this);
|
|
||||||
mSwitchBar.hide();
|
mSwitchBar.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,6 +110,7 @@ public final class BluetoothEnabler implements SwitchBar.OnSwitchChangeListener
|
|||||||
// Bluetooth state is not sticky, so set it manually
|
// Bluetooth state is not sticky, so set it manually
|
||||||
handleStateChanged(mLocalAdapter.getBluetoothState());
|
handleStateChanged(mLocalAdapter.getBluetoothState());
|
||||||
|
|
||||||
|
mSwitchBar.addOnSwitchChangeListener(this);
|
||||||
mContext.registerReceiver(mReceiver, mIntentFilter);
|
mContext.registerReceiver(mReceiver, mIntentFilter);
|
||||||
mValidListener = true;
|
mValidListener = true;
|
||||||
}
|
}
|
||||||
@@ -121,6 +120,7 @@ public final class BluetoothEnabler implements SwitchBar.OnSwitchChangeListener
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mSwitchBar.removeOnSwitchChangeListener(this);
|
||||||
mContext.unregisterReceiver(mReceiver);
|
mContext.unregisterReceiver(mReceiver);
|
||||||
mValidListener = false;
|
mValidListener = false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user