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

ambientcontext

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: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionIAmbientContextManagerRegisterObserver             = binder.FirstCallTransaction + 0
	TransactionIAmbientContextManagerRegisterObserverWithCallback = binder.FirstCallTransaction + 1
	TransactionIAmbientContextManagerUnregisterObserver           = binder.FirstCallTransaction + 2
	TransactionIAmbientContextManagerQueryServiceStatus           = binder.FirstCallTransaction + 3
	TransactionIAmbientContextManagerStartConsentActivity         = binder.FirstCallTransaction + 4
)
View Source
const (
	MethodIAmbientContextManagerRegisterObserver             = "registerObserver"
	MethodIAmbientContextManagerRegisterObserverWithCallback = "registerObserverWithCallback"
	MethodIAmbientContextManagerUnregisterObserver           = "unregisterObserver"
	MethodIAmbientContextManagerQueryServiceStatus           = "queryServiceStatus"
	MethodIAmbientContextManagerStartConsentActivity         = "startConsentActivity"
)
View Source
const (
	TransactionIAmbientContextObserverOnEvents               = binder.FirstCallTransaction + 0
	TransactionIAmbientContextObserverOnRegistrationComplete = binder.FirstCallTransaction + 1
)
View Source
const (
	MethodIAmbientContextObserverOnEvents               = "onEvents"
	MethodIAmbientContextObserverOnRegistrationComplete = "onRegistrationComplete"
)
View Source
const DescriptorIAmbientContextManager = "android.app.ambientcontext.IAmbientContextManager"
View Source
const DescriptorIAmbientContextObserver = "android.app.ambientcontext.IAmbientContextObserver"

Variables

This section is empty.

Functions

This section is empty.

Types

type AmbientContextEvent

type AmbientContextEvent struct {
	EventType       int32
	ConfidenceLevel int32
	DensityLevel    int32
}

func (*AmbientContextEvent) MarshalParcel

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

func (*AmbientContextEvent) UnmarshalParcel

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

type AmbientContextEventRequest

type AmbientContextEventRequest struct {
}

func (*AmbientContextEventRequest) MarshalParcel

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

func (*AmbientContextEventRequest) UnmarshalParcel

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

type AmbientContextManagerProxy

type AmbientContextManagerProxy struct {
	Remote binder.IBinder
}

func GetAmbientContextManager

func GetAmbientContextManager(
	ctx context.Context,
	sm *servicemanager.ServiceManager,
) (*AmbientContextManagerProxy, error)

GetAmbientContextManager retrieves the AmbientContextService service and returns a typed proxy.

func NewAmbientContextManagerProxy

func NewAmbientContextManagerProxy(
	remote binder.IBinder,
) *AmbientContextManagerProxy

func (*AmbientContextManagerProxy) AsBinder

func (*AmbientContextManagerProxy) QueryServiceStatus

func (p *AmbientContextManagerProxy) QueryServiceStatus(
	ctx context.Context,
	eventTypes []int32,
	statusCallback os.RemoteCallback,
) error

func (*AmbientContextManagerProxy) RegisterObserver

func (p *AmbientContextManagerProxy) RegisterObserver(
	ctx context.Context,
	request AmbientContextEventRequest,
	resultPendingIntent app.PendingIntent,
	statusCallback os.RemoteCallback,
) error

func (*AmbientContextManagerProxy) RegisterObserverWithCallback

func (p *AmbientContextManagerProxy) RegisterObserverWithCallback(
	ctx context.Context,
	request AmbientContextEventRequest,
	packageName string,
	observer IAmbientContextObserver,
) error

func (*AmbientContextManagerProxy) StartConsentActivity

func (p *AmbientContextManagerProxy) StartConsentActivity(
	ctx context.Context,
	eventTypes []int32,
) error

func (*AmbientContextManagerProxy) UnregisterObserver

func (p *AmbientContextManagerProxy) UnregisterObserver(
	ctx context.Context,
) error

