summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--framework/java/android/bluetooth/BluetoothAdapter.java7
-rw-r--r--framework/java/android/bluetooth/OWNERS1
-rw-r--r--framework/tests/OWNERS2
-rw-r--r--service/java/com/android/server/bluetooth/BluetoothManagerService.java20
-rw-r--r--system/btif/src/btif_debug_btsnoop.cc19
-rw-r--r--system/stack/avrc/avrc_pars_tg.cc7
6 files changed, 29 insertions, 27 deletions
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java
index 8361eb1af3..46893fcc25 100644
--- a/framework/java/android/bluetooth/BluetoothAdapter.java
+++ b/framework/java/android/bluetooth/BluetoothAdapter.java
@@ -3140,9 +3140,6 @@ public final class BluetoothAdapter {
return true;
}
return false;
- } else if (profile == BluetoothProfile.LE_AUDIO) {
- BluetoothLeAudio leAudio = new BluetoothLeAudio(context, listener, this);
- return true;
} else if (profile == BluetoothProfile.VOLUME_CONTROL) {
BluetoothVolumeControl vcs = new BluetoothVolumeControl(context, listener, this);
return true;
@@ -3242,10 +3239,6 @@ public final class BluetoothAdapter {
BluetoothHearingAid hearingAid = (BluetoothHearingAid) proxy;
hearingAid.close();
break;
- case BluetoothProfile.LE_AUDIO:
- BluetoothLeAudio leAudio = (BluetoothLeAudio) proxy;
- leAudio.close();
- break;
case BluetoothProfile.VOLUME_CONTROL:
BluetoothVolumeControl vcs = (BluetoothVolumeControl) proxy;
vcs.close();
diff --git a/framework/java/android/bluetooth/OWNERS b/framework/java/android/bluetooth/OWNERS
index fbee577731..fd60bed31a 100644
--- a/framework/java/android/bluetooth/OWNERS
+++ b/framework/java/android/bluetooth/OWNERS
@@ -4,3 +4,4 @@ rahulsabnis@google.com
sattiraju@google.com
siyuanh@google.com
zachoverflow@google.com
+
diff --git a/framework/tests/OWNERS b/framework/tests/OWNERS
index 53bf287098..98bb877162 100644
--- a/framework/tests/OWNERS
+++ b/framework/tests/OWNERS
@@ -1 +1 @@
-include /framework/java/android/bluetooth/OWNERS
+include /core/java/android/bluetooth/OWNERS
diff --git a/service/java/com/android/server/bluetooth/BluetoothManagerService.java b/service/java/com/android/server/bluetooth/BluetoothManagerService.java
index 7dd9ea4322..71f180505f 100644
--- a/service/java/com/android/server/bluetooth/BluetoothManagerService.java
+++ b/service/java/com/android/server/bluetooth/BluetoothManagerService.java
@@ -107,10 +107,6 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
private static final String BLUETOOTH_PRIVILEGED =
android.Manifest.permission.BLUETOOTH_PRIVILEGED;
- private static final String SECURE_SETTINGS_BLUETOOTH_ADDR_VALID = "bluetooth_addr_valid";
- private static final String SECURE_SETTINGS_BLUETOOTH_ADDRESS = "bluetooth_address";
- private static final String SECURE_SETTINGS_BLUETOOTH_NAME = "bluetooth_name";
-
private static final int ACTIVE_LOG_MAX_SIZE = 20;
private static final int CRASH_LOG_MAX_SIZE = 100;
@@ -661,7 +657,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
}
if (getBluetoothBooleanConfig("config_bluetooth_address_validation", false)
&& Settings.Secure.getIntForUser(mContentResolver,
- SECURE_SETTINGS_BLUETOOTH_ADDR_VALID, 0, mUserId)
+ Settings.Secure.BLUETOOTH_NAME, 0, mUserId)
== 0) {
// if the valid flag is not set, don't load the address and name
if (DBG) {
@@ -670,9 +666,9 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
return;
}
mName = Settings.Secure.getStringForUser(
- mContentResolver, SECURE_SETTINGS_BLUETOOTH_NAME, mUserId);
+ mContentResolver, Settings.Secure.BLUETOOTH_NAME, mUserId);
mAddress = Settings.Secure.getStringForUser(
- mContentResolver, SECURE_SETTINGS_BLUETOOTH_ADDRESS, mUserId);
+ mContentResolver, Settings.Secure.BLUETOOTH_ADDRESS, mUserId);
if (DBG) {
Slog.d(TAG, "Stored bluetooth Name=" + mName + ",Address=" + mAddress);
}
@@ -686,30 +682,30 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
*/
private void storeNameAndAddress(String name, String address) {
if (name != null) {
- Settings.Secure.putStringForUser(mContentResolver, SECURE_SETTINGS_BLUETOOTH_NAME, name,
+ Settings.Secure.putStringForUser(mContentResolver, Settings.Secure.BLUETOOTH_NAME, name,
mUserId);
mName = name;
if (DBG) {
Slog.d(TAG, "Stored Bluetooth name: " + Settings.Secure.getStringForUser(
- mContentResolver, SECURE_SETTINGS_BLUETOOTH_NAME,
+ mContentResolver, Settings.Secure.BLUETOOTH_NAME,
mUserId));
}
}
if (address != null) {
- Settings.Secure.putStringForUser(mContentResolver, SECURE_SETTINGS_BLUETOOTH_ADDRESS,
+ Settings.Secure.putStringForUser(mContentResolver, Settings.Secure.BLUETOOTH_ADDRESS,
address, mUserId);
mAddress = address;
if (DBG) {
Slog.d(TAG,
"Stored Bluetoothaddress: " + Settings.Secure.getStringForUser(
- mContentResolver, SECURE_SETTINGS_BLUETOOTH_ADDRESS,
+ mContentResolver, Settings.Secure.BLUETOOTH_ADDRESS,
mUserId));
}
}
if ((name != null) && (address != null)) {
- Settings.Secure.putIntForUser(mContentResolver, SECURE_SETTINGS_BLUETOOTH_ADDR_VALID, 1,
+ Settings.Secure.putIntForUser(mContentResolver, Settings.Secure.BLUETOOTH_ADDR_VALID, 1,
mUserId);
}
}
diff --git a/system/btif/src/btif_debug_btsnoop.cc b/system/btif/src/btif_debug_btsnoop.cc
index 56c539649c..87e2a20d76 100644
--- a/system/btif/src/btif_debug_btsnoop.cc
+++ b/system/btif/src/btif_debug_btsnoop.cc
@@ -25,6 +25,7 @@
#include "btif/include/btif_debug_btsnoop.h"
#include "hci/include/btsnoop_mem.h"
#include "internal_include/bt_target.h"
+#include "osi/include/properties.h"
#include "osi/include/ringbuffer.h"
#define REDUCE_HCI_TYPE_TO_SIGNIFICANT_BITS(type) ((type) >> 8)
@@ -37,6 +38,7 @@ static const size_t BTSNOOP_MEM_BUFFER_SIZE = (256 * 1024);
static std::mutex buffer_mutex;
static ringbuffer_t* buffer = NULL;
static uint64_t last_timestamp_ms = 0;
+static bool qualcomm_debug_log_enable = false;
static size_t btsnoop_calculate_packet_length(uint16_t type,
const uint8_t* data,
@@ -79,6 +81,9 @@ static size_t btsnoop_calculate_packet_length(uint16_t type,
static const size_t L2CAP_CID_OFFSET = (HCI_ACL_HEADER_SIZE + 2);
static const uint16_t L2CAP_SIGNALING_CID = 0x0001;
+ static const size_t HCI_ACL_HANDLE_OFFSET = 0;
+ static const uint16_t QUALCOMM_DEBUG_LOG_HANDLE = 0xedc;
+
// Maximum amount of ACL data to log.
// Enough for an RFCOMM frame up to the frame check;
// not enough for a HID report or audio data.
@@ -100,11 +105,19 @@ static size_t btsnoop_calculate_packet_length(uint16_t type,
if (length > len_hci_acl) {
uint16_t l2cap_cid =
data[L2CAP_CID_OFFSET] | (data[L2CAP_CID_OFFSET + 1] << 8);
+ uint16_t hci_acl_packet_handle = data[HCI_ACL_HANDLE_OFFSET] |
+ (data[HCI_ACL_HANDLE_OFFSET + 1] << 8);
+ hci_acl_packet_handle &= 0x0FFF;
+
if (l2cap_cid == L2CAP_SIGNALING_CID) {
// For the signaling CID, take the full packet.
// That way, the PSM setup is captured, allowing decoding of PSMs down
// the road.
return length;
+ } else if (qualcomm_debug_log_enable &&
+ hci_acl_packet_handle == QUALCOMM_DEBUG_LOG_HANDLE) {
+ // For the enhanced controller debug log, take the full packet.
+ return length;
} else {
// Otherwise, return as much as we reasonably can
len_hci_acl = MAX_HCI_ACL_LEN;
@@ -130,6 +143,12 @@ static size_t btsnoop_calculate_packet_length(uint16_t type,
void btif_debug_btsnoop_init(void) {
if (buffer == NULL) buffer = ringbuffer_init(BTSNOOP_MEM_BUFFER_SIZE);
btsnoop_mem_set_callback(btsnoop_cb);
+
+ char value[PROPERTY_VALUE_MAX] = {0};
+ int ret = osi_property_get("ro.soc.manufacturer", value, "");
+ if (ret > 0 && strncmp(value, "Qualcomm", ret) == 0) {
+ qualcomm_debug_log_enable = true;
+ }
}
#ifndef OS_ANDROID
diff --git a/system/stack/avrc/avrc_pars_tg.cc b/system/stack/avrc/avrc_pars_tg.cc
index 71cebef1f2..6aa4a31e14 100644
--- a/system/stack/avrc/avrc_pars_tg.cc
+++ b/system/stack/avrc/avrc_pars_tg.cc
@@ -118,13 +118,6 @@ static tAVRC_STS avrc_pars_vendor_cmd(tAVRC_MSG_VENDOR* p_msg,
if (p_msg->vendor_len == 0) return AVRC_STS_NO_ERROR;
if (p_msg->p_vendor_data == NULL) return AVRC_STS_INTERNAL_ERR;
- if (p_msg->vendor_len < 4) {
- android_errorWriteLog(0x534e4554, "168712382");
- AVRC_TRACE_WARNING("%s: message length %d too short: must be at least 4",
- __func__, p_msg->vendor_len);
- return AVRC_STS_INTERNAL_ERR;
- }
-
p = p_msg->p_vendor_data;
p_result->pdu = *p++;
AVRC_TRACE_DEBUG("%s pdu:0x%x", __func__, p_result->pdu);