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

Commit 9a1dd276 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by android-build-merger
Browse files

bluetoothtbd common library reconfiguration

am: f2dda050

Change-Id: I98a21c91355737f09c348f90098640870b507699
parents 74102a6d f2dda050
Loading
Loading
Loading
Loading
+33 −85
Original line number Original line Diff line number Diff line
subdirs = [
    "common",
]

cc_defaults {
cc_defaults {
    name: "fluoride_service_defaults",
    name: "fluoride_service_defaults",
    defaults: ["fluoride_defaults"],
    defaults: ["fluoride_defaults"],
    local_include_dirs: [
        "common"
    ],
    include_dirs: [
    include_dirs: [
        "packages/modules/Bluetooth/system"
        "packages/modules/Bluetooth/system",
    ],
    ],
    srcs: [
        "common/bluetooth/adapter_state.cc",
        "common/bluetooth/advertise_data.cc",
        "common/bluetooth/advertise_settings.cc",
        "common/bluetooth/descriptor.cc",
        "common/bluetooth/characteristic.cc",
        "common/bluetooth/scan_filter.cc",
        "common/bluetooth/scan_result.cc",
        "common/bluetooth/scan_settings.cc",
        "common/bluetooth/service.cc",
        "common/bluetooth/util/address_helper.cc",
        "common/bluetooth/util/atomic_string.cc",
        "common/bluetooth/uuid.cc",
    ]
}
}


// Source variables
// Source variables
// ========================================================
// ========================================================
btserviceCommonBinderSrc = [
    "common/android/bluetooth/IBluetooth.aidl",
    "common/android/bluetooth/IBluetoothCallback.aidl",
    "common/android/bluetooth/IBluetoothGattClient.aidl",
    "common/android/bluetooth/IBluetoothGattClientCallback.aidl",
    "common/android/bluetooth/IBluetoothGattServer.aidl",
    "common/android/bluetooth/IBluetoothGattServerCallback.aidl",
    "common/android/bluetooth/IBluetoothLeAdvertiser.aidl",
    "common/android/bluetooth/IBluetoothLeAdvertiserCallback.aidl",
    "common/android/bluetooth/IBluetoothLeScanner.aidl",
    "common/android/bluetooth/IBluetoothLeScannerCallback.aidl",
    "common/android/bluetooth/IBluetoothLowEnergy.aidl",
    "common/android/bluetooth/IBluetoothLowEnergyCallback.aidl",
    "common/android/bluetooth/advertise_data.cc",
    "common/android/bluetooth/advertise_settings.cc",
    "common/android/bluetooth/bluetooth_gatt_characteristic.cc",
    "common/android/bluetooth/bluetooth_gatt_descriptor.cc",
    "common/android/bluetooth/bluetooth_gatt_included_service.cc",
    "common/android/bluetooth/bluetooth_gatt_service.cc",
    "common/android/bluetooth/scan_filter.cc",
    "common/android/bluetooth/scan_result.cc",
    "common/android/bluetooth/scan_settings.cc",
    "common/android/bluetooth/uuid.cc",
]

btserviceCommonAidlInclude = [
    "packages/modules/Bluetooth/system/service/common",
    "frameworks/native/aidl/binder",
]

