Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac7f2980 authored by Neil Fuller's avatar Neil Fuller
Browse files

Improve threading docs for TimeZoneProviderService

Provide more information about threading guarantees / pitfalls.

Bug: 191444000
Test: Docs only, no tests
Change-Id: I436aea41c0636d91845261a6883ca53f99910cdf
parent 3ff79da8
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -114,9 +114,15 @@ import java.util.Objects;
 *
 * <p>Threading:
 *
 * <p>Calls to {@code report} methods can be made on on any thread and will be passed asynchronously
 * to the system server. Calls to {@link #onStartUpdates(long)} and {@link #onStopUpdates()} will
 * occur on a single thread.
 * <p>Outgoing calls to {@code report} methods can be made on any thread and will be delivered
 * asynchronously to the system server. Incoming calls to {@link TimeZoneProviderService}-defined
 * service methods like {@link #onStartUpdates(long)} and {@link #onStopUpdates()} are also
 * asynchronous with respect to the system server caller and will be delivered to this service using
 * a single thread. {@link Service} lifecycle method calls like {@link #onCreate()} and {@link
 * #onDestroy()} can occur on a different thread from those made to {@link
 * TimeZoneProviderService}-defined service methods, so implementations must be defensive and not
 * assume an ordering between them, e.g. a call to {@link #onStopUpdates()} can occur after {@link
 * #onDestroy()} and should be handled safely.
 *
 * @hide
 */