Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78581e96 authored by Marie Janssen's avatar Marie Janssen Committed by android-build-merger
Browse files

resolve merge conflicts of 6a31a5c to stage-aosp-master

am: ff735e35

Change-Id: Ib6321dee7357920c73b135fbe465998dc4469e66
parents cd33b872 ff735e35
Loading
Loading
Loading
Loading
+5 −11
Original line number Diff line number Diff line
@@ -765,19 +765,13 @@ public final class BluetoothAdapter {
    public boolean enableBLE() {
        if (!isBleScanAlwaysAvailable()) return false;

        if (isLeEnabled() == true) {
            if (DBG) Log.d(TAG, "enableBLE(): BT is already enabled..!");
        try {
            mManagerService.updateBleAppCount(mToken, true);
            } catch (RemoteException e) {
                Log.e(TAG, "", e);
            }
            if (isLeEnabled()) {
                if (DBG) Log.d(TAG, "enableBLE(): Bluetooth already enabled");
                return true;
            }

        try {
            if (DBG) Log.d(TAG, "Calling enableBLE");
            mManagerService.updateBleAppCount(mToken, true);
            if (DBG) Log.d(TAG, "enableBLE(): Calling enable");
            return mManagerService.enable();
        } catch (RemoteException e) {
            Log.e(TAG, "", e);
+8 −2
Original line number Diff line number Diff line
@@ -217,6 +217,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
                                mBluetoothLock.readLock().lock();
                                if (mBluetooth != null) {
                                    mBluetooth.onBrEdrDown();
                                    mEnable = false;
                                    mEnableExternal = false;
                                }
                            } catch (RemoteException e) {
@@ -456,7 +457,9 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
                if (DBG) Slog.d(TAG, "Disabling LE only mode after application crash");
                try {
                    mBluetoothLock.readLock().lock();
                    if (mBluetooth != null) {
                    if (mBluetooth != null &&
                        mBluetooth.getState() == BluetoothAdapter.STATE_BLE_ON) {
                        mEnable = false;
                        mBluetooth.onBrEdrDown();
                    }
                } catch (RemoteException e) {
@@ -473,6 +476,9 @@ class BluetoothManagerService extends IBluetoothManager.Stub {

    @Override
    public boolean isBleScanAlwaysAvailable() {
        if (isAirplaneModeOn() && !mEnable) {
            return false;
        }
        try {
            return (Settings.Global.getInt(mContentResolver,
                    Settings.Global.BLE_SCAN_ALWAYS_AVAILABLE)) != 0;