Home | History | Annotate | Download | only in service
      1 subdirs = [
      2     "common",
      3 ]
      4 
      5 cc_defaults {
      6     name: "fluoride_service_defaults",
      7     defaults: ["fluoride_defaults"],
      8     include_dirs: [
      9         "system/bt",
     10     ],
     11 }
     12 
     13 // Source variables
     14 // ========================================================
     15 btserviceDaemonSrc = [
     16     "adapter.cc",
     17     "daemon.cc",
     18     "gatt_client.cc",
     19     "gatt_server.cc",
     20     "gatt_server_old.cc",
     21     "hal/bluetooth_gatt_interface.cc",
     22     "hal/bluetooth_interface.cc",
     23     "ipc/ipc_handler.cc",
     24     "ipc/ipc_manager.cc",
     25     "logging_helpers.cc",
     26     "low_energy_advertiser.cc",
     27     "low_energy_scanner.cc",
     28     "low_energy_client.cc",
     29     "settings.cc",
     30 ]
     31 
     32 btserviceLinuxSrc = [
     33     "ipc/ipc_handler_linux.cc",
     34     "ipc/linux_ipc_host.cc",
     35 ]
     36 
     37 btserviceBinderDaemonSrc = [
     38     "ipc/binder/bluetooth_binder_server.cc",
     39     "ipc/binder/bluetooth_gatt_client_binder_server.cc",
     40     "ipc/binder/bluetooth_gatt_server_binder_server.cc",
     41     "ipc/binder/bluetooth_le_advertiser_binder_server.cc",
     42     "ipc/binder/bluetooth_le_scanner_binder_server.cc",
     43     "ipc/binder/bluetooth_low_energy_binder_server.cc",
     44     "ipc/binder/interface_with_instances_base.cc",
     45     "ipc/binder/ipc_handler_binder.cc",
     46 ]
     47 
     48 // Main unit test sources. These get built for host and target.
     49 // ========================================================
     50 btserviceBaseTestSrc = [
     51     "hal/fake_bluetooth_gatt_interface.cc",
     52     "hal/fake_bluetooth_interface.cc",
     53     "test/adapter_unittest.cc",
     54     "test/advertise_data_unittest.cc",
     55     "test/fake_hal_util.cc",
     56     "test/gatt_client_unittest.cc",
     57     "test/gatt_server_unittest.cc",
     58     "test/low_energy_advertiser_unittest.cc",
     59     "test/low_energy_client_unittest.cc",
     60     "test/low_energy_scanner_unittest.cc",
     61     "test/settings_unittest.cc",
     62     "test/uuid_unittest.cc",
     63 ]
     64 
     65 // Native system service for target
     66 // ========================================================
     67 cc_binary {
     68     name: "bluetoothtbd",
     69     defaults: ["fluoride_service_defaults"],
     70     srcs: btserviceBinderDaemonSrc +
     71     btserviceLinuxSrc +
     72     btserviceDaemonSrc +
     73     ["main.cc"],
     74     required: ["bluetooth.default"],
     75     static_libs: [
     76         "libbluetooth-binder-common",
     77         "libbtcore",
     78     ],
     79     shared_libs: [
     80         "libbinder",
     81         "libcutils",
     82         "libhardware",
     83         "liblog",
     84         "libutils",
     85     ],
     86     init_rc: ["bluetoothtbd.rc"],
     87 }
     88 
     89 // Native system service unit tests for target and host
     90 
     91 // ========================================================
     92 cc_test {
     93     name: "bluetoothtbd_test",
     94     test_suites: ["device-tests"],
     95     defaults: ["fluoride_service_defaults"],
     96     srcs: btserviceBaseTestSrc +
     97     btserviceDaemonSrc + [
     98         "test/main.cc",
     99     ],
    100     aidl: {
    101         include_dirs: [
    102             "system/bt/service/common",
    103             "frameworks/native/aidl/binder",
    104         ],
    105     },
    106     static_libs: [
    107         "libbluetooth-common",
    108         "libgmock",
    109         "liblog",
    110     ],
    111     host_supported: true,
    112     target: {
    113         // This includes Binder related tests that can only be run
    114         // on target.
    115         android: {
    116             srcs: btserviceBinderDaemonSrc + [
    117                 "test/parcelable_unittest.cc",
    118                 "test/ParcelableTest.aidl",
    119             ],
    120             static_libs: [
    121                 "libbluetooth-binder-common",
    122             ],
    123             shared_libs: [
    124                 "libbinder",
    125                 "libutils",
    126             ],
    127         },
    128         host: {
    129             srcs: [
    130                 "test/stub_ipc_handler_binder.cc",
    131             ],
    132         },
    133         darwin: {
    134             srcs: [
    135                 "test/stub_ipc_handler_linux.cc",
    136             ],
    137         },
    138         linux: {
    139             srcs: btserviceLinuxSrc + [
    140                 // TODO(bcf): Fix this test.
    141                 //"test/ipc_linux_unittest.cc",
    142             ],
    143             host_ldlibs: ["-lrt"],
    144         },
    145     },
    146 }
    147 
    148 // Native system service CLI for target
    149 // ========================================================
    150 cc_binary {
    151     name: "bluetooth-cli",
    152     defaults: ["fluoride_defaults"],
    153     srcs: ["client/main.cc"],
    154     static_libs: [
    155         "libbluetooth-binder-common",
    156     ],
    157     shared_libs: [
    158         "libbinder",
    159         "libutils",
    160     ],
    161 }
    162 
    163 // Heart Rate GATT service example for target
    164 // ========================================================
    165 cc_binary {
    166     name: "bt-example-hr-server",
    167     defaults: ["fluoride_defaults"],
    168     local_include_dirs: ["example/heart_rate"],
    169     srcs: [
    170         "example/heart_rate/heart_rate_server.cc",
    171         "example/heart_rate/server_main.cc",
    172     ],
    173     static_libs: [
    174         "libbluetooth-binder-common",
    175     ],
    176     shared_libs: [
    177         "libbinder",
    178         "libutils",
    179     ],
    180 }
    181 
    182 cc_library_static {
    183     name: "libbluetoothtbd_hal",
    184     defaults: ["fluoride_defaults"],
    185     include_dirs: ["system/bt"],
    186     srcs: [
    187         "hal/bluetooth_gatt_interface.cc",
    188         "hal/bluetooth_interface.cc",
    189         "logging_helpers.cc",
    190     ],
    191 }
    192