Use one type for UUID (2/5)

Currently, we have few different representations for UUID in stack:
tBT_UUID, tSDP_UUID, bt_uuid_t, bluetooth:UUID, or uint8_t*.

Additionally, tBT_UUID and bt_uuid_t are used to hold UUID as 128bit
as Little Endian or Big Endian, depending on which part of stack (GATT
or SDP) is using it.

This patch is creating one type, bluetooth::Uuid, that will replace all
other types.

Bug: 66912853
Test: all sl4a tests for GATT and RFCOMM
Change-Id: Ic9048a6c1f32a16034485b6185f5349e6bac0ff6
diff --git a/include/hardware/bluetooth.h b/include/hardware/bluetooth.h
index f57872d..d6f6e3e 100644
--- a/include/hardware/bluetooth.h
+++ b/include/hardware/bluetooth.h
@@ -24,6 +24,7 @@
 
 #include <hardware/hardware.h>
 
+#include <bluetooth/uuid.h>
 #include <raw_address.h>
 
 __BEGIN_DECLS
@@ -127,15 +128,10 @@
     BT_ACL_STATE_DISCONNECTED
 } bt_acl_state_t;
 
-/** Bluetooth 128-bit UUID */
-typedef struct {
-   uint8_t uu[16];
-} bt_uuid_t;
-
 /** Bluetooth SDP service record */
 typedef struct
 {
-   bt_uuid_t uuid;
+   bluetooth::Uuid uuid;
    uint16_t channel;
    char name[256]; // what's the maximum length
 } bt_service_record_t;
