Non persistent adapter service

Change-Id: Ib13d5c77416e58161df0e04d7a15ec0dddbde8b5

Conflicts:

	core/java/android/bluetooth/BluetoothInputDevice.java

Conflicts:

	core/java/com/android/internal/app/ShutdownThread.java
	services/java/com/android/server/SystemServer.java

Conflicts:

	services/java/com/android/server/SystemServer.java
	services/java/com/android/server/pm/ShutdownThread.java
This commit is contained in:
fredc
2012-04-12 00:02:00 -07:00
committed by Android (Google) Code Review
parent 919a4c6264
commit 0f42037eb7
22 changed files with 1232 additions and 213 deletions

View File

@ -128,6 +128,7 @@ class ServerThread extends Thread {
IPackageManager pm = null;
Context context = null;
WindowManagerService wm = null;
BluetoothManagerService bluetooth = null;
DockObserver dock = null;
UsbService usb = null;
SerialService serial = null;
@ -241,17 +242,9 @@ class ServerThread extends Thread {
} else if (factoryTest == SystemServer.FACTORY_TEST_LOW_LEVEL) {
Slog.i(TAG, "No Bluetooth Service (factory test)");
} else {
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();
}
Slog.i(TAG, "Bluetooth Manager Service");
bluetooth = new BluetoothManagerService(context);
ServiceManager.addService(BluetoothAdapter.BLUETOOTH_MANAGER_SERVICE, bluetooth);
}
} catch (RuntimeException e) {