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

Commit bd82056a authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by android-build-merger
Browse files

Merge "Fix NPE in createBond" am: b9549398 am: 68fb3338

am: 9c4cf1de

Change-Id: Iae3a23967f90bcf3b29f19c421f36f33394a458d
parents 6f50b8d7 9c4cf1de
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1627,7 +1627,7 @@ public class AdapterService extends Service {
            return false;
        }

        deviceProp.setBondingInitiatedLocally(true);
        mRemoteDevices.setBondingInitiatedLocally(Utils.getByteAddress(device));

        // Pairing is unreliable while scanning, so cancel discovery
        // Note, remove this when native stack improves
+17 −2
Original line number Diff line number Diff line
@@ -24,9 +24,7 @@ import android.os.Handler;
import android.os.Message;
import android.os.ParcelUuid;
import android.util.Log;

import com.android.bluetooth.Utils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
@@ -271,6 +269,23 @@ final class RemoteDevices {
        mSdpTracker.remove(device);
    }

  /**
   * When bonding is initiated to remote device that we have never seen, i.e Out Of Band pairing, we
   * must add device first before setting it's properties. This is a helper method for doing that.
   */
  void setBondingInitiatedLocally(byte[] address) {
        DeviceProperties properties;

        BluetoothDevice device = getDevice(address);
        if (device == null) {
            properties = addDeviceProperties(address);
        } else {
            properties = getDeviceProperties(device);
        }

        properties.setBondingInitiatedLocally(true);
    }


    void devicePropertyChangedCallback(byte[] address, int[] types, byte[][] values) {
        Intent intent;