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

Commit 1196120c authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11494200 from a0b2fdf5 to 24Q2-release

Change-Id: Ia7d16021a8a46e0ea972907209f19282c9e711aa
parents 3cea816d a0b2fdf5
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ package com.android.bluetooth.btservice;
import android.bluetooth.OobData;
import android.bluetooth.UidTraffic;

import com.android.bluetooth.flags.Flags;

class JniCallbacks {

    private RemoteDevices mRemoteDevices;
@@ -66,6 +68,9 @@ class JniCallbacks {

    void bondStateChangeCallback(int status, byte[] address, int newState, int hciReason) {
        mBondStateMachine.bondStateChangeCallback(status, address, newState, hciReason);
        if (Flags.removeBondWithAddressMap()) {
            mRemoteDevices.onBondStateChange(address, newState);
        }
    }

    void addressConsolidateCallback(byte[] mainAddress, byte[] secondaryAddress) {
+19 −9
Original line number Diff line number Diff line
@@ -1155,15 +1155,7 @@ public class RemoteDevices {
                Utils.sendBroadcast(mAdapterService, intent, BLUETOOTH_CONNECT,
                        Utils.getTempAllowlistBroadcastOptions());
            } else if (device.getBondState() == BluetoothDevice.BOND_NONE) {
                String key = Utils.getAddressStringFromByte(address);
                synchronized (mDevices) {
                    mDevices.remove(key);
                    mDeviceQueue.remove(key); // Remove from LRU cache

                    // Remove from dual mode device mappings
                    mDualDevicesMap.values().remove(key);
                    mDualDevicesMap.remove(key);
                }
                removeAddressMapping(address);
            }
            if (state == BluetoothAdapter.STATE_ON || state == BluetoothAdapter.STATE_TURNING_OFF) {
                mAdapterService.notifyAclDisconnected(device, transportLinkType);
@@ -1246,6 +1238,24 @@ public class RemoteDevices {
        }
    }

    private void removeAddressMapping(byte[] address) {
        String key = Utils.getAddressStringFromByte(address);
        synchronized (mDevices) {
            mDevices.remove(key);
            mDeviceQueue.remove(key); // Remove from LRU cache

            // Remove from dual mode device mappings
            mDualDevicesMap.values().remove(key);
            mDualDevicesMap.remove(key);
        }
    }

    void onBondStateChange(byte[] address, int newState) {
        if (newState == BluetoothDevice.BOND_NONE) {
            removeAddressMapping(address);
        }
    }

    void keyMissingCallback(byte[] address) {
        BluetoothDevice bluetoothDevice = getDevice(address);
        if (bluetoothDevice == null) {
+7 −0
Original line number Diff line number Diff line
@@ -14,3 +14,10 @@ flag {
    description: "Don't reset the pairing state if service discovery concludes for a different device"
    bug: "321996502"
}

flag {
    name: "force_bredr_for_sdp_retry"
    namespace: "bluetooth"
    description: "Force BR/EDR transport for retrying SDP service discovery"
    bug: "326656580"
}
+7 −0
Original line number Diff line number Diff line
@@ -49,3 +49,10 @@ flag {
    description: "Change visibility of BluetoothDevice#getAddressType API to public"
    bug: "321120941"
}

flag {
    name: "remove_bond_with_address_map"
    namespace: "bluetooth"
    description: "Removes the address map when the bond is removed"
    bug: "326603271"
}
+13 −8
Original line number Diff line number Diff line
@@ -30,16 +30,11 @@ cc_defaults {
        "libbluetooth_headers",
    ],
    defaults: [
        "latest_android_hardware_bluetooth_audio_ndk_shared",
        "latest_android_hardware_audio_common_ndk_static",
        "latest_android_hardware_bluetooth_audio_ndk_static",
        "latest_android_media_audio_common_types_ndk_static",
    ],
    shared_libs: [
        "android.hardware.bluetooth.a2dp@1.0",
        "android.hardware.bluetooth.audio@2.0",
        "android.hardware.bluetooth.audio@2.1",
        "android.hardware.bluetooth@1.0",
        "android.hardware.bluetooth@1.1",
        "android.system.suspend-V1-ndk",
        "android.system.suspend.control-V1-ndk",
        "libPlatformProperties",
        "libaaudio",
        "libbinder_ndk",
@@ -51,6 +46,16 @@ cc_defaults {
        "server_configurable_flags",
    ],
    static_libs: [
        "android.hardware.audio.common@5.0",
        "android.hardware.bluetooth.a2dp@1.0",
        "android.hardware.bluetooth.audio@2.0",
        "android.hardware.bluetooth.audio@2.1",
        "android.hardware.bluetooth@1.0",
        "android.hardware.bluetooth@1.1",
        "android.hardware.common-V2-ndk",
        "android.hardware.common.fmq-V1-ndk",
        "android.system.suspend-V1-ndk",
        "android.system.suspend.control-V1-ndk",
        "libFraunhoferAAC",
        "libaudio-a2dp-hw-utils",
        "libbase",
Loading