OSDN Git Service

Expose LE advertiser address for easier PTS tests (3/6)
authorJakub Pawlowski <jpawlowski@google.com>
Wed, 19 Apr 2017 14:03:14 +0000 (07:03 -0700)
committerJakub Pawlowski <jpawlowski@google.com>
Thu, 27 Apr 2017 19:55:46 +0000 (12:55 -0700)
This patchset adds a hidden method getOwnAddress, that lets app with
BLUETOOTH_PRIVILEGED permission to lear their own addreess. This is done
exclusively for PTS tests.

Bug: 35147497
Test: manual
Change-Id: I39a6395d589d0ea801fd771bf3313ed6212a6349
(cherry picked from commit 788847a61ac6281212714e831e3aeb217f024973)

include/hardware/ble_advertiser.h

index 8abca00..02d553f 100644 (file)
@@ -57,6 +57,9 @@ class BleAdvertiserInterface {
   /** Registers an advertiser with the stack */
   virtual void RegisterAdvertiser(IdStatusCallback) = 0;
 
+  using GetAddressCallback = base::Callback<void(uint8_t /* address_type*/, bt_bdaddr_t /*address*/)>;
+  virtual void GetOwnAddress(uint8_t advertiser_id, GetAddressCallback cb) = 0;
+
   /* Set the parameters as per spec, user manual specified values */
   virtual void SetParameters(uint8_t advertiser_id, AdvertiseParameters params,
                              ParametersCallback cb) = 0;