From aa6bd940f07f4552eb8f43869194616660877fd4 Mon Sep 17 00:00:00 2001 From: Jake Hamby Date: Mon, 27 Jun 2011 16:32:37 -0700 Subject: [PATCH] Don't enable Bluetooth when booting into airplane mode. When airplane mode is enabled and the phone is rebooted, Bluetooth should not turn on. Previously the airplane mode setting was ignored and only the Bluetooth enabled setting was used to determine whether to enable Bluetooth at boot time. Now, both settings are checked. Bug: 3404790 Change-Id: I5e3095a94e50825dd469addebef97a7c85041fca --- services/java/com/android/server/SystemServer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index a23bacf72d158..cd68c6854153b 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -209,9 +209,11 @@ class ServerThread extends Thread { bluetoothA2dp); bluetooth.initAfterA2dpRegistration(); + int airplaneModeOn = Settings.System.getInt(mContentResolver, + Settings.System.AIRPLANE_MODE_ON, 0); int bluetoothOn = Settings.Secure.getInt(mContentResolver, Settings.Secure.BLUETOOTH_ON, 0); - if (bluetoothOn > 0) { + if (airplaneModeOn == 0 && bluetoothOn != 0) { bluetooth.enable(); } }