OSDN Git Service

btaa: new include files in bt stack for BTAA interface
authorMichael Sun <michaelfsun@google.com>
Mon, 2 Nov 2020 07:17:15 +0000 (07:17 +0000)
committerMichael Sun <michaelfsun@google.com>
Fri, 6 Nov 2020 05:17:54 +0000 (05:17 +0000)
Add new includes files for JNI and btif interfaces development of
activity attribution (BTAA). This change only defines the skeleton of
BTAA interface and its callback structures, more implementation will
follow.

Tag: #feature
Bug: 172501038
Test: m
Change-Id: I1ae48561ec6ce91ed5df1aba6a8d72fe737a7ef0

include/hardware/bluetooth.h
include/hardware/bt_activity_attribution.h [new file with mode: 0644]

index 3091f31..88b3253 100644 (file)
@@ -49,6 +49,7 @@
 #define BT_PROFILE_AV_RC_CTRL_ID "avrcp_ctrl"
 #define BT_PROFILE_HEARING_AID_ID "hearing_aid"
 #define BT_KEYSTORE_ID "bluetooth_keystore"
+#define BT_ACTIVITY_ATTRIBUTION_ID "activity_attribution"
 
 /** Bluetooth Device Name */
 typedef struct { uint8_t name[249]; } __attribute__((packed)) bt_bdname_t;
diff --git a/include/hardware/bt_activity_attribution.h b/include/hardware/bt_activity_attribution.h
new file mode 100644 (file)
index 0000000..e0572a0
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+#ifndef ANDROID_INCLUDE_BT_ACTIVITY_ATTRIBUTION_H
+#define ANDROID_INCLUDE_BT_ACTIVITY_ATTRIBUTION_H
+
+#include "raw_address.h"
+
+namespace bluetooth {
+namespace activity_attribution {
+
+enum class Activity { UNKNOWN = 0, ADVERTISE, CONNECT, SCAN };
+
+class ActivityAttributionCallbacks {
+ public:
+  virtual ~ActivityAttributionCallbacks() = default;
+
+  /** Callback when Blutooth woke up the system */
+  virtual void OnWakeup(Activity activity, const RawAddress& address) = 0;
+};
+
+class ActivityAttributionInterface {
+ public:
+  virtual ~ActivityAttributionInterface() = default;
+
+  /** Register the Activity Attribution callbacks */
+  virtual void Init(ActivityAttributionCallbacks* callbacks) = 0;
+
+  /** Closes the interface. */
+  virtual void Cleanup(void) = 0;
+};
+
+}  // namespace activity_attribution
+}  // namespace bluetooth
+
+#endif /* ANDROID_INCLUDE_BT_ACTIVITY_ATTRIBUTION_H */