OSDN Git Service

btaa: add btaa btif implementation
authorMichael Sun <michaelfsun@google.com>
Mon, 23 Nov 2020 18:54:29 +0000 (18:54 +0000)
committerMichael Sun <michaelfsun@google.com>
Fri, 19 Feb 2021 23:06:06 +0000 (23:06 +0000)
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
btif/include/btif_activity_attribution.h [new file with mode: 0644]
btif/src/bluetooth.cc
btif/src/btif_activity_attribution.cc [new file with mode: 0644]

index 6acd050..916918b 100755 (executable)
@@ -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 (file)
index 0000000..44b5855
--- /dev/null
@@ -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 <hardware/bt_activity_attribution.h>
+
+namespace bluetooth {
+namespace activity_attribution {
+
+ActivityAttributionInterface* get_activity_attribution_instance();
+
+}
+}  // namespace bluetooth
index 33c708f..7439125 100644 (file)
@@ -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 (file)
index 0000000..9f161cc
--- /dev/null
@@ -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