aboutsummaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothAdapter.java
diff options
context:
space:
mode:
authorMarie Janssen <jamuraa@google.com>2017-01-30 17:57:02 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-01-30 17:57:02 +0000
commit1b6a1dac0f7ad67e22c7468e465d1fcefc52f7c2 (patch)
tree88793226e8d3a6e29001c5c1ea693b777e443d05 /framework/java/android/bluetooth/BluetoothAdapter.java
parentce2587e4940a60029dbf7851da8814ff61c57445 (diff)
parent88c27ede3c9f96351cd92bdc610692cc291b625f (diff)
Merge "Bluetooth: add getDiscoveryEndMillis() call" am: 1785fc4eea
am: 88c27ede3c Change-Id: I6f02c4ddc0fe56cda5af2dcf2f5193ba13522792
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothAdapter.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothAdapter.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java
index 885b42f3b1..4534767724 100644
--- a/framework/java/android/bluetooth/BluetoothAdapter.java
+++ b/framework/java/android/bluetooth/BluetoothAdapter.java
@@ -1184,6 +1184,25 @@ public final class BluetoothAdapter {
}
/**
+ * Get the end time of the latest remote device discovery process.
+ * @return the latest time that the bluetooth adapter was/will be in discovery mode,
+ * in milliseconds since the epoch.
+ * This time can be in the future if {@link #startDiscovery()} has been called recently.
+ * @hide
+ */
+ public long getDiscoveryEndMillis() {
+ try {
+ mServiceLock.readLock().lock();
+ if (mService != null) return mService.getDiscoveryEndMillis();
+ } catch (RemoteException e) {
+ Log.e(TAG, "", e);
+ } finally {
+ mServiceLock.readLock().unlock();
+ }
+ return -1;
+ }
+
+ /**
* Start the remote device discovery process.
* <p>The discovery process usually involves an inquiry scan of about 12
* seconds, followed by a page scan of each new device to retrieve its