Freigeben über


Binder.ClearCallingWorkSource Method

Definition

Clears the work source on this thread.

[Android.Runtime.Register("clearCallingWorkSource", "()J", "", ApiSince=29)]
public static long ClearCallingWorkSource ();
[<Android.Runtime.Register("clearCallingWorkSource", "()J", "", ApiSince=29)>]
static member ClearCallingWorkSource : unit -> int64

Returns

token to restore original work source.

Attributes

Remarks

Clears the work source on this thread.

The work source will be propagated for future outgoing binder transactions executed on this thread.

#restoreCallingWorkSource(long) must always be called after clearing the worksource.

A typical use case would be

long token = Binder.clearCallingWorkSource();
            try {
              // Call an API.
            } finally {
              Binder.restoreCallingWorkSource(token);
            }

Java documentation for android.os.Binder.clearCallingWorkSource().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to