"android/bluetooth/IBluetoothA2dp.aidl",
"android/bluetooth/IBluetoothA2dpSink.aidl",
"android/bluetooth/IBluetoothAvrcpController.aidl",
+ "android/bluetooth/IBluetoothAvrcpTarget.aidl",
"android/bluetooth/IBluetoothCallback.aidl",
"android/bluetooth/IBluetoothProfileServiceConnection.aidl",
"android/bluetooth/IBluetoothHeadset.aidl",
"android/bluetooth/IBluetoothA2dp.aidl",
"android/bluetooth/IBluetoothA2dpSink.aidl",
"android/bluetooth/IBluetoothAvrcpController.aidl",
+ "android/bluetooth/IBluetoothAvrcpTarget.aidl",
"android/bluetooth/IBluetoothCallback.aidl",
"android/bluetooth/IBluetoothProfileServiceConnection.aidl",
"android/bluetooth/IBluetoothHeadset.aidl",
--- /dev/null
+/*
+ * Copyright 2018 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package android.bluetooth;
+
+/**
+ * API for Bluetooth AVRCP Target Interface
+ *
+ * @hide
+ */
+interface IBluetoothAvrcpTarget {
+ /**
+ * @hide
+ */
+ void sendVolumeChanged(in int volume);
+}
"system/bt",
"system/bt/bta/include",
"system/bt/btcore/include",
+ "system/bt/btif/avrcp",
"system/bt/hci/include",
"system/bt/internal_include",
"system/bt/stack/include",
"sys/bta_sys_main.cc",
"sys/utl.cc",
],
-
+ static_libs: [
+ "avrcp-target-service",
+ "lib-bt-packets",
+ ],
whole_static_libs: [
"libaudio-hearing-aid-hw-utils",
],
#include "a2dp_sbc.h"
#include "avdt_api.h"
+#include "avrcp_service.h"
#include "bt_utils.h"
#include "bta_av_int.h"
#include "btif/include/btif_av_co.h"
}
} else {
/* use main SM for AVRC SDP activities */
- bta_av_rc_disc((uint8_t)(p_scb->hdi + 1));
+ if (is_new_avrcp_enabled()) {
+ APPL_TRACE_WARNING("%s: Using the new AVRCP Profile", __func__);
+ bluetooth::avrcp::AvrcpService::Get()->ConnectDevice(p_scb->peer_addr);
+ } else {
+ bta_av_rc_disc((uint8_t)(p_scb->hdi + 1));
+ }
}
} else {
if (BTA_AV_RC_HANDLE_NONE != p_scb->rc_handle) {
#include <string.h>
#include "avdt_api.h"
+#include "avrcp_service.h"
#include "bta_av_api.h"
#include "bta_av_int.h"
#include "l2c_api.h"
******************************************************************************/
uint8_t bta_av_rc_create(tBTA_AV_CB* p_cb, uint8_t role, uint8_t shdl,
uint8_t lidx) {
+ if (is_new_avrcp_enabled()) {
+ APPL_TRACE_WARNING("%s: Skipping RC creation for the old AVRCP profile",
+ __func__);
+ return BTA_AV_RC_HANDLE_NONE;
+ }
+
tAVRC_CONN_CB ccb;
RawAddress bda = RawAddress::kAny;
uint8_t status = BTA_AV_RC_ROLE_ACP;
#include "avrcp.h"
#include "connection_handler.h"
+#include "osi/include/properties.h"
#include "raw_address.h"
namespace bluetooth {
};
} // namespace avrcp
-} // namespace bluetooth
\ No newline at end of file
+} // namespace bluetooth
+
+inline bool is_new_avrcp_enabled() {
+ return osi_property_get_bool("persist.bluetooth.enablenewavrcp", false);
+}
\ No newline at end of file
uint16_t result,
const RawAddress* peer_addr) {
DCHECK(!connection_cb_.is_null());
- CHECK(peer_addr != nullptr); // FIXME: Maybe this should change? I'm not
- // totally when this can be null.
LOG(INFO) << __PRETTY_FUNCTION__ << ": handle=" << loghex(handle)
<< " result=" << loghex(result)
<< "Connection Close received from device that doesn't exist";
return;
}
- feature_map_.erase(*peer_addr);
+ feature_map_.erase(device_map_[handle]->GetAddress());
device_map_[handle]->DeviceDisconnected();
device_map_.erase(handle);
} break;
uint16_t result,
const RawAddress* peer_addr) {
DCHECK(!connection_cb_.is_null());
- CHECK(peer_addr != nullptr); // FIXME: Maybe this should change? I'm not
- // totally when this can be null.
LOG(INFO) << __PRETTY_FUNCTION__ << ": handle=" << loghex(handle)
<< " result=" << loghex(result)
<< "Connection Close received from device that doesn't exist";
return;
}
- feature_map_.erase(*peer_addr);
+ feature_map_.erase(device_map_[handle]->GetAddress());
device_map_[handle]->DeviceDisconnected();
device_map_.erase(handle);
} break;