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

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

Merge "Fix NPE in createBond" am: b9549398

am: 68fb3338

Change-Id: I6e92eb2a114a3da0febad730faaf30edee28be50
parents 973f7c26 68fb3338
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1627,7 +1627,7 @@ public class AdapterService extends Service {
            return false;
            return false;
        }
        }


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


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

import com.android.bluetooth.Utils;
import com.android.bluetooth.Utils;

import java.util.ArrayList;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.LinkedList;
@@ -271,6 +269,23 @@ final class RemoteDevices {
        mSdpTracker.remove(device);
        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) {
    void devicePropertyChangedCallback(byte[] address, int[] types, byte[][] values) {
        Intent intent;
        Intent intent;