Stay organized with collections
Save and categorize content based on your preferences.
LightsManager
abstract class LightsManager
The LightsManager class allows control over device lights.
Summary
Nested classes |
abstract |
Encapsulates a session that can be used to control device lights and represents the lifetime of the requests.
|
Public methods
getLightState
abstract fun getLightState(light: Light): LightState
Returns the state of a specified light.
Parameters |
light |
Light: This value cannot be null . |
getLights
abstract fun getLights(): MutableList<Light!>
Returns the lights available on the device.
Return |
MutableList<Light!> |
A list of available lights This value cannot be null . |
openSession
abstract fun openSession(): LightsManager.LightsSession
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# LightsManager\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nLightsManager\n=============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/hardware/lights/LightsManager \"View this page in Java\") \n\n```\nabstract class LightsManager\n```\n\n|---|--------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.hardware.lights.LightsManager](#) |\n\nThe LightsManager class allows control over device lights.\n\nSummary\n-------\n\n| Nested classes ||\n|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract | [LightsSession](/reference/kotlin/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/kotlin/android/hardware/lights/LightState) | [getLightState](#getLightState(android.hardware.lights.Light))`(`light:` `[Light](/reference/kotlin/android/hardware/lights/Light)`)` Returns the state of a specified light. |\n| abstract [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\\\u003c[Light](/reference/kotlin/android/hardware/lights/Light)!\\\u003e | [getLights](#getLights())`()` Returns the lights available on the device. |\n| abstract [LightsManager.LightsSession](/reference/kotlin/android/hardware/lights/LightsManager.LightsSession) | [openSession](#openSession())`()` Creates a new LightsSession that can be used to control the device lights. |\n\nPublic methods\n--------------\n\n### getLightState\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getLightState(light: Light): LightState\n```\n\nReturns the state of a specified light.\n\n| Parameters ||\n|---------|----------------------------------------------------------------------------------------|\n| `light` | [Light](/reference/kotlin/android/hardware/lights/Light): This value cannot be `null`. |\n\n| Return ||\n|--------------------------------------------------------------------|------------------------------|\n| [LightState](/reference/kotlin/android/hardware/lights/LightState) | This value cannot be `null`. |\n\n### getLights\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getLights(): MutableList\u003cLight!\u003e\n```\n\nReturns the lights available on the device.\n\n| Return ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|\n| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\u003c[Light](/reference/kotlin/android/hardware/lights/Light)!\u003e | A list of available lights This value cannot be `null`. |\n\n### openSession\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun openSession(): LightsManager.LightsSession\n```\n\nCreates a new LightsSession that can be used to control the device lights.\n\n| Return ||\n|------------------------------------------------------------------------------------------------------|------------------------------|\n| [LightsManager.LightsSession](/reference/kotlin/android/hardware/lights/LightsManager.LightsSession) | This value cannot be `null`. |"]]