diff options
author | Jakub Pawlowski <jpawlowski@google.com> | 2017-04-19 06:52:08 -0700 |
---|---|---|
committer | Jakub Pawlowski <jpawlowski@google.com> | 2017-04-19 21:32:57 +0000 |
commit | d424d09f116f3c248196a3354a5fd04cf92d9c03 (patch) | |
tree | 75b670c6f6025ecbdc19cb251ad4da23c69bf95c /framework/java/android/bluetooth/le/AdvertisingSet.java | |
parent | d5411a839ae615775bce51b4fc95092663bfc930 (diff) |
Expose LE advertiser address for easier PTS tests (1/6)
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: Iaf0f2fe0613de44b8430ac25e691d66a4ad44f8d
Diffstat (limited to 'framework/java/android/bluetooth/le/AdvertisingSet.java')
-rw-r--r-- | framework/java/android/bluetooth/le/AdvertisingSet.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/framework/java/android/bluetooth/le/AdvertisingSet.java b/framework/java/android/bluetooth/le/AdvertisingSet.java index 51571b2746..3021be1f8c 100644 --- a/framework/java/android/bluetooth/le/AdvertisingSet.java +++ b/framework/java/android/bluetooth/le/AdvertisingSet.java @@ -181,7 +181,23 @@ public final class AdvertisingSet { } /** - * Returns advertiserId associated with thsi advertising set. + * Returns address associated with this advertising set. + * This method is exposed only for Bluetooth PTS tests, no app or system service + * should ever use it. + * + * This method requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED} permission. + * @hide + */ + public void getOwnAddress(){ + try { + gatt.getOwnAddress(this.advertiserId); + } catch (RemoteException e) { + Log.e(TAG, "remote exception - ", e); + } + } + + /** + * Returns advertiserId associated with this advertising set. * * @hide */ |