Package org.robolectric.shadows
Class ShadowPowerManager.ShadowWakeLock
- java.lang.Object
-
- org.robolectric.shadows.ShadowPowerManager.ShadowWakeLock
-
- Enclosing class:
- ShadowPowerManager
@Implements(android.os.PowerManager.WakeLock.class) public static class ShadowPowerManager.ShadowWakeLock extends Object
-
-
Constructor Summary
Constructors Constructor Description ShadowWakeLock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidacquire()protected voidacquire(long timeout)StringgetTag()Returns the tag.intgetTimesHeld()Returns how many times the wakelock was held.WorkSourcegetWorkSource()protected booleanisHeld()booleanisReferenceCounted()Retrieves if the wake lock is reference counted or notprotected voidrelease(int flags)Releases the wake lock.protected voidsetReferenceCounted(boolean value)protected voidsetTag(String tag)Sets the tag.protected voidsetWorkSource(WorkSource ws)
-
-
-
Method Detail
-
acquire
@Implementation protected void acquire()
-
acquire
@Implementation protected void acquire(long timeout)
-
release
@Implementation protected void release(int flags)
Releases the wake lock. Theflagsare ignored.
-
isHeld
@Implementation protected boolean isHeld()
-
isReferenceCounted
public boolean isReferenceCounted()
Retrieves if the wake lock is reference counted or not- Returns:
- Is the wake lock reference counted?
-
setReferenceCounted
@Implementation protected void setReferenceCounted(boolean value)
-
setWorkSource
@Implementation protected void setWorkSource(WorkSource ws)
-
getWorkSource
public WorkSource getWorkSource()
-
getTimesHeld
public int getTimesHeld()
Returns how many times the wakelock was held.
-
getTag
@HiddenApi @Implementation(minSdk=26) public String getTag()
Returns the tag.
-
setTag
@Implementation(minSdk=22) protected void setTag(String tag)
Sets the tag.
-
-