summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Xie <mattx@google.com>2012-01-11 14:46:13 -0800
committerMatthew Xie <mattx@google.com>2012-01-11 14:46:13 -0800
commitf3171fb60c840a9bc0220fad651338346dddfff7 (patch)
treedd838339186946916a1568bf0e4c836c7ba21c9b /core
parentd1186cd5bb445e9b0768edf6cb87022865cada55 (diff)
downloadframeworks_base-f3171fb60c840a9bc0220fad651338346dddfff7.zip
frameworks_base-f3171fb60c840a9bc0220fad651338346dddfff7.tar.gz
frameworks_base-f3171fb60c840a9bc0220fad651338346dddfff7.tar.bz2
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
Diffstat (limited to 'core')
-rw-r--r--core/java/android/server/BluetoothAdapterStateMachine.java2
-rwxr-xr-xcore/java/android/server/BluetoothService.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/server/BluetoothAdapterStateMachine.java b/core/java/android/server/BluetoothAdapterStateMachine.java
index 8ec79e2..f617d95 100644
--- a/core/java/android/server/BluetoothAdapterStateMachine.java
+++ b/core/java/android/server/BluetoothAdapterStateMachine.java
@@ -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));
diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java
index 94fbbc8..fecc8f9 100755
--- a/core/java/android/server/BluetoothService.java
+++ b/core/java/android/server/BluetoothService.java
@@ -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;
}