@@ -171,94 +167,95 @@
 
 /* Bluetooth Adapter and Remote Device property types */
 typedef enum {
-    /* Properties common to both adapter and remote device */
-    /**
-     * Description - Bluetooth Device Name
-     * Access mode - Adapter name can be GET/SET. Remote device can be GET
-     * Data type   - bt_bdname_t
-     */
-    BT_PROPERTY_BDNAME = 0x1,
-    /**
-     * Description - Bluetooth Device Address
-     * Access mode - Only GET.
-     * Data type   - RawAddress
-     */
-    BT_PROPERTY_BDADDR,
-    /**
-     * Description - Bluetooth Service 128-bit UUIDs
-     * Access mode - Only GET.
-     * Data type   - Array of bt_uuid_t (Array size inferred from property length).
-     */
-    BT_PROPERTY_UUIDS,
-    /**
-     * Description - Bluetooth Class of Device as found in Assigned Numbers
-     * Access mode - Only GET.
-     * Data type   - uint32_t.
-     */
-    BT_PROPERTY_CLASS_OF_DEVICE,
-    /**
-     * Description - Device Type - BREDR, BLE or DUAL Mode
-     * Access mode - Only GET.
-     * Data type   - bt_device_type_t
-     */
-    BT_PROPERTY_TYPE_OF_DEVICE,
-    /**
-     * Description - Bluetooth Service Record
-     * Access mode - Only GET.
-     * Data type   - bt_service_record_t
-     */
-    BT_PROPERTY_SERVICE_RECORD,
+  /* Properties common to both adapter and remote device */
+  /**
+   * Description - Bluetooth Device Name
+   * Access mode - Adapter name can be GET/SET. Remote device can be GET
+   * Data type   - bt_bdname_t
+   */
+  BT_PROPERTY_BDNAME = 0x1,
+  /**
+   * Description - Bluetooth Device Address
+   * Access mode - Only GET.
+   * Data type   - RawAddress
+   */
+  BT_PROPERTY_BDADDR,
+  /**
+   * Description - Bluetooth Service 128-bit UUIDs
+   * Access mode - Only GET.
+   * Data type   - Array of bluetooth::Uuid (Array size inferred from property
+   *               length).
+   */
+  BT_PROPERTY_UUIDS,
+  /**
+   * Description - Bluetooth Class of Device as found in Assigned Numbers
+   * Access mode - Only GET.
+   * Data type   - uint32_t.
+   */
+  BT_PROPERTY_CLASS_OF_DEVICE,
+  /**
+   * Description - Device Type - BREDR, BLE or DUAL Mode
+   * Access mode - Only GET.
+   * Data type   - bt_device_type_t
+   */
+  BT_PROPERTY_TYPE_OF_DEVICE,
+  /**
+   * Description - Bluetooth Service Record
+   * Access mode - Only GET.
+   * Data type   - bt_service_record_t
+   */
+  BT_PROPERTY_SERVICE_RECORD,
 
-    /* Properties unique to adapter */
-    /**
-     * Description - Bluetooth Adapter scan mode
-     * Access mode - GET and SET
-     * Data type   - bt_scan_mode_t.
-     */
-    BT_PROPERTY_ADAPTER_SCAN_MODE,
-    /**
-     * Description - List of bonded devices
-     * Access mode - Only GET.
-     * Data type   - Array of RawAddress of the bonded remote devices
-     *               (Array size inferred from property length).
-     */
-    BT_PROPERTY_ADAPTER_BONDED_DEVICES,
-    /**
-     * Description - Bluetooth Adapter Discovery timeout (in seconds)
-     * Access mode - GET and SET
-     * Data type   - uint32_t
-     */
-    BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT,
+  /* Properties unique to adapter */
+  /**
+   * Description - Bluetooth Adapter scan mode
+   * Access mode - GET and SET
+   * Data type   - bt_scan_mode_t.
+   */
+  BT_PROPERTY_ADAPTER_SCAN_MODE,
+  /**
+   * Description - List of bonded devices
+   * Access mode - Only GET.
+   * Data type   - Array of RawAddress of the bonded remote devices
+   *               (Array size inferred from property length).
+   */
+  BT_PROPERTY_ADAPTER_BONDED_DEVICES,
+  /**
+   * Description - Bluetooth Adapter Discovery timeout (in seconds)
+   * Access mode - GET and SET
+   * Data type   - uint32_t
+   */
+  BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT,
 
-    /* Properties unique to remote device */
-    /**
-     * Description - User defined friendly name of the remote device
-     * Access mode - GET and SET
-     * Data type   - bt_bdname_t.
-     */
-    BT_PROPERTY_REMOTE_FRIENDLY_NAME,
-    /**
-     * Description - RSSI value of the inquired remote device
-     * Access mode - Only GET.
-     * Data type   - int32_t.
-     */
-    BT_PROPERTY_REMOTE_RSSI,
-    /**
-     * Description - Remote version info
-     * Access mode - SET/GET.
-     * Data type   - bt_remote_version_t.
-     */
+  /* Properties unique to remote device */
+  /**
+   * Description - User defined friendly name of the remote device
+   * Access mode - GET and SET
+   * Data type   - bt_bdname_t.
+   */
+  BT_PROPERTY_REMOTE_FRIENDLY_NAME,
+  /**
+   * Description - RSSI value of the inquired remote device
+   * Access mode - Only GET.
+   * Data type   - int32_t.
+   */
+  BT_PROPERTY_REMOTE_RSSI,
+  /**
+   * Description - Remote version info
+   * Access mode - SET/GET.
+   * Data type   - bt_remote_version_t.
+   */
 
-    BT_PROPERTY_REMOTE_VERSION_INFO,
+  BT_PROPERTY_REMOTE_VERSION_INFO,
 
-    /**
-     * Description - Local LE features
-     * Access mode - GET.
-     * Data type   - bt_local_le_features_t.
-     */
-    BT_PROPERTY_LOCAL_LE_FEATURES,
+  /**
+   * Description - Local LE features
+   * Access mode - GET.
+   * Data type   - bt_local_le_features_t.
+   */
+  BT_PROPERTY_LOCAL_LE_FEATURES,
 
-    BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP = 0xFF,
+  BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP = 0xFF,
 } bt_property_type_t;
 
 /** Bluetooth Adapter Property data structure */
@@ -501,8 +498,8 @@
                                       const bt_property_t *property);
 
     /** Get Remote Device's service record  for the given UUID */
-    int (*get_remote_service_record)(RawAddress *remote_addr,
-                                     bt_uuid_t *uuid);
+    int (*get_remote_service_record)(const RawAddress& remote_addr,
+                                     const bluetooth::Uuid& uuid);
 
     /** Start SDP to get remote services */
     int (*get_remote_services)(RawAddress *remote_addr);