aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2022-03-30 02:29:26 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-03-30 02:29:26 +0000
commitcb45855478e43c555f234c2d74d70e8458dd5dba (patch)
tree71b8352f781e8d9d3470cd70829ec7a2c20c46e5
parent6cca4fc0a769145ab1a12fd943837548a240d799 (diff)
parent5586bc36adba14aac7fb65eee1193acdfff3a0d4 (diff)
Merge "Add SDP record for UUID_SERVCLASS_AV_REMOTE_CONTROL when AVRCP startup" am: 7105ba09e5 am: 5586bc36ad
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2035903 Change-Id: I1208d06c82f17094c982da2c0133afaf659f4876 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--system/btif/avrcp/avrcp_service.cc10
-rw-r--r--system/btif/avrcp/avrcp_service.h1
-rw-r--r--system/profile/avrcp/avrcp_config.h7
3 files changed, 18 insertions, 0 deletions
diff --git a/system/btif/avrcp/avrcp_service.cc b/system/btif/avrcp/avrcp_service.cc
index 774ab4cf6b..01b0998e43 100644
--- a/system/btif/avrcp/avrcp_service.cc
+++ b/system/btif/avrcp/avrcp_service.cc
@@ -302,6 +302,13 @@ void AvrcpService::Init(MediaInterface* media_interface,
profile_version, 0);
bta_sys_add_uuid(UUID_SERVCLASS_AV_REM_CTRL_TARGET);
+ ct_sdp_record_handle = SDP_CreateRecord();
+
+ avrcp_interface_.AddRecord(UUID_SERVCLASS_AV_REMOTE_CONTROL,
+ "AV Remote Control", NULL, AVRCP_SUPF_TG_CT,
+ ct_sdp_record_handle, false, AVRC_REV_1_3, 0);
+ bta_sys_add_uuid(UUID_SERVCLASS_AV_REMOTE_CONTROL);
+
media_interface_ = new MediaInterfaceWrapper(media_interface);
media_interface->RegisterUpdateCallback(instance_);
@@ -338,6 +345,9 @@ void AvrcpService::Cleanup() {
avrcp_interface_.RemoveRecord(sdp_record_handle);
bta_sys_remove_uuid(UUID_SERVCLASS_AV_REM_CTRL_TARGET);
sdp_record_handle = -1;
+ avrcp_interface_.RemoveRecord(ct_sdp_record_handle);
+ bta_sys_remove_uuid(UUID_SERVCLASS_AV_REMOTE_CONTROL);
+ ct_sdp_record_handle = -1;
connection_handler_->CleanUp();
connection_handler_ = nullptr;
diff --git a/system/btif/avrcp/avrcp_service.h b/system/btif/avrcp/avrcp_service.h
index 067631ecd6..4898bbf547 100644
--- a/system/btif/avrcp/avrcp_service.h
+++ b/system/btif/avrcp/avrcp_service.h
@@ -98,6 +98,7 @@ class AvrcpService : public MediaCallbacks {
static ServiceInterfaceImpl* service_interface_;
uint32_t sdp_record_handle = -1;
+ uint32_t ct_sdp_record_handle = -1;
uint16_t profile_version = -1;
MediaInterface* media_interface_ = nullptr;
diff --git a/system/profile/avrcp/avrcp_config.h b/system/profile/avrcp/avrcp_config.h
index f6a8724431..3f9e74d0e2 100644
--- a/system/profile/avrcp/avrcp_config.h
+++ b/system/profile/avrcp/avrcp_config.h
@@ -50,3 +50,10 @@
#ifndef AVRCP_SUPF_TG
#define AVRCP_SUPF_TG_DEFAULT AVRCP_SUPF_TG_1_4
#endif
+
+/**
+ * Supported Feature for AVRCP tartget control
+ */
+#ifndef AVRCP_SUPF_TG_CT
+#define AVRCP_SUPF_TG_CT AVRC_SUPF_CT_CAT2
+#endif