Light
class Light : Parcelable
kotlin.Any | |
↳ | android.hardware.lights.Light |
Represents a logical light on the device.
Summary
Constants | |
---|---|
static Int |
Capability for lights that could adjust its LED brightness. |
static Int |
Capability for lights that have red, green and blue LEDs to control the light's color. |
static Int |
Capability for lights that have red, green and blue LEDs to control the light's color. |
static Int |
Type for lights that indicate a monochrome color LED light. |
static Int |
Type for lights that illuminate keyboard keys. |
static Int |
Type for lights that indicate microphone usage |
static Int |
Type for lights that indicate a group of LED lights representing player id. |
Inherited constants | |
---|---|
Public methods | |
---|---|
Int |
Implement the Parcelable interface |
Boolean |
Indicates whether some other object is "equal to" this one. |
Int |
getId() Returns the id of the light. |
String |
getName() Returns the name of the light. |
Int |
Returns the ordinal of the light. |
Int |
getType() Returns the logical type of the light. |
Boolean |
Check whether the light has led brightness control. |
Boolean |
Check whether the light has RGB led control. |
Int |
hashCode() |
String |
toString() |
Unit |
writeToParcel(dest: Parcel, flags: Int) Implement the Parcelable interface |
Properties | |
---|---|
static Parcelable.Creator<Light!> |
Implement the Parcelable interface |
Constants
LIGHT_CAPABILITY_BRIGHTNESS
static val LIGHT_CAPABILITY_BRIGHTNESS: Int
Capability for lights that could adjust its LED brightness. If the capability is not present the LED can only be turned either on or off.
Value: 1
LIGHT_CAPABILITY_COLOR_RGB
static val LIGHT_CAPABILITY_COLOR_RGB: Int
Capability for lights that have red, green and blue LEDs to control the light's color.
Value: 2
LIGHT_CAPABILITY_RGB
static valLIGHT_CAPABILITY_RGB: Int
Deprecated: Wrong int based flag with value 0. Use capability flag LIGHT_CAPABILITY_COLOR_RGB
instead.
Capability for lights that have red, green and blue LEDs to control the light's color.
Value: 0
LIGHT_TYPE_INPUT
static val LIGHT_TYPE_INPUT: Int
Type for lights that indicate a monochrome color LED light.
Value: 10001
LIGHT_TYPE_KEYBOARD_BACKLIGHT
static val LIGHT_TYPE_KEYBOARD_BACKLIGHT: Int
Type for lights that illuminate keyboard keys.
Value: 10003
LIGHT_TYPE_MICROPHONE
static val LIGHT_TYPE_MICROPHONE: Int
Type for lights that indicate microphone usage
Value: 8
LIGHT_TYPE_PLAYER_ID
static val LIGHT_TYPE_PLAYER_ID: Int
Type for lights that indicate a group of LED lights representing player id. Player id lights normally present on game controllers are lights that consist of a row of LEDs. During multi-player game, the player id for the current game controller is represented by one of the LED that is lit according to its position in the row.
Value: 10002
Public methods
describeContents
fun describeContents(): Int
Implement the Parcelable interface
Return | |
---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
equals
fun equals(other: Any?): Boolean
Indicates whether some other object is "equal to" this one.
The equals
method implements an equivalence relation on non-null object references:
- It is reflexive: for any non-null reference value
x
,x.equals(x)
should returntrue
. - It is symmetric: for any non-null reference values
x
andy
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any non-null reference values
x
,y
, andz
, ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
. - It is consistent: for any non-null reference values
x
andy
, multiple invocations ofx.equals(y)
consistently returntrue
or consistently returnfalse
, provided no information used inequals
comparisons on the objects is modified. - For any non-null reference value
x
,x.equals(null)
should returnfalse
.
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
Parameters | |
---|---|
obj |
This value may be null . |
Return | |
---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getId
fun getId(): Int
Returns the id of the light.
This is an opaque value used as a unique identifier for the light.
getName
fun getName(): String
Returns the name of the light.
Return | |
---|---|
String |
This value cannot be null . |
getOrdinal
fun getOrdinal(): Int
Returns the ordinal of the light.
This is a sort key that represents the physical order of lights on the device with the same type. In the case of multiple lights arranged in a line, for example, the ordinals could be [1, 2, 3, 4], or [0, 10, 20, 30], or any other values that have the same sort order.
getType
fun getType(): Int
Returns the logical type of the light.
Return | |
---|---|
Int |
Value is android.hardware.lights.Light#LIGHT_TYPE_MICROPHONE , android.hardware.lights.Light#LIGHT_TYPE_INPUT , android.hardware.lights.Light#LIGHT_TYPE_PLAYER_ID , android.hardware.lights.Light#LIGHT_TYPE_KEYBOARD_BACKLIGHT , or android.hardware.lights.Light.LIGHT_TYPE_KEYBOARD_MIC_MUTE |
hasBrightnessControl
fun hasBrightnessControl(): Boolean
Check whether the light has led brightness control.
Return | |
---|---|
Boolean |
True if the hardware can control the led brightness, otherwise false. |
hasRgbControl
fun hasRgbControl(): Boolean
Check whether the light has RGB led control.
Return | |
---|---|
Boolean |
True if the hardware can control the RGB led, otherwise false. |
toString
fun toString(): String
Return | |
---|---|
String |
a string representation of the object. |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Implement the Parcelable interface
Parameters | |
---|---|
dest |
Parcel: This value cannot be null . |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE . Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |
Properties
CREATOR
static val CREATOR: Parcelable.Creator<Light!>
Implement the Parcelable interface