btserviceDaemonSrc = [
btserviceDaemonSrc = [
    "adapter.cc",
    "adapter.cc",
    "daemon.cc",
    "daemon.cc",
@@ -77,7 +34,7 @@ btserviceLinuxSrc = [
    "ipc/linux_ipc_host.cc",
    "ipc/linux_ipc_host.cc",
]
]


btserviceBinderDaemonImplSrc = [
btserviceBinderDaemonSrc = [
    "ipc/binder/bluetooth_binder_server.cc",
    "ipc/binder/bluetooth_binder_server.cc",
    "ipc/binder/bluetooth_gatt_client_binder_server.cc",
    "ipc/binder/bluetooth_gatt_client_binder_server.cc",
    "ipc/binder/bluetooth_gatt_server_binder_server.cc",
    "ipc/binder/bluetooth_gatt_server_binder_server.cc",
@@ -88,8 +45,6 @@ btserviceBinderDaemonImplSrc = [
    "ipc/binder/ipc_handler_binder.cc",
    "ipc/binder/ipc_handler_binder.cc",
]
]


btserviceBinderDaemonSrc = btserviceCommonBinderSrc + btserviceBinderDaemonImplSrc

// Main unit test sources. These get built for host and target.
// Main unit test sources. These get built for host and target.
// ========================================================
// ========================================================
btserviceBaseTestSrc = [
btserviceBaseTestSrc = [
@@ -113,15 +68,15 @@ btserviceBaseTestSrc = [
cc_binary {
cc_binary {
    name: "bluetoothtbd",
    name: "bluetoothtbd",
    defaults: ["fluoride_service_defaults"],
    defaults: ["fluoride_service_defaults"],
    srcs: btserviceBinderDaemonSrc
    srcs: btserviceBinderDaemonSrc +
        + btserviceLinuxSrc
    btserviceLinuxSrc +
        + btserviceDaemonSrc
    btserviceDaemonSrc +
        + ["main.cc"],
    ["main.cc"],
    aidl: {
        include_dirs: btserviceCommonAidlInclude
    },
    required: ["bluetooth.default"],
    required: ["bluetooth.default"],
    static_libs: ["libbtcore"],
    static_libs: [
        "libbluetooth-binder-common",
        "libbtcore",
    ],
    shared_libs: [
    shared_libs: [
        "libbinder",
        "libbinder",
        "libcutils",
        "libcutils",
@@ -139,14 +94,18 @@ cc_test {
    name: "bluetoothtbd_test",
    name: "bluetoothtbd_test",
    test_suites: ["device-tests"],
    test_suites: ["device-tests"],
    defaults: ["fluoride_service_defaults"],
    defaults: ["fluoride_service_defaults"],
    srcs: btserviceBaseTestSrc
    srcs: btserviceBaseTestSrc +
        + btserviceDaemonSrc + [
    btserviceDaemonSrc + [
        "test/main.cc"
        "test/main.cc",
    ],
    ],
    aidl: {
    aidl: {
        include_dirs: btserviceCommonAidlInclude,
        include_dirs: [
            "packages/modules/Bluetooth/system/service/common",
            "frameworks/native/aidl/binder",
        ],
    },
    },
    static_libs: [
    static_libs: [
        "libbluetooth-common",
        "libgmock",
        "libgmock",
        "liblog",
        "liblog",
    ],
    ],
@@ -159,6 +118,9 @@ cc_test {
                "test/parcelable_unittest.cc",
                "test/parcelable_unittest.cc",
                "test/ParcelableTest.aidl",
                "test/ParcelableTest.aidl",
            ],
            ],
            static_libs: [
                "libbluetooth-binder-common",
            ],
            shared_libs: [
            shared_libs: [
                "libbinder",
                "libbinder",
                "libutils",
                "libutils",
@@ -184,31 +146,15 @@ cc_test {
    },
    },
}
}


// Client library for interacting with Bluetooth daemon
// This is a static library for target.
// ========================================================
cc_library_static {
    name: "libbluetooth-client",
    defaults: ["fluoride_service_defaults"],
    srcs: btserviceCommonBinderSrc,
    aidl: {
        export_aidl_headers: true,
        include_dirs: btserviceCommonAidlInclude
    },
    export_include_dirs: ["common"],
    shared_libs: [
        "libbinder",
        "libutils",
    ],
}

// Native system service CLI for target
// Native system service CLI for target
// ========================================================
// ========================================================
cc_binary {
cc_binary {
    name: "bluetooth-cli",
    name: "bluetooth-cli",
    defaults: ["fluoride_defaults"],
    defaults: ["fluoride_defaults"],
    srcs: ["client/main.cc"],
    srcs: ["client/main.cc"],
    static_libs: ["libbluetooth-client"],
    static_libs: [
        "libbluetooth-binder-common",
    ],
    shared_libs: [
    shared_libs: [
        "libbinder",
        "libbinder",
        "libutils",
        "libutils",
@@ -225,7 +171,9 @@ cc_binary {
        "example/heart_rate/heart_rate_server.cc",
        "example/heart_rate/heart_rate_server.cc",
        "example/heart_rate/server_main.cc",
        "example/heart_rate/server_main.cc",
    ],
    ],
    static_libs: ["libbluetooth-client"],
    static_libs: [
        "libbluetooth-binder-common",
    ],
    shared_libs: [
    shared_libs: [
        "libbinder",
        "libbinder",
        "libutils",
        "libutils",
@@ -236,9 +184,9 @@ cc_library_static {
    name: "libbluetoothtbd_hal",
    name: "libbluetoothtbd_hal",
    defaults: ["fluoride_defaults"],
    defaults: ["fluoride_defaults"],
    include_dirs: ["packages/modules/Bluetooth/system"],
    include_dirs: ["packages/modules/Bluetooth/system"],
    srcs = [
    srcs: [
        "hal/bluetooth_gatt_interface.cc",
        "hal/bluetooth_gatt_interface.cc",
        "hal/bluetooth_interface.cc",
        "hal/bluetooth_interface.cc",
        "logging_helpers.cc",
        "logging_helpers.cc",
    ]
    ],
}
}
+76 −0
Original line number Original line Diff line number Diff line
// Bluetooth types
cc_library_static {
    name: "libbluetooth-common",
    defaults: ["fluoride_defaults"],
    cflags: [
        /* we export all classes, so change default visibility, instead of having EXPORT_SYMBOL on each class*/
        "-fvisibility=default",
    ],
    host_supported: true,
    srcs: [
        "bluetooth/adapter_state.cc",
        "bluetooth/advertise_data.cc",
        "bluetooth/advertise_settings.cc",
        "bluetooth/characteristic.cc",
        "bluetooth/descriptor.cc",
        "bluetooth/scan_filter.cc",
        "bluetooth/scan_result.cc",
        "bluetooth/scan_settings.cc",
        "bluetooth/service.cc",
        "bluetooth/util/address_helper.cc",
        "bluetooth/util/atomic_string.cc",
        "bluetooth/uuid.cc",
    ],
    export_include_dirs: ["./"],
    include_dirs: ["packages/modules/Bluetooth/system"],
    shared_libs: [
        "libbase",
    ],
}

// Bluetooth Binder shared library
cc_library_static {
    name: "libbluetooth-binder-common",
    defaults: ["fluoride_defaults"],
    cflags: [
        /* we export all classes, so change default visibility, instead of having EXPORT_SYMBOL on each class*/
        "-fvisibility=default",
    ],
    srcs: [
        "android/bluetooth/IBluetooth.aidl",
        "android/bluetooth/IBluetoothCallback.aidl",
        "android/bluetooth/IBluetoothGattClient.aidl",
        "android/bluetooth/IBluetoothGattClientCallback.aidl",
        "android/bluetooth/IBluetoothGattServer.aidl",
        "android/bluetooth/IBluetoothGattServerCallback.aidl",
        "android/bluetooth/IBluetoothLeAdvertiser.aidl",
        "android/bluetooth/IBluetoothLeAdvertiserCallback.aidl",
        "android/bluetooth/IBluetoothLeScanner.aidl",
        "android/bluetooth/IBluetoothLeScannerCallback.aidl",
        "android/bluetooth/IBluetoothLowEnergy.aidl",
        "android/bluetooth/IBluetoothLowEnergyCallback.aidl",
        "android/bluetooth/advertise_data.cc",
        "android/bluetooth/advertise_settings.cc",
        "android/bluetooth/bluetooth_gatt_characteristic.cc",
        "android/bluetooth/bluetooth_gatt_descriptor.cc",
        "android/bluetooth/bluetooth_gatt_included_service.cc",
        "android/bluetooth/bluetooth_gatt_service.cc",
        "android/bluetooth/scan_filter.cc",
        "android/bluetooth/scan_result.cc",
        "android/bluetooth/scan_settings.cc",
        "android/bluetooth/uuid.cc",
    ],
    aidl: {
        export_aidl_headers: true,
        include_dirs: [
            "frameworks/native/aidl/binder",
            "packages/modules/Bluetooth/system/service/common",
        ],
    },
    export_include_dirs: ["./"],
    whole_static_libs: ["libbluetooth-common"],
    shared_libs: [
        "libbase",
        "libbinder",
    ],
}
+0 −6
Original line number Original line Diff line number Diff line
@@ -10,9 +10,3 @@ root path, e.g.:
This is so that client applications that link against the client library have
This is so that client applications that link against the client library have
one common include path exported to them, and our headers can find eachother
one common include path exported to them, and our headers can find eachother
within that.
within that.

It is however OK to include from the package root when including common headers
from source files as these are pre-compiled. For example,
common/bluetooth/adapter_state.cpp should do:

#include "service/common/bluetooth/adapter_state.h"
+1 −1
Original line number Original line Diff line number Diff line
@@ -14,7 +14,7 @@
//  limitations under the License.
//  limitations under the License.
//
//


#include "service/common/android/bluetooth/advertise_data.h"
#include "android/bluetooth/advertise_data.h"


using android::OK;
using android::OK;


+3 −3
Original line number Original line Diff line number Diff line
@@ -14,9 +14,9 @@
//  limitations under the License.
//  limitations under the License.
//
//


#include "service/common/android/bluetooth/bluetooth_gatt_characteristic.h"
#include "android/bluetooth/bluetooth_gatt_characteristic.h"
#include "service/common/android/bluetooth/bluetooth_gatt_descriptor.h"
#include "android/bluetooth/bluetooth_gatt_descriptor.h"
#include "service/common/android/bluetooth/uuid.h"
#include "android/bluetooth/uuid.h"


#include <utils/String16.h>
#include <utils/String16.h>
#include <utils/String8.h>
#include <utils/String8.h>
Loading