Loading android/app/src/com/android/bluetooth/btservice/RemoteDevices.java +2 −4 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ import com.android.bluetooth.BluetoothStatsLog; import com.android.bluetooth.R; import com.android.bluetooth.Utils; import com.android.bluetooth.bas.BatteryService; import com.android.bluetooth.flags.FeatureFlagsImpl; import com.android.bluetooth.flags.Flags; import com.android.bluetooth.hfp.HeadsetHalConstants; import com.android.internal.annotations.VisibleForTesting; Loading @@ -70,7 +70,6 @@ public class RemoteDevices { private BluetoothAdapter mAdapter; private AdapterService mAdapterService; private FeatureFlagsImpl mFeatureFlags; private ArrayList<BluetoothDevice> mSdpTracker; private final Object mObject = new Object(); Loading Loading @@ -155,7 +154,6 @@ public class RemoteDevices { RemoteDevices(AdapterService service, Looper looper) { mAdapter = ((Context) service).getSystemService(BluetoothManager.class).getAdapter(); mAdapterService = service; mFeatureFlags = new FeatureFlagsImpl(); mSdpTracker = new ArrayList<BluetoothDevice>(); mDevices = new HashMap<String, DeviceProperties>(); mDualDevicesMap = new HashMap<String, String>(); Loading Loading @@ -1259,7 +1257,7 @@ public class RemoteDevices { Log.d(TAG, "keyMissingCallback device: " + bluetoothDevice); if (bluetoothDevice.getBondState() == BluetoothDevice.BOND_BONDED) { if (!mFeatureFlags.keyMissingBroadcast()) { if (!Flags.keyMissingBroadcast()) { Log.d(TAG, "flag not set - don't send key missing broadcast"); return; } Loading android/app/src/com/android/bluetooth/le_audio/LeAudioService.java +0 −10 Original line number Diff line number Diff line Loading @@ -111,8 +111,6 @@ public class LeAudioService extends ProfileService { // Timeout for state machine thread join, to prevent potential ANR. private static final int SM_THREAD_JOIN_TIMEOUT_MS = 1000; // Upper limit of all LeAudio devices: Bonded or Connected private static final int MAX_LE_AUDIO_DEVICES = 10; private static LeAudioService sLeAudioService; /** Loading Loading @@ -572,14 +570,6 @@ public class LeAudioService extends ProfileService { boolean isInbandRingtoneEnabled) { LeAudioDeviceDescriptor descriptor = mDeviceDescriptors.get(device); if (descriptor == null) { // Limit the maximum number of devices to avoid DoS attack if (mDeviceDescriptors.size() >= MAX_LE_AUDIO_DEVICES) { Log.e(TAG, "Maximum number of LeAudio state machines reached: " + MAX_LE_AUDIO_DEVICES); return null; } mDeviceDescriptors.put(device, new LeAudioDeviceDescriptor(isInbandRingtoneEnabled)); descriptor = mDeviceDescriptors.get(device); Log.d(TAG, "Created descriptor for device: " + device); Loading flags/gap.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -84,3 +84,10 @@ flag { description: "Optimize LE scan parameters for BRCM controllers" bug: "324238597" } flag { name: "le_periodic_scanning_reassembler" namespace: "bluetooth" description: "Enable reassembly of LE periodic advertising events" bug: "324886466" } system/stack/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -339,6 +339,7 @@ cc_defaults { "libchrome", ], shared_libs: [ "libbase", "liblog", ], target: { Loading Loading @@ -1379,6 +1380,7 @@ cc_test { "test/common/mock_hcic_layer.cc", ], static_libs: [ "libbase", "libbluetooth-types", "libbluetooth_hci_pdl", "libbluetooth_log", Loading system/stack/bnep/bnep_api.cc +10 −10 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ #include "bnep_api.h" #include <base/logging.h> #include <bluetooth/log.h> #include <string.h> #include "bnep_int.h" Loading @@ -37,6 +37,7 @@ #include "types/bluetooth/uuid.h" #include "types/raw_address.h" using namespace bluetooth; using bluetooth::Uuid; /******************************************************************************* Loading Loading @@ -136,7 +137,7 @@ tBNEP_RESULT BNEP_Connect(const RawAddress& p_rem_bda, const Uuid& src_uuid, uint16_t cid; tBNEP_CONN* p_bcb = bnepu_find_bcb_by_bd_addr(p_rem_bda); VLOG(0) << __func__ << " BDA:" << p_rem_bda; log::verbose("BDA:{}", ADDRESS_TO_LOGGABLE_STR(p_rem_bda)); if (!bnep_cb.profile_registered) return BNEP_WRONG_STATE; Loading @@ -162,7 +163,7 @@ tBNEP_RESULT BNEP_Connect(const RawAddress& p_rem_bda, const Uuid& src_uuid, */ p_bcb->con_state = BNEP_STATE_SEC_CHECKING; LOG_VERBOSE("BNEP initiating security procedures for src uuid %s", log::verbose("BNEP initiating security procedures for src uuid {}", p_bcb->src_uuid.ToString().c_str()); bnep_sec_check_complete(&p_bcb->rem_bda, BT_TRANSPORT_BR_EDR, p_bcb); Loading @@ -177,7 +178,7 @@ tBNEP_RESULT BNEP_Connect(const RawAddress& p_rem_bda, const Uuid& src_uuid, p_bcb->l2cap_cid = cid; } else { LOG_ERROR("BNEP - Originate failed"); log::error("BNEP - Originate failed"); if (bnep_cb.p_conn_state_cb) (*bnep_cb.p_conn_state_cb)(p_bcb->handle, p_bcb->rem_bda, BNEP_CONN_FAILED, false); Loading Loading @@ -221,7 +222,7 @@ tBNEP_RESULT BNEP_ConnectResp(uint16_t handle, tBNEP_RESULT resp) { (!(p_bcb->con_flags & BNEP_FLAGS_SETUP_RCVD))) return (BNEP_WRONG_STATE); LOG_DEBUG("handle %d, responce %d", handle, resp); log::debug("handle {}, responce {}", handle, resp); /* Form appropriate responce based on profile responce */ if (resp == BNEP_CONN_FAILED_SRC_UUID) Loading Loading @@ -294,7 +295,7 @@ tBNEP_RESULT BNEP_Disconnect(uint16_t handle) { if (p_bcb->con_state == BNEP_STATE_IDLE) return (BNEP_WRONG_HANDLE); LOG_VERBOSE("BNEP_Disconnect() for handle %d", handle); log::verbose("BNEP_Disconnect() for handle {}", handle); L2CA_DisconnectReq(p_bcb->l2cap_cid); Loading Loading @@ -340,8 +341,7 @@ tBNEP_RESULT BNEP_WriteBuf(uint16_t handle, const RawAddress& dest_addr, p_bcb = &(bnep_cb.bcb[handle - 1]); /* Check MTU size */ if (p_buf->len > BNEP_MTU_SIZE) { LOG_ERROR("%s length %d exceeded MTU %d", __func__, p_buf->len, BNEP_MTU_SIZE); log::error("length {} exceeded MTU {}", p_buf->len, BNEP_MTU_SIZE); osi_free(p_buf); return (BNEP_MTU_EXCEDED); } Loading Loading @@ -445,7 +445,7 @@ tBNEP_RESULT BNEP_Write(uint16_t handle, const RawAddress& dest_addr, /* Check MTU size. Consider the possibility of having extension headers */ if (len > BNEP_MTU_SIZE) { LOG_ERROR("%s length %d exceeded MTU %d", __func__, len, BNEP_MTU_SIZE); log::error("length {} exceeded MTU {}", len, BNEP_MTU_SIZE); return (BNEP_MTU_EXCEDED); } Loading Loading
android/app/src/com/android/bluetooth/btservice/RemoteDevices.java +2 −4 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ import com.android.bluetooth.BluetoothStatsLog; import com.android.bluetooth.R; import com.android.bluetooth.Utils; import com.android.bluetooth.bas.BatteryService; import com.android.bluetooth.flags.FeatureFlagsImpl; import com.android.bluetooth.flags.Flags; import com.android.bluetooth.hfp.HeadsetHalConstants; import com.android.internal.annotations.VisibleForTesting; Loading @@ -70,7 +70,6 @@ public class RemoteDevices { private BluetoothAdapter mAdapter; private AdapterService mAdapterService; private FeatureFlagsImpl mFeatureFlags; private ArrayList<BluetoothDevice> mSdpTracker; private final Object mObject = new Object(); Loading Loading @@ -155,7 +154,6 @@ public class RemoteDevices { RemoteDevices(AdapterService service, Looper looper) { mAdapter = ((Context) service).getSystemService(BluetoothManager.class).getAdapter(); mAdapterService = service; mFeatureFlags = new FeatureFlagsImpl(); mSdpTracker = new ArrayList<BluetoothDevice>(); mDevices = new HashMap<String, DeviceProperties>(); mDualDevicesMap = new HashMap<String, String>(); Loading Loading @@ -1259,7 +1257,7 @@ public class RemoteDevices { Log.d(TAG, "keyMissingCallback device: " + bluetoothDevice); if (bluetoothDevice.getBondState() == BluetoothDevice.BOND_BONDED) { if (!mFeatureFlags.keyMissingBroadcast()) { if (!Flags.keyMissingBroadcast()) { Log.d(TAG, "flag not set - don't send key missing broadcast"); return; } Loading
android/app/src/com/android/bluetooth/le_audio/LeAudioService.java +0 −10 Original line number Diff line number Diff line Loading @@ -111,8 +111,6 @@ public class LeAudioService extends ProfileService { // Timeout for state machine thread join, to prevent potential ANR. private static final int SM_THREAD_JOIN_TIMEOUT_MS = 1000; // Upper limit of all LeAudio devices: Bonded or Connected private static final int MAX_LE_AUDIO_DEVICES = 10; private static LeAudioService sLeAudioService; /** Loading Loading @@ -572,14 +570,6 @@ public class LeAudioService extends ProfileService { boolean isInbandRingtoneEnabled) { LeAudioDeviceDescriptor descriptor = mDeviceDescriptors.get(device); if (descriptor == null) { // Limit the maximum number of devices to avoid DoS attack if (mDeviceDescriptors.size() >= MAX_LE_AUDIO_DEVICES) { Log.e(TAG, "Maximum number of LeAudio state machines reached: " + MAX_LE_AUDIO_DEVICES); return null; } mDeviceDescriptors.put(device, new LeAudioDeviceDescriptor(isInbandRingtoneEnabled)); descriptor = mDeviceDescriptors.get(device); Log.d(TAG, "Created descriptor for device: " + device); Loading
flags/gap.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -84,3 +84,10 @@ flag { description: "Optimize LE scan parameters for BRCM controllers" bug: "324238597" } flag { name: "le_periodic_scanning_reassembler" namespace: "bluetooth" description: "Enable reassembly of LE periodic advertising events" bug: "324886466" }
system/stack/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -339,6 +339,7 @@ cc_defaults { "libchrome", ], shared_libs: [ "libbase", "liblog", ], target: { Loading Loading @@ -1379,6 +1380,7 @@ cc_test { "test/common/mock_hcic_layer.cc", ], static_libs: [ "libbase", "libbluetooth-types", "libbluetooth_hci_pdl", "libbluetooth_log", Loading
system/stack/bnep/bnep_api.cc +10 −10 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ #include "bnep_api.h" #include <base/logging.h> #include <bluetooth/log.h> #include <string.h> #include "bnep_int.h" Loading @@ -37,6 +37,7 @@ #include "types/bluetooth/uuid.h" #include "types/raw_address.h" using namespace bluetooth; using bluetooth::Uuid; /******************************************************************************* Loading Loading @@ -136,7 +137,7 @@ tBNEP_RESULT BNEP_Connect(const RawAddress& p_rem_bda, const Uuid& src_uuid, uint16_t cid; tBNEP_CONN* p_bcb = bnepu_find_bcb_by_bd_addr(p_rem_bda); VLOG(0) << __func__ << " BDA:" << p_rem_bda; log::verbose("BDA:{}", ADDRESS_TO_LOGGABLE_STR(p_rem_bda)); if (!bnep_cb.profile_registered) return BNEP_WRONG_STATE; Loading @@ -162,7 +163,7 @@ tBNEP_RESULT BNEP_Connect(const RawAddress& p_rem_bda, const Uuid& src_uuid, */ p_bcb->con_state = BNEP_STATE_SEC_CHECKING; LOG_VERBOSE("BNEP initiating security procedures for src uuid %s", log::verbose("BNEP initiating security procedures for src uuid {}", p_bcb->src_uuid.ToString().c_str()); bnep_sec_check_complete(&p_bcb->rem_bda, BT_TRANSPORT_BR_EDR, p_bcb); Loading @@ -177,7 +178,7 @@ tBNEP_RESULT BNEP_Connect(const RawAddress& p_rem_bda, const Uuid& src_uuid, p_bcb->l2cap_cid = cid; } else { LOG_ERROR("BNEP - Originate failed"); log::error("BNEP - Originate failed"); if (bnep_cb.p_conn_state_cb) (*bnep_cb.p_conn_state_cb)(p_bcb->handle, p_bcb->rem_bda, BNEP_CONN_FAILED, false); Loading Loading @@ -221,7 +222,7 @@ tBNEP_RESULT BNEP_ConnectResp(uint16_t handle, tBNEP_RESULT resp) { (!(p_bcb->con_flags & BNEP_FLAGS_SETUP_RCVD))) return (BNEP_WRONG_STATE); LOG_DEBUG("handle %d, responce %d", handle, resp); log::debug("handle {}, responce {}", handle, resp); /* Form appropriate responce based on profile responce */ if (resp == BNEP_CONN_FAILED_SRC_UUID) Loading Loading @@ -294,7 +295,7 @@ tBNEP_RESULT BNEP_Disconnect(uint16_t handle) { if (p_bcb->con_state == BNEP_STATE_IDLE) return (BNEP_WRONG_HANDLE); LOG_VERBOSE("BNEP_Disconnect() for handle %d", handle); log::verbose("BNEP_Disconnect() for handle {}", handle); L2CA_DisconnectReq(p_bcb->l2cap_cid); Loading Loading @@ -340,8 +341,7 @@ tBNEP_RESULT BNEP_WriteBuf(uint16_t handle, const RawAddress& dest_addr, p_bcb = &(bnep_cb.bcb[handle - 1]); /* Check MTU size */ if (p_buf->len > BNEP_MTU_SIZE) { LOG_ERROR("%s length %d exceeded MTU %d", __func__, p_buf->len, BNEP_MTU_SIZE); log::error("length {} exceeded MTU {}", p_buf->len, BNEP_MTU_SIZE); osi_free(p_buf); return (BNEP_MTU_EXCEDED); } Loading Loading @@ -445,7 +445,7 @@ tBNEP_RESULT BNEP_Write(uint16_t handle, const RawAddress& dest_addr, /* Check MTU size. Consider the possibility of having extension headers */ if (len > BNEP_MTU_SIZE) { LOG_ERROR("%s length %d exceeded MTU %d", __func__, len, BNEP_MTU_SIZE); log::error("length {} exceeded MTU {}", len, BNEP_MTU_SIZE); return (BNEP_MTU_EXCEDED); } Loading