Added in API level 31
LightsRequest
public final class LightsRequest
extends Object
| java.lang.Object | |
| ↳ | android.hardware.lights.LightsRequest |
Encapsulates a request to modify the state of multiple lights.
Summary
Nested classes | |
|---|---|
class | LightsRequest.Builder Builder for creating device light change requests. |
Public methods | |
|---|---|
List<LightState> | getLightStates() Get a list of LightState. |
List<Integer> | getLights() Get a list of Light as ids. |
Map<Light, LightState> | getLightsAndStates() Get a map of lights and states. |
Inherited methods | |
|---|---|
Public methods
getLightStates
Added in API level 31
public List<LightState> getLightStates ()
Get a list of LightState. The states will be returned in same order as the light ids returned by getLights().
| Returns | |
|---|---|
List<LightState> | List of light states This value cannot be null. |
getLights
Added in API level 31
public List<Integer> getLights ()
Get a list of Light as ids.
| Returns | |
|---|---|
List<Integer> | List of light ids in the request. This value cannot be null. |
getLightsAndStates
Added in API level 31
public Map<Light, LightState> getLightsAndStates ()
Get a map of lights and states. The map will contain all the lights as keys and the corresponding LightState requested as values.
| Returns | |
|---|---|
Map<Light, LightState> | This value cannot be null. |
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."],[],[]]