Add a new version of the disable API.

This allows for the setting to be persisted or not.
Also turn on Bluetooth in System Server if needed.
It won't work currently because the service wouldn't have
started.

Change-Id: I15fa2bff93aa32134c1b565fcbe90ba68614b6a1
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index f49c4e6..2393957 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -241,11 +241,17 @@
             } else if (factoryTest == SystemServer.FACTORY_TEST_LOW_LEVEL) {
                 Slog.i(TAG, "No Bluetooth Service (factory test)");
             } else {
-                //TODO(BT): Start BT services and turn on if needed.
                 int airplaneModeOn = Settings.System.getInt(mContentResolver,
                         Settings.System.AIRPLANE_MODE_ON, 0);
                 int bluetoothOn = Settings.Secure.getInt(mContentResolver,
                     Settings.Secure.BLUETOOTH_ON, 0);
+                BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
+                // TODO(BT): This will not work as the Bluetooth process is not
+                // up. Depending on the process architecture, BluetoothAdapter
+                // will have to bind to the service.
+                if (adapter != null && airplaneModeOn == 0 &&  bluetoothOn != 0) {
+                    adapter.enable();
+                }
             }
 
         } catch (RuntimeException e) {