LightsManager
public
abstract
class
LightsManager
extends Object
The LightsManager class allows control over device lights.
Summary
Nested classes |
class |
LightsManager.LightsSession
Encapsulates a session that can be used to control device lights and represents the lifetime
of the requests.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Public methods
getLightState
public abstract LightState getLightState (Light light)
Returns the state of a specified light.
Parameters |
light |
Light : This value cannot be null . |
getLights
public abstract List<Light> getLights ()
Returns the lights available on the device.
Returns |
List<Light> |
A list of available lights
This value cannot be null . |
openSession
public abstract LightsManager.LightsSession openSession ()
Creates a new LightsSession that can be used to control the device lights.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# LightsManager\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Nested Classes](#nestedclasses) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nLightsManager\n=============\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/hardware/lights/LightsManager \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\n\n\nabstract\nclass\nLightsManager\n`\n\n\n`\n\nextends `[Object](/reference/java/lang/Object)`\n\n\n`\n\n`\n\n\n`\n\n|---|---------------------------------------|\n| [java.lang.Object](/reference/java/lang/Object) ||\n| ↳ | android.hardware.lights.LightsManager |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThe LightsManager class allows control over device lights.\n\nSummary\n-------\n\n| ### Nested classes ||\n|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` class` | [LightsManager.LightsSession](/reference/android/hardware/lights/LightsManager.LightsSession) Encapsulates a session that can be used to control device lights and represents the lifetime of the requests. |\n\n| ### Public methods ||\n|-----------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract `[LightState](/reference/android/hardware/lights/LightState) | ` `[getLightState](/reference/android/hardware/lights/LightsManager#getLightState(android.hardware.lights.Light))`(`[Light](/reference/android/hardware/lights/Light)` light) ` Returns the state of a specified light. |\n| ` abstract `[List](/reference/java/util/List)`\u003c`[Light](/reference/android/hardware/lights/Light)`\u003e` | ` `[getLights](/reference/android/hardware/lights/LightsManager#getLights())`() ` Returns the lights available on the device. |\n| ` abstract `[LightsManager.LightsSession](/reference/android/hardware/lights/LightsManager.LightsSession) | ` `[openSession](/reference/android/hardware/lights/LightsManager#openSession())`() ` Creates a new LightsSession that can be used to control the device lights. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](/reference/java/lang/Object)` ` |---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](/reference/java/lang/Object) | ` `[clone](/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object. | | ` boolean` | ` `[equals](/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](/reference/java/lang/Object)` obj) ` Indicates whether some other object is \"equal to\" this one. | | ` void` | ` `[finalize](/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final `[Class](/reference/java/lang/Class)`\u003c?\u003e` | ` `[getClass](/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this `Object`. | | ` int` | ` `[hashCode](/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object. | | ` final void` | ` `[notify](/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` `[notifyAll](/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor. | | ` `[String](/reference/java/lang/String) | ` `[toString](/reference/java/lang/Object#toString())`() ` Returns a string representation of the object. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||\n\nPublic methods\n--------------\n\n### getLightState\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract LightState getLightState (Light light)\n```\n\nReturns the state of a specified light.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|----------------------------------------------|\n| `light` | `Light`: This value cannot be `null`. \u003cbr /\u003e |\n\n| Returns ||\n|-------------------------------------------------------------|-------------------------------------|\n| [LightState](/reference/android/hardware/lights/LightState) | This value cannot be `null`. \u003cbr /\u003e |\n\n### getLights\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract List\u003cLight\u003e getLights ()\n```\n\nReturns the lights available on the device.\n\n\u003cbr /\u003e\n\n| Returns ||\n|------------------------------------------------------------------------------------------|----------------------------------------------------------------|\n| [List](/reference/java/util/List)`\u003c`[Light](/reference/android/hardware/lights/Light)`\u003e` | A list of available lights This value cannot be `null`. \u003cbr /\u003e |\n\n### openSession\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract LightsManager.LightsSession openSession ()\n```\n\nCreates a new LightsSession that can be used to control the device lights.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------------------------------------------------------------------------------------------|-------------------------------------|\n| [LightsManager.LightsSession](/reference/android/hardware/lights/LightsManager.LightsSession) | This value cannot be `null`. \u003cbr /\u003e |"]]