Loading core/java/android/server/BluetoothDeviceService.java +19 −1 Original line number Diff line number Diff line Loading @@ -63,8 +63,10 @@ public class BluetoothDeviceService extends IBluetoothDevice.Stub { private BluetoothEventLoop mEventLoop; private IntentFilter mIntentFilter; private boolean mIsAirplaneSensitive; private final BondState mBondState = new BondState(); // local cache of bondings private int mBluetoothState; private boolean mRestart = false; // need to call enable() after disable() private final BondState mBondState = new BondState(); // local cache of bondings private boolean mIsDiscovering; private final IBatteryStats mBatteryStats; Loading Loading @@ -218,6 +220,11 @@ public class BluetoothDeviceService extends IBluetoothDevice.Stub { } finally { Binder.restoreCallingIdentity(ident); } if (mRestart) { mRestart = false; enable(); } } /** Bring up BT and persist BT on in settings */ Loading Loading @@ -252,6 +259,17 @@ public class BluetoothDeviceService extends IBluetoothDevice.Stub { return true; } /** Forcibly restart Bluetooth if it is on */ /* package */ synchronized void restart() { if (mBluetoothState != BluetoothDevice.BLUETOOTH_STATE_ON) { return; } mRestart = true; if (!disable(false)) { mRestart = false; } } private synchronized void setBluetoothState(int state) { if (state == mBluetoothState) { return; Loading core/java/android/server/BluetoothEventLoop.java +2 −2 Original line number Diff line number Diff line Loading @@ -76,8 +76,7 @@ class BluetoothEventLoop { } break; case EVENT_RESTART_BLUETOOTH: mBluetoothService.disable(); mBluetoothService.enable(); mBluetoothService.restart(); break; } } Loading Loading @@ -170,6 +169,7 @@ class BluetoothEventLoop { if (mode >= 0) { Intent intent = new Intent(BluetoothIntent.SCAN_MODE_CHANGED_ACTION); intent.putExtra(BluetoothIntent.SCAN_MODE, mode); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT); mContext.sendBroadcast(intent, BLUETOOTH_PERM); } } Loading Loading
core/java/android/server/BluetoothDeviceService.java +19 −1 Original line number Diff line number Diff line Loading @@ -63,8 +63,10 @@ public class BluetoothDeviceService extends IBluetoothDevice.Stub { private BluetoothEventLoop mEventLoop; private IntentFilter mIntentFilter; private boolean mIsAirplaneSensitive; private final BondState mBondState = new BondState(); // local cache of bondings private int mBluetoothState; private boolean mRestart = false; // need to call enable() after disable() private final BondState mBondState = new BondState(); // local cache of bondings private boolean mIsDiscovering; private final IBatteryStats mBatteryStats; Loading Loading @@ -218,6 +220,11 @@ public class BluetoothDeviceService extends IBluetoothDevice.Stub { } finally { Binder.restoreCallingIdentity(ident); } if (mRestart) { mRestart = false; enable(); } } /** Bring up BT and persist BT on in settings */ Loading Loading @@ -252,6 +259,17 @@ public class BluetoothDeviceService extends IBluetoothDevice.Stub { return true; } /** Forcibly restart Bluetooth if it is on */ /* package */ synchronized void restart() { if (mBluetoothState != BluetoothDevice.BLUETOOTH_STATE_ON) { return; } mRestart = true; if (!disable(false)) { mRestart = false; } } private synchronized void setBluetoothState(int state) { if (state == mBluetoothState) { return; Loading
core/java/android/server/BluetoothEventLoop.java +2 −2 Original line number Diff line number Diff line Loading @@ -76,8 +76,7 @@ class BluetoothEventLoop { } break; case EVENT_RESTART_BLUETOOTH: mBluetoothService.disable(); mBluetoothService.enable(); mBluetoothService.restart(); break; } } Loading Loading @@ -170,6 +169,7 @@ class BluetoothEventLoop { if (mode >= 0) { Intent intent = new Intent(BluetoothIntent.SCAN_MODE_CHANGED_ACTION); intent.putExtra(BluetoothIntent.SCAN_MODE, mode); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT); mContext.sendBroadcast(intent, BLUETOOTH_PERM); } } Loading