Skip to content

Commit f3171fb

Browse files
author
Matthew Xie
committed
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
1 parent d1186cd commit f3171fb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/java/android/server/BluetoothAdapterStateMachine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ public boolean processMessage(Message message) {
528528
}
529529

530530
// we turn all the way to PowerOff with AIRPLANE_MODE_ON
531-
if (message.what == AIRPLANE_MODE_ON) {
531+
if (message.what == AIRPLANE_MODE_ON || mBluetoothService.isAirplaneModeOn()) {
532532
// We inform all the per process callbacks
533533
allProcessesCallback(false);
534534
deferMessage(obtainMessage(AIRPLANE_MODE_ON));

core/java/android/server/BluetoothService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1706,7 +1706,7 @@ private void registerForAirplaneMode(IntentFilter filter) {
17061706
}
17071707

17081708
/* Returns true if airplane mode is currently on */
1709-
private final boolean isAirplaneModeOn() {
1709+
/*package*/ final boolean isAirplaneModeOn() {
17101710
return Settings.System.getInt(mContext.getContentResolver(),
17111711
Settings.System.AIRPLANE_MODE_ON, 0) == 1;
17121712
}

0 commit comments

Comments
 (0)