Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c12821c7 authored by Ajay Panicker's avatar Ajay Panicker
Browse files

Implement the JNI layer for the AVRCP Service (2/3)

Allows the AVRCP Service Interface to be retrieved via bt_interface_t.

Bug: 68854188
Test: Compile
Change-Id: I0d9464ea19d3bd382d07134bff057a5515501b95
(cherry picked from commit 66401790c29f13b30c15f035933366f36637df21)
Merged-In: I0d9464ea19d3bd382d07134bff057a5515501b95
parent 1afeb16b
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ btifCommonIncludes = [
    "packages/modules/Bluetooth/system/stack/btm",
    "packages/modules/Bluetooth/system/stack/avdt",
    "packages/modules/Bluetooth/system/udrv/include",
    "packages/modules/Bluetooth/system/btif/avrcp",
    "packages/modules/Bluetooth/system/btif/include",
    "packages/modules/Bluetooth/system/btif/co",
    "packages/modules/Bluetooth/system/hci/include",
@@ -101,12 +102,10 @@ cc_library_static {
        "libhwbinder",
        "libutils",
    ],
    static_libs: [
        "lib-bt-packets",
    ],
    whole_static_libs: [
        "avrcp-target-service",
        "libaudio-a2dp-hw-utils",
        "lib-bt-packets",
    ],
    cflags: ["-DBUILDCFG"],

+6 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@
#include <hardware/bt_sdp.h>
#include <hardware/bt_sock.h>

#include "avrcp_service.h"
#include "bt_utils.h"
#include "bta/include/bta_hf_client_api.h"
#include "btif_a2dp.h"
@@ -422,6 +423,10 @@ static int config_clear(void) {
  return btif_config_clear() ? BT_STATUS_SUCCESS : BT_STATUS_FAIL;
}

static bluetooth::avrcp::ServiceInterface* get_avrcp_service(void) {
  return bluetooth::avrcp::AvrcpService::GetServiceInterface();
}

EXPORT_SYMBOL bt_interface_t bluetoothInterface = {
    sizeof(bluetoothInterface),
    init,
@@ -456,4 +461,5 @@ EXPORT_SYMBOL bt_interface_t bluetoothInterface = {
    config_clear,
    interop_database_clear,
    interop_database_add,
    get_avrcp_service,
};
+9 −1
Original line number Diff line number Diff line
cc_library_headers {
    name: "avrcp_headers",
    defaults: ["libchrome_support_defaults"],
    include_dirs: ["packages/modules/Bluetooth/system/internal_include"],
    export_include_dirs: ["./hardware/avrcp/"],
    header_libs: ["internal_include_headers"],
    export_header_lib_headers: ["internal_include_headers"],

    // We need this in case some file outside of the Bluetooth project includes
    // bluetooth.h but doesn't include libchrome which avrcp.h depends on.
    export_shared_lib_headers: ["libchrome"],

    vendor_available: true,
    host_supported: true,
}

cc_library_headers {
    name: "libbluetooth_headers",
    defaults: ["libchrome_support_defaults"],
    header_libs: [
        "avrcp_headers",
        "libbluetooth-types-header",
    ],
    export_header_lib_headers: [
        "avrcp_headers",
        "libbluetooth-types-header",
    ],

    export_include_dirs: ["./"],
    vendor_available: true,
    host_supported: true,
+0 −1
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@
#include <base/bind.h>

#include "avrcp_common.h"
#include "avrcp_logging_helper.h"
#include "raw_address.h"

namespace bluetooth {
+8 −2
Original line number Diff line number Diff line
@@ -22,8 +22,9 @@
#include <sys/cdefs.h>
#include <sys/types.h>

#include <bluetooth/uuid.h>
#include <raw_address.h>
#include "avrcp/avrcp.h"
#include "bluetooth/uuid.h"
#include "raw_address.h"

/**
 * The Bluetooth Hardware Module ID
@@ -585,6 +586,11 @@ typedef struct {
   */
  void (*interop_database_add)(uint16_t feature, const RawAddress* addr,
                               size_t len);

  /**
   * Get the AvrcpTarget Service interface to interact with the Avrcp Service
   */
  bluetooth::avrcp::ServiceInterface* (*get_avrcp_service)(void);
} bt_interface_t;

#define BLUETOOTH_INTERFACE_STRING "bluetoothInterface"
Loading