aboutsummaryrefslogtreecommitdiffstats
path: root/java/org/tinyb
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-11-17 21:30:20 +0100
committerSven Gothel <[email protected]>2020-11-17 21:30:20 +0100
commitf749e32aca9de75de3752d9199e6ba13ec1b0292 (patch)
treea1b6d81e52a7a8cb03c1688a8acd986049d7aed4 /java/org/tinyb
parent4effbc00ce41dc6c7d2f1b7415dd0365286c51fd (diff)
AdapterStatusListener::deviceReady(): Exclude from restrictions on method duration and complex mutable operations as it is called from a dedicated thread
This certainly helps with more efficiency, as a deviceReady usually is complex and we already perform on a dedicated threat. Testing this use case lead to the previous robustness commits: - d4efb7d99dd2f320bd39f53872bd7b72ec3193cc - 464152fb012f20c01c11f994757e473eed19a475
Diffstat (limited to 'java/org/tinyb')
-rw-r--r--java/org/tinyb/AdapterStatusListener.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/java/org/tinyb/AdapterStatusListener.java b/java/org/tinyb/AdapterStatusListener.java
index d27439aa..b39dc65d 100644
--- a/java/org/tinyb/AdapterStatusListener.java
+++ b/java/org/tinyb/AdapterStatusListener.java
@@ -29,7 +29,8 @@ package org.tinyb;
* {@link BluetoothAdapter} status listener for {@link BluetoothDevice} discovery events: Added, updated and removed;
* as well as for certain {@link BluetoothAdapter} events.
* <p>
- * User implementations shall return as early as possible to avoid blocking the event-handler thread.<br>
+ * User implementations shall return as early as possible to avoid blocking the event-handler thread,
+ * if not specified within the methods otherwise (see {@link #deviceReady(BluetoothDevice, long)}).<br>
* Especially complex mutable operations on DBTDevice or DBTAdapter should be issued off-thread!
* </p>
* <p>
@@ -126,6 +127,9 @@ public abstract class AdapterStatusListener {
/**
* {@link BluetoothDevice} is ready for user (GATT) processing, i.e. already connected, optionally paired and ATT MTU size negotiated via connected GATT.
+ * <p>
+ * Method is being called from a dedicated native thread, hence restrictions on method duration and complex mutable operations don't apply here.
+ * </p>
* @param device the device ready to use
* @param timestamp the time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds().
*/