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

games

package
v0.0.5 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: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionIGameServiceConnected    = binder.FirstCallTransaction + 0
	TransactionIGameServiceDisconnected = binder.FirstCallTransaction + 1
	TransactionIGameServiceGameStarted  = binder.FirstCallTransaction + 2
)
View Source
const (
	MethodIGameServiceConnected    = "connected"
	MethodIGameServiceDisconnected = "disconnected"
	MethodIGameServiceGameStarted  = "gameStarted"
)
View Source
const (
	TransactionIGameSessionOnDestroyed                                            = binder.FirstCallTransaction + 0
	TransactionIGameSessionOnTransientSystemBarVisibilityFromRevealGestureChanged = binder.FirstCallTransaction + 1
	TransactionIGameSessionOnTaskFocusChanged                                     = binder.FirstCallTransaction + 2
)
View Source
const (
	MethodIGameSessionOnDestroyed                                            = "onDestroyed"
	MethodIGameSessionOnTransientSystemBarVisibilityFromRevealGestureChanged = "onTransientSystemBarVisibilityFromRevealGestureChanged"
	MethodIGameSessionOnTaskFocusChanged                                     = "onTaskFocusChanged"
)
View Source
const (
	TransactionIGameSessionControllerTakeScreenshot = binder.FirstCallTransaction + 0
	TransactionIGameSessionControllerRestartGame    = binder.FirstCallTransaction + 1
)
View Source
const (
	MethodIGameSessionControllerTakeScreenshot = "takeScreenshot"
	MethodIGameSessionControllerRestartGame    = "restartGame"
)
View Source
const DescriptorIGameService = "android.service.games.IGameService"
View Source
const DescriptorIGameServiceController = "android.service.games.IGameServiceController"
View Source
const DescriptorIGameSession = "android.service.games.IGameSession"
View Source
const DescriptorIGameSessionController = "android.service.games.IGameSessionController"
View Source
const DescriptorIGameSessionService = "android.service.games.IGameSessionService"
View Source
const (
	MethodIGameServiceControllerCreateGameSession = "createGameSession"
)
View Source
const (
	MethodIGameSessionServiceCreate = "create"
)
View Source
const (
	TransactionIGameServiceControllerCreateGameSession = binder.FirstCallTransaction + 0
)
View Source
const (
	TransactionIGameSessionServiceCreate = binder.FirstCallTransaction + 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateGameSessionRequest

type CreateGameSessionRequest struct {
	TaskId          int32
	GamePackageName string
}

func (*CreateGameSessionRequest) MarshalParcel

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

func (*CreateGameSessionRequest) UnmarshalParcel

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

type CreateGameSessionResult

type CreateGameSessionResult struct {
}

func (*CreateGameSessionResult) MarshalParcel

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

func (*CreateGameSessionResult) UnmarshalParcel

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

type GameServiceControllerProxy

type GameServiceControllerProxy struct {
	Remote binder.IBinder
}

func NewGameServiceControllerProxy

func NewGameServiceControllerProxy(
	remote binder.IBinder,
) *GameServiceControllerProxy

func (*GameServiceControllerProxy) AsBinder

func (*GameServiceControllerProxy) CreateGameSession

func (p *GameServiceControllerProxy) CreateGameSession(
	ctx context.Context,
	taskId int32,
) error

type GameServiceControllerStub

type GameServiceControllerStub struct {
	Impl      IGameServiceController
	Transport binder.VersionAwareTransport
}

GameServiceControllerStub dispatches incoming binder transactions to a typed IGameServiceController implementation.

func (*GameServiceControllerStub) Descriptor

func (s *GameServiceControllerStub) Descriptor() string

func (*GameServiceControllerStub) OnTransaction

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

type GameServiceProxy

type GameServiceProxy struct {
	Remote binder.IBinder
}

func NewGameServiceProxy

func NewGameServiceProxy(
	remote binder.IBinder,
) *GameServiceProxy

func (*GameServiceProxy) AsBinder

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

func (*GameServiceProxy) Connected

func (p *GameServiceProxy) Connected(
	ctx context.Context,
	gameServiceController IGameServiceController,
) error

func (*GameServiceProxy) Disconnected

func (p *GameServiceProxy) Disconnected(
	ctx context.Context,
) error

func (*GameServiceProxy) GameStarted

func (p *GameServiceProxy) GameStarted(
	ctx context.Context,
	gameStartedEvent GameStartedEvent,
) error

type GameServiceStub

type GameServiceStub struct {
	Impl      IGameService
	Transport binder.VersionAwareTransport
}

GameServiceStub dispatches incoming binder transactions to a typed IGameService implementation.

func (*GameServiceStub) Descriptor

func (s *GameServiceStub) Descriptor() string

func (*GameServiceStub) OnTransaction

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

type GameSessionControllerProxy

type GameSessionControllerProxy struct {
	Remote binder.IBinder
}

func NewGameSessionControllerProxy

func NewGameSessionControllerProxy(
	remote binder.IBinder,
) *GameSessionControllerProxy

func (*GameSessionControllerProxy) AsBinder

func (*GameSessionControllerProxy) RestartGame

func (p *GameSessionControllerProxy) RestartGame(
	ctx context.Context,
	taskId int32,
) error

func (*GameSessionControllerProxy) TakeScreenshot

func (p *GameSessionControllerProxy) TakeScreenshot(
	ctx context.Context,
	taskId int32,
	gameScreenshotResultFuture infra.AndroidFuture,
) error

type GameSessionControllerStub

type GameSessionControllerStub struct {
	Impl      IGameSessionController
	Transport binder.VersionAwareTransport
}

GameSessionControllerStub dispatches incoming binder transactions to a typed IGameSessionController implementation.

func (*GameSessionControllerStub) Descriptor

func (s *GameSessionControllerStub) Descriptor() string

func (*GameSessionControllerStub) OnTransaction

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

type GameSessionProxy

type GameSessionProxy struct {
	Remote binder.IBinder
}

func NewGameSessionProxy

func NewGameSessionProxy(
	remote binder.IBinder,
) *GameSessionProxy

func (*GameSessionProxy) AsBinder

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

func (*GameSessionProxy) OnDestroyed

func (p *GameSessionProxy) OnDestroyed(
	ctx context.Context,
) error

func (*GameSessionProxy) OnTaskFocusChanged

func (p *GameSessionProxy) OnTaskFocusChanged(
	ctx context.Context,
	focused bool,
) error

func (*GameSessionProxy) OnTransientSystemBarVisibilityFromRevealGestureChanged

func (p *GameSessionProxy) OnTransientSystemBarVisibilityFromRevealGestureChanged(
	ctx context.Context,
	visibleDueToGesture bool,
) error

type GameSessionServiceProxy

type GameSessionServiceProxy struct {
	Remote binder.IBinder
}

func NewGameSessionServiceProxy

func NewGameSessionServiceProxy(
	remote binder.IBinder,
) *GameSessionServiceProxy

func (*GameSessionServiceProxy) AsBinder

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

func (*GameSessionServiceProxy) Create

func (p *GameSessionServiceProxy) Create(
	ctx context.Context,
	gameSessionController IGameSessionController,
	createGameSessionRequest CreateGameSessionRequest,
	gameSessionViewHostConfiguration GameSessionViewHostConfiguration,
	createGameSessionResultFuture infra.AndroidFuture,
) error

type GameSessionServiceStub

type GameSessionServiceStub struct {
	Impl      IGameSessionService
	Transport binder.VersionAwareTransport
}

GameSessionServiceStub dispatches incoming binder transactions to a typed IGameSessionService implementation.

func (*GameSessionServiceStub) Descriptor

func (s *GameSessionServiceStub) Descriptor() string

func (*GameSessionServiceStub) OnTransaction

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

type GameSessionStub

type GameSessionStub struct {
	Impl      IGameSession
	Transport binder.VersionAwareTransport
}

GameSessionStub dispatches incoming binder transactions to a typed IGameSession implementation.

func (*GameSessionStub) Descriptor

func (s *GameSessionStub) Descriptor() string

func (*GameSessionStub) OnTransaction

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

type GameSessionViewHostConfiguration

type GameSessionViewHostConfiguration struct {
	DisplayId int32
	WidthPx   int32
	HeightPx  int32
}

func (*GameSessionViewHostConfiguration) MarshalParcel

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

func (*GameSessionViewHostConfiguration) UnmarshalParcel

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

type GameStartedEvent

type GameStartedEvent struct {
	TaskId      int32
	PackageName string
}

func (*GameStartedEvent) MarshalParcel

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

func (*GameStartedEvent) UnmarshalParcel

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

type IGameService

type IGameService interface {
	AsBinder() binder.IBinder
	Connected(ctx context.Context, gameServiceController IGameServiceController) error
	Disconnected(ctx context.Context) error
	GameStarted(ctx context.Context, gameStartedEvent GameStartedEvent) error
}

func NewGameServiceStub

func NewGameServiceStub(
	impl IGameServiceServer,
) IGameService

NewGameServiceStub creates a server-side IGameService wrapping the given server implementation. The returned value satisfies IGameService 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 IGameServiceController

type IGameServiceController interface {
	AsBinder() binder.IBinder
	CreateGameSession(ctx context.Context, taskId int32) error
}

func NewGameServiceControllerStub

func NewGameServiceControllerStub(
	impl IGameServiceControllerServer,
) IGameServiceController

NewGameServiceControllerStub creates a server-side IGameServiceController wrapping the given server implementation. The returned value satisfies IGameServiceController 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 IGameServiceControllerServer

type IGameServiceControllerServer interface {
	CreateGameSession(ctx context.Context, taskId int32) error
}

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

type IGameServiceServer

type IGameServiceServer interface {
	Connected(ctx context.Context, gameServiceController IGameServiceController) error
	Disconnected(ctx context.Context) error
	GameStarted(ctx context.Context, gameStartedEvent GameStartedEvent) error
}

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

type IGameSession

type IGameSession interface {
	AsBinder() binder.IBinder
	OnDestroyed(ctx context.Context) error
	OnTransientSystemBarVisibilityFromRevealGestureChanged(ctx context.Context, visibleDueToGesture bool) error
	OnTaskFocusChanged(ctx context.Context, focused bool) error
}

func NewGameSessionStub

func NewGameSessionStub(
	impl IGameSessionServer,
) IGameSession

NewGameSessionStub creates a server-side IGameSession wrapping the given server implementation. The returned value satisfies IGameSession 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 IGameSessionController

type IGameSessionController interface {
	AsBinder() binder.IBinder
	TakeScreenshot(ctx context.Context, taskId int32, gameScreenshotResultFuture infra.AndroidFuture) error
	RestartGame(ctx context.Context, taskId int32) error
}

func NewGameSessionControllerStub

func NewGameSessionControllerStub(
	impl IGameSessionControllerServer,
) IGameSessionController

NewGameSessionControllerStub creates a server-side IGameSessionController wrapping the given server implementation. The returned value satisfies IGameSessionController 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 IGameSessionControllerServer

type IGameSessionControllerServer interface {
	TakeScreenshot(ctx context.Context, taskId int32, gameScreenshotResultFuture infra.AndroidFuture) error
	RestartGame(ctx context.Context, taskId int32) error
}

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

type IGameSessionServer

type IGameSessionServer interface {
	OnDestroyed(ctx context.Context) error
	OnTransientSystemBarVisibilityFromRevealGestureChanged(ctx context.Context, visibleDueToGesture bool) error
	OnTaskFocusChanged(ctx context.Context, focused bool) error
}

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

type IGameSessionService

type IGameSessionService interface {
	AsBinder() binder.IBinder
	Create(ctx context.Context, gameSessionController IGameSessionController, createGameSessionRequest CreateGameSessionRequest, gameSessionViewHostConfiguration GameSessionViewHostConfiguration, createGameSessionResultFuture infra.AndroidFuture) error
}

func NewGameSessionServiceStub

func NewGameSessionServiceStub(
	impl IGameSessionServiceServer,
) IGameSessionService

NewGameSessionServiceStub creates a server-side IGameSessionService wrapping the given server implementation. The returned value satisfies IGameSessionService 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 IGameSessionServiceServer

type IGameSessionServiceServer interface {
	Create(ctx context.Context, gameSessionController IGameSessionController, createGameSessionRequest CreateGameSessionRequest, gameSessionViewHostConfiguration GameSessionViewHostConfiguration, createGameSessionResultFuture infra.AndroidFuture) error
}

IGameSessionServiceServer is the server-side interface that user implementations provide to NewGameSessionServiceStub. 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