Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothAdapter.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -208,7 +208,7 @@ public final class LocalBluetoothAdapter { return false; return false; } } public void setBluetoothEnabled(boolean enabled) { public boolean setBluetoothEnabled(boolean enabled) { boolean success = enabled boolean success = enabled ? mAdapter.enable() ? mAdapter.enable() : mAdapter.disable(); : mAdapter.disable(); Loading @@ -225,6 +225,7 @@ public final class LocalBluetoothAdapter { syncBluetoothState(); syncBluetoothState(); } } return success; } } public BluetoothDevice getRemoteDevice(String address) { public BluetoothDevice getRemoteDevice(String address) { Loading services/core/java/com/android/server/BluetoothManagerService.java +14 −1 Original line number Original line Diff line number Diff line Loading @@ -613,7 +613,20 @@ class BluetoothManagerService extends IBluetoothManager.Stub { "Need BLUETOOTH ADMIN permission"); "Need BLUETOOTH ADMIN permission"); if (DBG) { if (DBG) { Slog.d(TAG,"enable(): mBluetooth =" + mBluetooth + Slog.d(TAG,"enable(): mBluetooth =" + mBluetooth + " mBinding = " + mBinding); " mBinding = " + mBinding + " mState = " + mState); } // We do not honor ON requests when the adapter is already turned ON or in the process of // turning ON. // As a protective mechanism to make sure that the native stack gets cleaned up properly // before turning it back ON we ignore requests while the bluetooth is turning OFF. // Bug: b/28318203 if (mState == BluetoothAdapter.STATE_BLE_TURNING_OFF || mState == BluetoothAdapter.STATE_TURNING_OFF || mState == BluetoothAdapter.STATE_ON || mState == BluetoothAdapter.STATE_BLE_ON || mState == BluetoothAdapter.STATE_TURNING_ON || mState == BluetoothAdapter.STATE_BLE_TURNING_ON) { return false; } } synchronized(mReceiver) { synchronized(mReceiver) { Loading Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothAdapter.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -208,7 +208,7 @@ public final class LocalBluetoothAdapter { return false; return false; } } public void setBluetoothEnabled(boolean enabled) { public boolean setBluetoothEnabled(boolean enabled) { boolean success = enabled boolean success = enabled ? mAdapter.enable() ? mAdapter.enable() : mAdapter.disable(); : mAdapter.disable(); Loading @@ -225,6 +225,7 @@ public final class LocalBluetoothAdapter { syncBluetoothState(); syncBluetoothState(); } } return success; } } public BluetoothDevice getRemoteDevice(String address) { public BluetoothDevice getRemoteDevice(String address) { Loading
services/core/java/com/android/server/BluetoothManagerService.java +14 −1 Original line number Original line Diff line number Diff line Loading @@ -613,7 +613,20 @@ class BluetoothManagerService extends IBluetoothManager.Stub { "Need BLUETOOTH ADMIN permission"); "Need BLUETOOTH ADMIN permission"); if (DBG) { if (DBG) { Slog.d(TAG,"enable(): mBluetooth =" + mBluetooth + Slog.d(TAG,"enable(): mBluetooth =" + mBluetooth + " mBinding = " + mBinding); " mBinding = " + mBinding + " mState = " + mState); } // We do not honor ON requests when the adapter is already turned ON or in the process of // turning ON. // As a protective mechanism to make sure that the native stack gets cleaned up properly // before turning it back ON we ignore requests while the bluetooth is turning OFF. // Bug: b/28318203 if (mState == BluetoothAdapter.STATE_BLE_TURNING_OFF || mState == BluetoothAdapter.STATE_TURNING_OFF || mState == BluetoothAdapter.STATE_ON || mState == BluetoothAdapter.STATE_BLE_ON || mState == BluetoothAdapter.STATE_TURNING_ON || mState == BluetoothAdapter.STATE_BLE_TURNING_ON) { return false; } } synchronized(mReceiver) { synchronized(mReceiver) { Loading