Help us shape the future of Go! Take the 2026 Go Developer Survey

sensorservice

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: CC0-1.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionIEventQueueDisableSensor = binder.FirstCallTransaction + 0
	TransactionIEventQueueEnableSensor  = binder.FirstCallTransaction + 1
)
View Source
const (
	MethodIEventQueueDisableSensor = "disableSensor"
	MethodIEventQueueEnableSensor  = "enableSensor"
)
View Source
const (
	TransactionISensorManagerCreateAshmemDirectChannel  = binder.FirstCallTransaction + 0
	TransactionISensorManagerCreateEventQueue           = binder.FirstCallTransaction + 1
	TransactionISensorManagerCreateGrallocDirectChannel = binder.FirstCallTransaction + 2
	TransactionISensorManagerGetDefaultSensor           = binder.FirstCallTransaction + 3
	TransactionISensorManagerGetSensorList              = binder.FirstCallTransaction + 4
)
View Source
const (
	MethodISensorManagerCreateAshmemDirectChannel  = "createAshmemDirectChannel"
	MethodISensorManagerCreateEventQueue           = "createEventQueue"
	MethodISensorManagerCreateGrallocDirectChannel = "createGrallocDirectChannel"
	MethodISensorManagerGetDefaultSensor           = "getDefaultSensor"
	MethodISensorManagerGetSensorList              = "getSensorList"
)
View Source
const (
	ISensorManagerResultNotExist         int32 = 1
	ISensorManagerResultNoMemory         int32 = 2
	ISensorManagerResultNoInit           int32 = 3
	ISensorManagerResultPermissionDenied int32 = 4
	ISensorManagerResultBadValue         int32 = 5
	ISensorManagerResultInvalidOperation int32 = 6
	ISensorManagerResultUnknownError     int32 = 7
)
View Source
const DescriptorIDirectReportChannel = "android.frameworks.sensorservice.IDirectReportChannel"
View Source
const DescriptorIEventQueue = "android.frameworks.sensorservice.IEventQueue"
View Source
const DescriptorIEventQueueCallback = "android.frameworks.sensorservice.IEventQueueCallback"
View Source
const DescriptorISensorManager = "android.frameworks.sensorservice.ISensorManager"
View Source
const (
	MethodIDirectReportChannelConfigure = "configure"
)
View Source
const (
	MethodIEventQueueCallbackOnEvent = "onEvent"
)
View Source
const (
	TransactionIDirectReportChannelConfigure = binder.FirstCallTransaction + 0
)
View Source
const (
	TransactionIEventQueueCallbackOnEvent = binder.FirstCallTransaction + 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectReportChannelProxy

type DirectReportChannelProxy struct {
	Remote binder.IBinder
}

func NewDirectReportChannelProxy

func NewDirectReportChannelProxy(
	remote binder.IBinder,
) *DirectReportChannelProxy

func (*DirectReportChannelProxy) AsBinder

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

func (*DirectReportChannelProxy) Configure

func (p *DirectReportChannelProxy) Configure(
	ctx context.Context,
	sensorHandle int32,
	rate sensors.ISensorsRateLevel,
) (int32, error)

type DirectReportChannelStub

type DirectReportChannelStub struct {
	Impl      IDirectReportChannel
	Transport binder.VersionAwareTransport
}

DirectReportChannelStub dispatches incoming binder transactions to a typed IDirectReportChannel implementation.

func (*DirectReportChannelStub) Descriptor

func (s *DirectReportChannelStub) Descriptor() string

func (*DirectReportChannelStub) OnTransaction

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

type EventQueueCallbackProxy

type EventQueueCallbackProxy struct {
	Remote binder.IBinder
}

func NewEventQueueCallbackProxy

func NewEventQueueCallbackProxy(
	remote binder.IBinder,
) *EventQueueCallbackProxy

func (*EventQueueCallbackProxy) AsBinder

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

func (*EventQueueCallbackProxy) OnEvent

func (p *EventQueueCallbackProxy) OnEvent(
	ctx context.Context,
	event sensors.Event,
) error

type EventQueueCallbackStub

type EventQueueCallbackStub struct {
	Impl      IEventQueueCallback
	Transport binder.VersionAwareTransport
}

EventQueueCallbackStub dispatches incoming binder transactions to a typed IEventQueueCallback implementation.

func (*EventQueueCallbackStub) Descriptor

func (s *EventQueueCallbackStub) Descriptor() string

func (*EventQueueCallbackStub) OnTransaction

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

type EventQueueProxy

type EventQueueProxy struct {
	Remote binder.IBinder
}

func NewEventQueueProxy

func NewEventQueueProxy(
	remote binder.IBinder,
) *EventQueueProxy

func (*EventQueueProxy) AsBinder

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

func (*EventQueueProxy) DisableSensor

func (p *EventQueueProxy) DisableSensor(
	ctx context.Context,
	sensorHandle int32,
) error

func (*EventQueueProxy) EnableSensor

func (p *EventQueueProxy) EnableSensor(
	ctx context.Context,
	sensorHandle int32,
	samplingPeriodUs int32,
	maxBatchReportLatencyUs int64,
) error

type EventQueueStub

type EventQueueStub struct {
	Impl      IEventQueue
	Transport binder.VersionAwareTransport
}

EventQueueStub dispatches incoming binder transactions to a typed IEventQueue implementation.

func (*EventQueueStub) Descriptor

func (s *EventQueueStub) Descriptor() string

func (*EventQueueStub) OnTransaction

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

type IDirectReportChannel

type IDirectReportChannel interface {
	AsBinder() binder.IBinder
	Configure(ctx context.Context, sensorHandle int32, rate sensors.ISensorsRateLevel) (int32, error)
}

func NewDirectReportChannelStub

func NewDirectReportChannelStub(
	impl IDirectReportChannelServer,
) IDirectReportChannel

NewDirectReportChannelStub creates a server-side IDirectReportChannel wrapping the given server implementation. The returned value satisfies IDirectReportChannel 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 IDirectReportChannelServer

type IDirectReportChannelServer interface {
	Configure(ctx context.Context, sensorHandle int32, rate sensors.ISensorsRateLevel) (int32, error)
}

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

type IEventQueue

type IEventQueue interface {
	AsBinder() binder.IBinder
	DisableSensor(ctx context.Context, sensorHandle int32) error
	EnableSensor(ctx context.Context, sensorHandle int32, samplingPeriodUs int32, maxBatchReportLatencyUs int64) error
}

func NewEventQueueStub

func NewEventQueueStub(
	impl IEventQueueServer,
) IEventQueue

NewEventQueueStub creates a server-side IEventQueue wrapping the given server implementation. The returned value satisfies IEventQueue 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 IEventQueueCallback

type IEventQueueCallback interface {
	AsBinder() binder.IBinder
	OnEvent(ctx context.Context, event sensors.Event) error
}

func NewEventQueueCallbackStub

func NewEventQueueCallbackStub(
	impl IEventQueueCallbackServer,
) IEventQueueCallback

NewEventQueueCallbackStub creates a server-side IEventQueueCallback wrapping the given server implementation. The returned value satisfies IEventQueueCallback 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 IEventQueueCallbackServer

type IEventQueueCallbackServer interface {
	OnEvent(ctx context.Context, event sensors.Event) error
}

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

type IEventQueueServer

type IEventQueueServer interface {
	DisableSensor(ctx context.Context, sensorHandle int32) error
	EnableSensor(ctx context.Context, sensorHandle int32, samplingPeriodUs int32, maxBatchReportLatencyUs int64) error
}

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

type ISensorManager

type ISensorManager interface {
	AsBinder() binder.IBinder
	CreateAshmemDirectChannel(ctx context.Context, mem common.Ashmem, size int64) (IDirectReportChannel, error)
	CreateEventQueue(ctx context.Context, callback IEventQueueCallback) (IEventQueue, error)
	CreateGrallocDirectChannel(ctx context.Context, buffer int32, size int64) (IDirectReportChannel, error)
	GetDefaultSensor(ctx context.Context, type_ sensors.SensorType) (sensors.SensorInfo, error)
	GetSensorList(ctx context.Context) ([]sensors.SensorInfo, error)
}

func NewSensorManagerStub

func NewSensorManagerStub(
	impl ISensorManagerServer,
) ISensorManager

NewSensorManagerStub creates a server-side ISensorManager wrapping the given server implementation. The returned value satisfies ISensorManager 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 ISensorManagerServer

type ISensorManagerServer interface {
	CreateAshmemDirectChannel(ctx context.Context, mem common.Ashmem, size int64) (IDirectReportChannel, error)
	CreateEventQueue(ctx context.Context, callback IEventQueueCallback) (IEventQueue, error)
	CreateGrallocDirectChannel(ctx context.Context, buffer int32, size int64) (IDirectReportChannel, error)
	GetDefaultSensor(ctx context.Context, type_ sensors.SensorType) (sensors.SensorInfo, error)
	GetSensorList(ctx context.Context) ([]sensors.SensorInfo, error)
}

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

type SensorManagerProxy

type SensorManagerProxy struct {
	Remote binder.IBinder
}

func NewSensorManagerProxy

func NewSensorManagerProxy(
	remote binder.IBinder,
) *SensorManagerProxy

func (*SensorManagerProxy) AsBinder

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

func (*SensorManagerProxy) CreateAshmemDirectChannel

func (p *SensorManagerProxy) CreateAshmemDirectChannel(
	ctx context.Context,
	mem common.Ashmem,
	size int64,
) (IDirectReportChannel, error)

func (*SensorManagerProxy) CreateEventQueue

func (p *SensorManagerProxy) CreateEventQueue(
	ctx context.Context,
	callback IEventQueueCallback,
) (IEventQueue, error)

func (*SensorManagerProxy) CreateGrallocDirectChannel

func (p *SensorManagerProxy) CreateGrallocDirectChannel(
	ctx context.Context,
	buffer int32,
	size int64,
) (IDirectReportChannel, error)

func (*SensorManagerProxy) GetDefaultSensor

func (p *SensorManagerProxy) GetDefaultSensor(
	ctx context.Context,
	type_ sensors.SensorType,
) (sensors.SensorInfo, error)

func (*SensorManagerProxy) GetSensorList

func (p *SensorManagerProxy) GetSensorList(
	ctx context.Context,
) ([]sensors.SensorInfo, error)

type SensorManagerStub

type SensorManagerStub struct {
	Impl      ISensorManager
	Transport binder.VersionAwareTransport
}

SensorManagerStub dispatches incoming binder transactions to a typed ISensorManager implementation.

func (*SensorManagerStub) Descriptor

func (s *SensorManagerStub) Descriptor() string

func (*SensorManagerStub) OnTransaction

func (s *SensorManagerStub) 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