type AmbientContextManagerStub

type AmbientContextManagerStub struct {
	Impl      IAmbientContextManager
	Transport binder.VersionAwareTransport
}

AmbientContextManagerStub dispatches incoming binder transactions to a typed IAmbientContextManager implementation.

func (*AmbientContextManagerStub) Descriptor

func (s *AmbientContextManagerStub) Descriptor() string

func (*AmbientContextManagerStub) OnTransaction

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

type AmbientContextObserverProxy

type AmbientContextObserverProxy struct {
	Remote binder.IBinder
}

func NewAmbientContextObserverProxy

func NewAmbientContextObserverProxy(
	remote binder.IBinder,
) *AmbientContextObserverProxy

func (*AmbientContextObserverProxy) AsBinder

func (*AmbientContextObserverProxy) OnEvents

func (*AmbientContextObserverProxy) OnRegistrationComplete

func (p *AmbientContextObserverProxy) OnRegistrationComplete(
	ctx context.Context,
	statusCode int32,
) error

type AmbientContextObserverStub

type AmbientContextObserverStub struct {
	Impl      IAmbientContextObserver
	Transport binder.VersionAwareTransport
}

AmbientContextObserverStub dispatches incoming binder transactions to a typed IAmbientContextObserver implementation.

func (*AmbientContextObserverStub) Descriptor

func (s *AmbientContextObserverStub) Descriptor() string

func (*AmbientContextObserverStub) OnTransaction

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

type IAmbientContextManager

type IAmbientContextManager interface {
	AsBinder() binder.IBinder
	RegisterObserver(ctx context.Context, request AmbientContextEventRequest, resultPendingIntent app.PendingIntent, statusCallback os.RemoteCallback) error
	RegisterObserverWithCallback(ctx context.Context, request AmbientContextEventRequest, packageName string, observer IAmbientContextObserver) error
	UnregisterObserver(ctx context.Context) error
	QueryServiceStatus(ctx context.Context, eventTypes []int32, statusCallback os.RemoteCallback) error
	StartConsentActivity(ctx context.Context, eventTypes []int32) error
}

func NewAmbientContextManagerStub

func NewAmbientContextManagerStub(
	impl IAmbientContextManagerServer,
) IAmbientContextManager

NewAmbientContextManagerStub creates a server-side IAmbientContextManager wrapping the given server implementation. The returned value satisfies IAmbientContextManager 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 IAmbientContextManagerServer

type IAmbientContextManagerServer interface {
	RegisterObserver(ctx context.Context, request AmbientContextEventRequest, resultPendingIntent app.PendingIntent, statusCallback os.RemoteCallback) error
	RegisterObserverWithCallback(ctx context.Context, request AmbientContextEventRequest, packageName string, observer IAmbientContextObserver) error
	UnregisterObserver(ctx context.Context) error
	QueryServiceStatus(ctx context.Context, eventTypes []int32, statusCallback os.RemoteCallback) error
	StartConsentActivity(ctx context.Context, eventTypes []int32) error
}

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

type IAmbientContextObserver

type IAmbientContextObserver interface {
	AsBinder() binder.IBinder
	OnEvents(ctx context.Context, events []AmbientContextEvent) error
	OnRegistrationComplete(ctx context.Context, statusCode int32) error
}

func NewAmbientContextObserverStub

func NewAmbientContextObserverStub(
	impl IAmbientContextObserverServer,
) IAmbientContextObserver

NewAmbientContextObserverStub creates a server-side IAmbientContextObserver wrapping the given server implementation. The returned value satisfies IAmbientContextObserver 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 IAmbientContextObserverServer

type IAmbientContextObserverServer interface {
	OnEvents(ctx context.Context, events []AmbientContextEvent) error
	OnRegistrationComplete(ctx context.Context, statusCode int32) error
}

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

Jump to

Keyboard shortcuts

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