Merge tag 'android-13.0.0_r52' into staging/lineage-20.0_merge-android-13.0.0_r52
Android 13.0.0 Release 52 (TQ3A.230605.012)
* tag 'android-13.0.0_r52': (294 commits)
disable AT+ANDROID processing for wear
Revert "Handle AVDT_SCB_HDL_TC_CLOSE in avdt_scb idle state"
Revert "OPP: Do not trimDatabase if ContentProvider doesn't exist"
Import translations. DO NOT MERGE ANYWHERE
RESTRICT AUTOMERGE: Move BMW Carkit(9c:df:03) into IOP table to only use AVRCP 1.3 from 1.4 to resolve interop issues.
Fix OOB read in btm_ble_periodic_av_sync_lost
Revert "Fix a test in BluetoothOppLauncherActivityTest"
Fix gatt_end_operation buffer overflow
Fix a OOB bug in bta_hh_co_get_rpt_rsp
[BluetoothMetrics] Adding dependent changes for direct LE-ACL L2CAP fixed channel
BluetoothMetrics: Upload readable sha256, instead of bytes
BluetoothMetrics: Add fallback solution for device names
[BluetoothMetrics] This covers the case for Direct LE-ACL Connection Success Rate as per go/bluetooth-le-connection-metrics.
[RESTRICT AUTOMERGE] Fix potential use after free in pan_api.cc
[RESTRICT AUTOMERGE] Validate buffer length in sdpu_build_uuid_seq
Revert "Revert "Validate buffer length in sdpu_build_uuid_seq""
LE Audio: close GATT server properly
Only initiate Codec Negotation if locally supported.
Fix null pointer access in handle_rc_ctrl_features
Only add br_edr to power mode db
...
Conflicts:
android/app/src/com/android/bluetooth/map/BluetoothMapContentObserver.java
android/app/src/com/android/bluetooth/map/BluetoothMapUtils.java
framework/tests/unit/Android.bp
system/bta/dm/bta_dm_act.cc
system/device/include/interop_database.h
Change-Id: I1ef387fdca7fd2e79c6fb06925ad9923714595dc
diff --git a/android/BluetoothLegacyMigration/Android.bp b/android/BluetoothLegacyMigration/Android.bp
index b755fa0..786264e 100644
--- a/android/BluetoothLegacyMigration/Android.bp
+++ b/android/BluetoothLegacyMigration/Android.bp
@@ -9,6 +9,6 @@
srcs: [ "BluetoothLegacyMigration.kt" ],
// Must match Bluetooth.apk certificate because of sharedUserId
- certificate: ":com.android.bluetooth.certificate",
+ certificate: "bluetooth",
platform_apis: true,
}
diff --git a/android/app/Android.bp b/android/app/Android.bp
index 2e71dcc..7c65bf2 100644
--- a/android/app/Android.bp
+++ b/android/app/Android.bp
@@ -90,7 +90,7 @@
":bluetooth-proto-enums-java-gen",
],
aaptflags: [ "--custom-package", "com.android.bluetooth" ],
- certificate: ":com.android.bluetooth.certificate",
+ certificate: "bluetooth",
jarjar_rules: ":bluetooth-jarjar-rules",
@@ -195,8 +195,3 @@
" --minApiLevel 33",
out: ["com/android/bluetooth/BluetoothStatsLog.java"],
}
-
-android_app_certificate {
- name: "com.android.bluetooth.certificate",
- certificate: "certs/com.android.bluetooth"
-}
diff --git a/android/app/certs/com.android.bluetooth.pk8 b/android/app/certs/com.android.bluetooth.pk8
deleted file mode 100644
index c6ea434..0000000
--- a/android/app/certs/com.android.bluetooth.pk8
+++ /dev/null
Binary files differ
diff --git a/android/app/certs/com.android.bluetooth.x509.pem b/android/app/certs/com.android.bluetooth.x509.pem
deleted file mode 100644
index 396d7c9..0000000
--- a/android/app/certs/com.android.bluetooth.x509.pem
+++ /dev/null
@@ -1,36 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIGOzCCBCOgAwIBAgIUEiZapaWZVSter06CJMf2kHi8PIswDQYJKoZIhvcNAQEL
-BQAwgasxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQH
-DA1Nb3VudGFpbiBWaWV3MRAwDgYDVQQKDAdBbmRyb2lkMRAwDgYDVQQLDAdBbmRy
-b2lkMScwJQYDVQQDDB5jb20uYW5kcm9pZC5ibHVldG9vdGguc2VydmljZXMxIjAg
-BgkqhkiG9w0BCQEWE2FuZHJvaWRAYW5kcm9pZC5jb20wIBcNMjIwMzE1MDAzNjAz
-WhgPNDc2MDAyMDkwMDM2MDNaMIGrMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2Fs
-aWZvcm5pYTEWMBQGA1UEBwwNTW91bnRha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ARVq7qhoY+xzSc
-1I/Tzf6vG6aHBC+CcIoSM2oqr6TGH+ADHAY6jhu/qzv1ij3gtoInAkBtkWvYsCIV
-eISPj8Qomcd8EIeW77p+ArKzS4HY5m1c/O4D/5rkl6c0exFq4Pdw9V8xyM98QtLd
-oj4xzzXUTPOIwkROHkj8otcML28m/MC0l/4b+flHnPqKFuLBjhxi9b/ZfwaXfjkx
-TcXpM3nPH8zN7kaJpS1fPW1IJyxJYvT022uK+afpezTmyS/50aOncUGjDJRw8CcO
-B88O8lpizDD3tD7P6jVOpRRJS4SnkVErbIn1xdWER6ubhnnycH7UmDVIx+vNd/t6
-YDa377au8Za+LnbDPfV1+Og+RaJSEIjJgfYyqnjBxGdRGN21VbqJdRzo/eO4ZFd2
-mGVtMosVr0jw4O8r60o9oMMWBTbFpxOI929QdcV+X1Lz8A8BZz0faXfZ2Z9usctu
-W2FtZge3tsJ07z7kuhNdbnm2yQVfd0FqiJsapUjlhgcdFVoDWPuqOfWAoG31ble6
-eiNnxfjiCckPWyciIE6lw97nvavGjlUacH5qVG86hOWU7xyBgeQ0PH4e+Nxr50yU
-A0GMxni1gefZFG8qEPdNRuDT1QdqDGh/8Ea11GEUMXdAxk0UzqyAtLDr6MbwK6lV
-mqmeueFdogdjvQ3mXe94
------END CERTIFICATE-----
diff --git a/android/app/certs/key.pem b/android/app/certs/key.pem
deleted file mode 100644
index 5f7d1bc..0000000
--- a/android/app/certs/key.pem
+++ /dev/null
@@ -1,52 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQCxWWr2mjNREQaV
-vy7xjQB9jA+zk65q83H8SxfTdpOOYBdR9I4wB7CrNRcMhGPDxRC85bre61pnSCj2
-iwM/M19UR+2YbFb8BQL4dYZosNB8Jg7d+Jw885LvGkSEZkRE1ueG+HmpfQ0G3qYn
-KCx+k6ZE9OFuLoiDYGvGHV6pVipGROOE0UoPqAJ3U90yZRIXzzERhp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MM+3wDxdf5DAOqv8MInL0SjuwYFUcK3Lm1KYkj0P+4u0nDwk6y
-gafPv4J1MpcqKLU/rdrDNwn6os9ez8KxI9eCPjbfQX/ARQD2ejTuSJBelf240u/w
-LEU+DluKBGR+eZrZV9UvBwjbXCe/5Cz2bvQXiFRpAoIBAACbgjE5+mJaf6PbIG2I
-+jBE54D2TDPceo03Ujmc6uuHaEZcT8meTfx3QDhR3SUC8qFBfyL0kMhtWKUrnRTR
-ZWgdMjQ6KosfKSkf89EozwXZ2UY+hzW+w+5HVuNfhB/mL4tmvrKo3teMfgDcZekc
-gTFhWw/chsyhplafgiD/t3JaYyOOepM5XL8GOPab7M8xzbnMeXDFRHy28eoYdLzY
-/YpjlHxvJC101mDaquyQEqr8ye2ehy02rSV940WkJjWqiSzNvAr5DHt3EnQ/8p2n
-lv601GEBY2RUhGaOWmcfWtWKAFJB0SXaen7lTCkL3lnIIv65mxNDdQBXsahg5B/f
-50UCggEALYTJLCNlGo8JcEos/UfJ0wYZoQL8jv2mem/x8P0G/0YLRam4NlNiwJyx
-SP2gSuSiSh8XudlFjAm6/cencriVcvpIXFpEjrqhW99cB1WnLTH/KgNSwrcbwKUe
-TkdUx0nDzpwNlBcxFWZONMM2PIbw1vsHgxmMVJUkWFjalCjspgMPYD3+aQ38Cm4r
-ijMF6HOfo8pPq0GTlNy6mI9YsLPsp3H16YkTTSWjE9R7cIde3H8WmTnVnUTH4K8R
-KjtGoLgVf02wncdxGmWNcvPLfRkin+r9V4fp2b06evB2Gq07vxcDzky3P1Hgyixj
-MGM6YXLym/x1WxR7mOQvAwpSJ093EA==
------END PRIVATE KEY-----
diff --git a/android/app/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java b/android/app/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java
index 0b1c16b..a0d83c9 100644
--- a/android/app/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java
+++ b/android/app/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java
@@ -24,6 +24,7 @@
import android.content.res.Resources;
import android.content.res.Resources.NotFoundException;
import android.media.AudioManager;
+import android.os.SystemProperties;
import android.util.Log;
import com.android.bluetooth.R;
@@ -189,7 +190,9 @@
int value;
try {
- value = resources.getInteger(R.integer.a2dp_source_codec_priority_sbc);
+ value = SystemProperties.getInt(
+ "bluetooth.a2dp.source.sbc_priority.config",
+ resources.getInteger(R.integer.a2dp_source_codec_priority_sbc));
} catch (NotFoundException e) {
value = BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT;
}
@@ -199,7 +202,9 @@
}
try {
- value = resources.getInteger(R.integer.a2dp_source_codec_priority_aac);
+ value = SystemProperties.getInt(
+ "bluetooth.a2dp.source.aac_priority.config",
+ resources.getInteger(R.integer.a2dp_source_codec_priority_aac));
} catch (NotFoundException e) {
value = BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT;
}
@@ -209,7 +214,9 @@
}
try {
- value = resources.getInteger(R.integer.a2dp_source_codec_priority_aptx);
+ value = SystemProperties.getInt(
+ "bluetooth.a2dp.source.aptx_priority.config",
+ resources.getInteger(R.integer.a2dp_source_codec_priority_aptx));
} catch (NotFoundException e) {
value = BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT;
}
@@ -219,7 +226,9 @@
}
try {
- value = resources.getInteger(R.integer.a2dp_source_codec_priority_aptx_hd);
+ value = SystemProperties.getInt(
+ "bluetooth.a2dp.source.aptx_hd_priority.config",
+ resources.getInteger(R.integer.a2dp_source_codec_priority_aptx_hd));
} catch (NotFoundException e) {
value = BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT;
}
@@ -229,7 +238,9 @@
}
try {
- value = resources.getInteger(R.integer.a2dp_source_codec_priority_ldac);
+ value = SystemProperties.getInt(
+ "bluetooth.a2dp.source.ldac_priority.config",
+ resources.getInteger(R.integer.a2dp_source_codec_priority_ldac));
} catch (NotFoundException e) {
value = BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT;
}
@@ -239,7 +250,9 @@
}
try {
- value = resources.getInteger(R.integer.a2dp_source_codec_priority_lc3);
+ value = SystemProperties.getInt(
+ "bluetooth.a2dp.source.lc3_priority.config",
+ resources.getInteger(R.integer.a2dp_source_codec_priority_lc3));
} catch (NotFoundException e) {
value = BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT;
}
diff --git a/framework/tests/stress/Android.bp b/framework/tests/stress/Android.bp
index f176be0..dea516e 100644
--- a/framework/tests/stress/Android.bp
+++ b/framework/tests/stress/Android.bp
@@ -28,5 +28,5 @@
test_suites: [
"general-tests",
],
- certificate: ":com.android.bluetooth.certificate",
+ certificate: "bluetooth",
}
diff --git a/service/tests/Android.bp b/service/tests/Android.bp
index 5225038..4848480 100644
--- a/service/tests/Android.bp
+++ b/service/tests/Android.bp
@@ -59,7 +59,7 @@
"libbluetooth_jni",
],
compile_multilib: "both",
- certificate: ":com.android.bluetooth.certificate",
+ certificate: "bluetooth",
min_sdk_version: "current",
diff --git a/system/audio_hal_interface/aidl/codec_status_aidl.cc b/system/audio_hal_interface/aidl/codec_status_aidl.cc
index ec62ed7..b8ba70e 100644
--- a/system/audio_hal_interface/aidl/codec_status_aidl.cc
+++ b/system/audio_hal_interface/aidl/codec_status_aidl.cc
@@ -541,6 +541,11 @@
case BTAV_A2DP_CODEC_INDEX_SOURCE_LDAC:
codec_type_set.insert(CodecType::LDAC);
break;
+ case BTAV_A2DP_CODEC_INDEX_SOURCE_LC3:
+ LOG(WARNING) << __func__
+ << ": Ignore source codec_type=" << preference.codec_type
+ << ", not implemented";
+ break;
case BTAV_A2DP_CODEC_INDEX_SOURCE_OPUS:
codec_type_set.insert(CodecType::OPUS);
break;
@@ -549,6 +554,8 @@
case BTAV_A2DP_CODEC_INDEX_SINK_AAC:
[[fallthrough]];
case BTAV_A2DP_CODEC_INDEX_SINK_LDAC:
+ [[fallthrough]];
+ case BTAV_A2DP_CODEC_INDEX_SINK_OPUS:
LOG(WARNING) << __func__
<< ": Ignore sink codec_type=" << preference.codec_type;
break;
diff --git a/system/gd/hci/controller.cc b/system/gd/hci/controller.cc
index 9dac2b6..18f8813 100644
--- a/system/gd/hci/controller.cc
+++ b/system/gd/hci/controller.cc
@@ -547,8 +547,18 @@
void le_set_event_mask(uint64_t le_event_mask) {
std::unique_ptr<LeSetEventMaskBuilder> packet = LeSetEventMaskBuilder::Create(le_event_mask);
- hci_->EnqueueCommand(std::move(packet), module_.GetHandler()->BindOnceOn(
- this, &Controller::impl::check_status<LeSetEventMaskCompleteView>));
+ hci_->EnqueueCommand(
+ std::move(packet), module_.GetHandler()->BindOnceOn(this, &Controller::impl::check_le_set_event_mask_status));
+ }
+
+ void check_le_set_event_mask_status(CommandCompleteView view) {
+ ASSERT(view.IsValid());
+ auto status_view = LeSetEventMaskCompleteView::Create(view);
+ ASSERT(status_view.IsValid());
+ auto status = status_view.GetStatus();
+ if (status != ErrorCode::SUCCESS) {
+ LOG_WARN("Unexpected return status %s", ErrorCodeText(status).c_str());
+ }
}
template <class T>
diff --git a/system/gd/hci/hci_layer.cc b/system/gd/hci/hci_layer.cc
index 5def729..9c23529 100644
--- a/system/gd/hci/hci_layer.cc
+++ b/system/gd/hci/hci_layer.cc
@@ -195,14 +195,13 @@
EventView::Create(PacketView<kLittleEndian>(std::make_shared<std::vector<uint8_t>>(std::vector<uint8_t>()))));
command_queue_.front().GetCallback<CommandCompleteView>()->Invoke(move(command_complete_view));
} else {
- ASSERT_LOG(
- command_queue_.front().waiting_for_status_ == is_status,
- "0x%02hx (%s) was not expecting %s event",
- op_code,
- OpCodeText(op_code).c_str(),
- logging_id.c_str());
-
- command_queue_.front().GetCallback<TResponse>()->Invoke(move(response_view));
+ if (command_queue_.front().waiting_for_status_ == is_status) {
+ command_queue_.front().GetCallback<TResponse>()->Invoke(move(response_view));
+ } else {
+ CommandCompleteView command_complete_view = CommandCompleteView::Create(
+ EventView::Create(PacketView<kLittleEndian>(std::make_shared<std::vector<uint8_t>>(std::vector<uint8_t>()))));
+ command_queue_.front().GetCallback<CommandCompleteView>()->Invoke(move(command_complete_view));
+ }
}
command_queue_.pop_front();
diff --git a/system/gd/hci/le_scanning_manager.cc b/system/gd/hci/le_scanning_manager.cc
index 4b1ccf5..d48c900 100644
--- a/system/gd/hci/le_scanning_manager.cc
+++ b/system/gd/hci/le_scanning_manager.cc
@@ -28,6 +28,7 @@
#include "module.h"
#include "os/handler.h"
#include "os/log.h"
+#include "os/system_properties.h"
#include "storage/storage_module.h"
namespace bluetooth {
@@ -48,6 +49,9 @@
constexpr uint8_t kLegacyBit = 4;
constexpr uint8_t kDataStatusBits = 5;
+bool kDisableApcfExtendedFeatures = false;
+static const std::string kPropertyDisableApcfExtendedFeatures = "bluetooth.le.disable_apcf_extended_features";
+
const ModuleFactory LeScanningManager::Factory = ModuleFactory([]() { return new LeScanningManager(); });
enum class ScanApiType {
@@ -260,7 +264,9 @@
api_type_ = ScanApiType::LEGACY;
}
is_filter_supported_ = controller_->IsSupported(OpCode::LE_ADV_FILTER);
- if (is_filter_supported_) {
+ if (os::GetSystemProperty(kPropertyDisableApcfExtendedFeatures) == "1")
+ kDisableApcfExtendedFeatures = true;
+ if (is_filter_supported_ && !kDisableApcfExtendedFeatures) {
le_scanning_interface_->EnqueueCommand(
LeAdvFilterReadExtendedFeaturesBuilder::Create(),
module_handler_->BindOnceOn(this, &impl::on_apcf_read_extended_features_complete));
diff --git a/system/hci/include/hci_layer.h b/system/hci/include/hci_layer.h
index 74ffc5c..cda330b 100644
--- a/system/hci/include/hci_layer.h
+++ b/system/hci/include/hci_layer.h
@@ -21,34 +21,12 @@
#include <base/callback.h>
#include <base/location.h>
+#include "hci/include/hci_layer_legacy.h"
#include "osi/include/future.h"
#include "osi/include/osi.h" // INVALID_FD
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_types.h"
-///// LEGACY DEFINITIONS /////
-
-/* Message event mask across Host/Controller lib and stack */
-#define MSG_EVT_MASK 0xFF00 /* eq. BT_EVT_MASK */
-#define MSG_SUB_EVT_MASK 0x00FF /* eq. BT_SUB_EVT_MASK */
-
-/* Message event ID passed from Host/Controller lib to stack */
-#define MSG_HC_TO_STACK_HCI_ACL 0x1100 /* eq. BT_EVT_TO_BTU_HCI_ACL */
-#define MSG_HC_TO_STACK_HCI_SCO 0x1200 /* eq. BT_EVT_TO_BTU_HCI_SCO */
-#define MSG_HC_TO_STACK_HCI_ERR 0x1300 /* eq. BT_EVT_TO_BTU_HCIT_ERR */
-#define MSG_HC_TO_STACK_HCI_ISO 0x1700 /* eq. BT_EVT_TO_BTU_HCI_ISO */
-#define MSG_HC_TO_STACK_HCI_EVT 0x1000 /* eq. BT_EVT_TO_BTU_HCI_EVT */
-
-/* Message event ID passed from stack to vendor lib */
-#define MSG_STACK_TO_HC_HCI_ACL 0x2100 /* eq. BT_EVT_TO_LM_HCI_ACL */
-#define MSG_STACK_TO_HC_HCI_SCO 0x2200 /* eq. BT_EVT_TO_LM_HCI_SCO */
-#define MSG_STACK_TO_HC_HCI_ISO 0x2d00 /* eq. BT_EVT_TO_LM_HCI_ISO */
-#define MSG_STACK_TO_HC_HCI_CMD 0x2000 /* eq. BT_EVT_TO_LM_HCI_CMD */
-
-/* Local Bluetooth Controller ID for BR/EDR */
-#define LOCAL_BR_EDR_CONTROLLER_ID 0
-
-///// END LEGACY DEFINITIONS /////
typedef struct packet_fragmenter_t packet_fragmenter_t;
typedef uint16_t command_opcode_t;
diff --git a/system/hci/include/hci_layer_legacy.h b/system/hci/include/hci_layer_legacy.h
new file mode 100644
index 0000000..f4dfc41
--- /dev/null
+++ b/system/hci/include/hci_layer_legacy.h
@@ -0,0 +1,43 @@
+/******************************************************************************
+ *
+ * Copyright 2014 Google, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************/
+
+#pragma once
+
+///// LEGACY DEFINITIONS /////
+
+/* Message event mask across Host/Controller lib and stack */
+#define MSG_EVT_MASK 0xFF00 /* eq. BT_EVT_MASK */
+#define MSG_SUB_EVT_MASK 0x00FF /* eq. BT_SUB_EVT_MASK */
+
+/* Message event ID passed from Host/Controller lib to stack */
+#define MSG_HC_TO_STACK_HCI_ACL 0x1100 /* eq. BT_EVT_TO_BTU_HCI_ACL */
+#define MSG_HC_TO_STACK_HCI_SCO 0x1200 /* eq. BT_EVT_TO_BTU_HCI_SCO */
+#define MSG_HC_TO_STACK_HCI_ERR 0x1300 /* eq. BT_EVT_TO_BTU_HCIT_ERR */
+#define MSG_HC_TO_STACK_HCI_ISO 0x1700 /* eq. BT_EVT_TO_BTU_HCI_ISO */
+#define MSG_HC_TO_STACK_HCI_EVT 0x1000 /* eq. BT_EVT_TO_BTU_HCI_EVT */
+
+/* Message event ID passed from stack to vendor lib */
+#define MSG_STACK_TO_HC_HCI_ACL 0x2100 /* eq. BT_EVT_TO_LM_HCI_ACL */
+#define MSG_STACK_TO_HC_HCI_SCO 0x2200 /* eq. BT_EVT_TO_LM_HCI_SCO */
+#define MSG_STACK_TO_HC_HCI_ISO 0x2d00 /* eq. BT_EVT_TO_LM_HCI_ISO */
+#define MSG_STACK_TO_HC_HCI_CMD 0x2000 /* eq. BT_EVT_TO_LM_HCI_CMD */
+
+/* Local Bluetooth Controller ID for BR/EDR */
+#define LOCAL_BR_EDR_CONTROLLER_ID 0
+
+///// END LEGACY DEFINITIONS /////
diff --git a/system/stack/btm/btm_sco.cc b/system/stack/btm/btm_sco.cc
index 9c5c41f..99701d6 100644
--- a/system/stack/btm/btm_sco.cc
+++ b/system/stack/btm/btm_sco.cc
@@ -33,6 +33,7 @@
#include "osi/include/allocator.h"
#include "osi/include/log.h"
#include "osi/include/osi.h"
+#include "osi/include/properties.h"
#include "stack/btm/btm_sec.h"
#include "stack/btm/security_device_record.h"
#include "stack/include/acl_api.h"
@@ -45,6 +46,13 @@
extern tBTM_CB btm_cb;
+/* Default to allow enhanced connections where supported. */
+constexpr bool kDefaultDisableEnhancedConnection = false;
+
+/* Sysprops for SCO connection. */
+static const char kPropertyDisableEnhancedConnection[] =
+ "bluetooth.sco.disable_enhanced_connection";
+
namespace {
constexpr char kBtmLogTag[] = "SCO";
@@ -140,7 +148,9 @@
}
/* Use Enhanced Synchronous commands if supported */
if (controller_get_interface()
- ->supports_enhanced_setup_synchronous_connection()) {
+ ->supports_enhanced_setup_synchronous_connection() &&
+ !osi_property_get_bool(kPropertyDisableEnhancedConnection,
+ kDefaultDisableEnhancedConnection)) {
/* Use the saved SCO routing */
p_setup->input_data_path = p_setup->output_data_path = ESCO_DATA_PATH;
@@ -341,7 +351,9 @@
/* Use Enhanced Synchronous commands if supported */
if (controller_get_interface()
- ->supports_enhanced_setup_synchronous_connection()) {
+ ->supports_enhanced_setup_synchronous_connection() &&
+ !osi_property_get_bool(kPropertyDisableEnhancedConnection,
+ kDefaultDisableEnhancedConnection)) {
LOG_INFO("Sending enhanced SCO connect request over handle:0x%04x",
acl_handle);
/* Use the saved SCO routing */
@@ -1174,7 +1186,9 @@
/* Use Enhanced Synchronous commands if supported */
if (controller_get_interface()
- ->supports_enhanced_setup_synchronous_connection()) {
+ ->supports_enhanced_setup_synchronous_connection() &&
+ !osi_property_get_bool(kPropertyDisableEnhancedConnection,
+ kDefaultDisableEnhancedConnection)) {
/* Use the saved SCO routing */
p_setup->input_data_path = p_setup->output_data_path = ESCO_DATA_PATH;