Set Bluetooth adapter to PowerOff mode when turnoff with airplane on

Currently, when airplane mode was on and BT was on, turning BT off
moved BT to hotoff state. This fix moves BT all the way to Poweroff
state to have better power performance.
bug 5854282

Change-Id: I7ba41797a46a81ddb3a576453f2a8303b5eed525
This commit is contained in:
Matthew Xie
2012-01-11 14:46:13 -08:00
parent d1186cd5bb
commit f3171fb60c
2 changed files with 2 additions and 2 deletions

View File

@@ -528,7 +528,7 @@ final class BluetoothAdapterStateMachine extends StateMachine {
}
// we turn all the way to PowerOff with AIRPLANE_MODE_ON
if (message.what == AIRPLANE_MODE_ON) {
if (message.what == AIRPLANE_MODE_ON || mBluetoothService.isAirplaneModeOn()) {
// We inform all the per process callbacks
allProcessesCallback(false);
deferMessage(obtainMessage(AIRPLANE_MODE_ON));

View File

@@ -1706,7 +1706,7 @@ public class BluetoothService extends IBluetooth.Stub {
}
/* Returns true if airplane mode is currently on */
private final boolean isAirplaneModeOn() {
/*package*/ final boolean isAirplaneModeOn() {
return Settings.System.getInt(mContext.getContentResolver(),
Settings.System.AIRPLANE_MODE_ON, 0) == 1;
}