light

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2026 License: CC0-1.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionILightsSetLightState = binder.FirstCallTransaction + 0
	TransactionILightsGetLights     = binder.FirstCallTransaction + 1
)
View Source
const (
	MethodILightsSetLightState = "setLightState"
	MethodILightsGetLights     = "getLights"
)
View Source
const DescriptorILights = "android.hardware.light.ILights"

Variables

This section is empty.

Functions

This section is empty.

Types

type BrightnessMode

type BrightnessMode int32
const (
	BrightnessModeUSER           BrightnessMode = 0
	BrightnessModeSENSOR         BrightnessMode = 1
	BrightnessModeLowPersistence BrightnessMode = 2
)

type FlashMode

type FlashMode int32
const (
	FlashModeNONE     FlashMode = 0
	FlashModeTIMED    FlashMode = 1
	FlashModeHARDWARE FlashMode = 2
)

type HwLight

type HwLight struct {
	Id      int32
	Ordinal int32
	Type    LightType
}

func (*HwLight) MarshalParcel

func (s *HwLight) MarshalParcel(
	p *parcel.Parcel,
) error

func (*HwLight) UnmarshalParcel

func (s *HwLight) UnmarshalParcel(
	p *parcel.Parcel,
) error

type HwLightState

type HwLightState struct {
	Color          int32
	FlashMode      FlashMode
	FlashOnMs      int32
	FlashOffMs     int32
	BrightnessMode BrightnessMode
}

func (*HwLightState) MarshalParcel

func (s *HwLightState) MarshalParcel(
	p *parcel.Parcel,
) error

func (*HwLightState) UnmarshalParcel

func (s *HwLightState) UnmarshalParcel(
	p *parcel.Parcel,
) error

type ILights

type ILights interface {
	AsBinder() binder.IBinder
	SetLightState(ctx context.Context, id int32, state HwLightState) error
	GetLights(ctx context.Context) ([]HwLight, error)
}

func NewLightsStub

func NewLightsStub(
	impl ILightsServer,
) ILights

NewLightsStub creates a server-side ILights wrapping the given server implementation. The returned value satisfies ILights and can be passed to proxy methods; its AsBinder() returns a *binder.StubBinder that is auto-registered with the binder driver on first use.

type ILightsServer

type ILightsServer interface {
	SetLightState(ctx context.Context, id int32, state HwLightState) error
	GetLights(ctx context.Context) ([]HwLight, error)
}

ILightsServer is the server-side interface that user implementations provide to NewLightsStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).

type LightType

type LightType int32
const (
	LightTypeBACKLIGHT     LightType = 0
	LightTypeKEYBOARD      LightType = 1
	LightTypeBUTTONS       LightType = 2
	LightTypeBATTERY       LightType = 3
	LightTypeNOTIFICATIONS LightType = 4
	LightTypeATTENTION     LightType = 5
	LightTypeBLUETOOTH     LightType = 6
	LightTypeWIFI          LightType = 7
	LightTypeMICROPHONE    LightType = 8
	LightTypeCAMERA        LightType = 9
)

type LightsProxy

type LightsProxy struct {
	Remote binder.IBinder
}

func NewLightsProxy

func NewLightsProxy(
	remote binder.IBinder,
) *LightsProxy

func (*LightsProxy) AsBinder

func (p *LightsProxy) AsBinder() binder.IBinder

func (*LightsProxy) GetLights

func (p *LightsProxy) GetLights(
	ctx context.Context,
) ([]HwLight, error)

func (*LightsProxy) SetLightState

func (p *LightsProxy) SetLightState(
	ctx context.Context,
	id int32,
	state HwLightState,
) error

type LightsStub

type LightsStub struct {
	Impl      ILights
	Transport binder.VersionAwareTransport
}

LightsStub dispatches incoming binder transactions to a typed ILights implementation.

func (*LightsStub) Descriptor

func (s *LightsStub) Descriptor() string

func (*LightsStub) OnTransaction

func (s *LightsStub) OnTransaction(
	ctx context.Context,
	code binder.TransactionCode,
	_data *parcel.Parcel,
) (*parcel.Parcel, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL