From c33a6b3acc707204cfa54027f515bdb35254f51d Mon Sep 17 00:00:00 2001 From: Michael Sun Date: Mon, 23 Nov 2020 18:54:29 +0000 Subject: [PATCH] btaa: add btaa btif implementation Implement the btaa btif layer to connect gd with btif through the shim layer. Tag: #feature Bug: 172501038 Test: m Change-Id: I5a463f854e6b4cd7cfae5f6b8100c62a1b8903d5 --- btif/Android.bp | 1 + btif/include/btif_activity_attribution.h | 25 ++++++++++++++++++++++ btif/src/bluetooth.cc | 3 ++- btif/src/btif_activity_attribution.cc | 36 ++++++++++++++++++++++++++++++++ 4 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 btif/include/btif_activity_attribution.h create mode 100644 btif/src/btif_activity_attribution.cc diff --git a/btif/Android.bp b/btif/Android.bp index 6acd05048..916918b0c 100755 --- a/btif/Android.bp +++ b/btif/Android.bp @@ -58,6 +58,7 @@ cc_library_static { "src/btif_a2dp_control.cc", "src/btif_a2dp_sink.cc", "src/btif_a2dp_source.cc", + "src/btif_activity_attribution.cc", "src/btif_av.cc", "src/btif_avrcp_audio_track.cc", "src/btif_ble_advertiser.cc", diff --git a/btif/include/btif_activity_attribution.h b/btif/include/btif_activity_attribution.h new file mode 100644 index 000000000..44b585575 --- /dev/null +++ b/btif/include/btif_activity_attribution.h @@ -0,0 +1,25 @@ +/* + * Copyright 2020 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. + */ + +#include + +namespace bluetooth { +namespace activity_attribution { + +ActivityAttributionInterface* get_activity_attribution_instance(); + +} +} // namespace bluetooth diff --git a/btif/src/bluetooth.cc b/btif/src/bluetooth.cc index 33c708fbe..7439125f2 100644 --- a/btif/src/bluetooth.cc +++ b/btif/src/bluetooth.cc @@ -50,6 +50,7 @@ #include "bta/include/bta_hf_client_api.h" #include "btif/avrcp/avrcp_service.h" #include "btif_a2dp.h" +#include "btif_activity_attribution.h" #include "btif_api.h" #include "btif_av.h" #include "btif_bqr.h" @@ -437,7 +438,7 @@ static const void* get_profile_interface(const char* profile_id) { return bluetooth::bluetooth_keystore::getBluetoothKeystoreInterface(); if (is_profile(profile_id, BT_ACTIVITY_ATTRIBUTION_ID)) { - return NULL; + return bluetooth::activity_attribution::get_activity_attribution_instance(); } if (is_profile(profile_id, BT_PROFILE_LE_AUDIO_ID)) diff --git a/btif/src/btif_activity_attribution.cc b/btif/src/btif_activity_attribution.cc new file mode 100644 index 000000000..9f161cc91 --- /dev/null +++ b/btif/src/btif_activity_attribution.cc @@ -0,0 +1,36 @@ +/****************************************************************************** + * + * Copyright 2020 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. + * + ******************************************************************************/ + +#define LOG_TAG "bt_btif_activity_attribution" + +#include "btif_activity_attribution.h" +#include "main/shim/activity_attribution.h" +#include "main/shim/shim.h" + +using base::Bind; +using base::Unretained; + +namespace bluetooth { +namespace activity_attribution { + +ActivityAttributionInterface* get_activity_attribution_instance() { + return bluetooth::shim::get_activity_attribution_instance(); +} + +} // namespace activity_attribution +} // namespace bluetooth -- 2.11.0