PowerManager.WakeLock.SetReferenceCounted(Boolean) Method

Definition

Sets whether this WakeLock is reference counted.

[Android.Runtime.Register("setReferenceCounted", "(Z)V", "GetSetReferenceCounted_ZHandler")]
public virtual void SetReferenceCounted (bool value);
[<Android.Runtime.Register("setReferenceCounted", "(Z)V", "GetSetReferenceCounted_ZHandler")>]
abstract member SetReferenceCounted : bool -> unit
override this.SetReferenceCounted : bool -> unit

Parameters

value
Boolean

True to make the wake lock reference counted, false to make the wake lock non-reference counted.

Attributes

Remarks

Sets whether this WakeLock is reference counted.

Wake locks are reference counted by default. If a wake lock is reference counted, then each call to #acquire() must be balanced by an equal number of calls to #release(). If a wake lock is not reference counted, then one call to #release() is sufficient to undo the effect of all previous calls to #acquire().

Java documentation for android.os.PowerManager.WakeLock.setReferenceCounted(boolean).

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