apphibernation

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 (
	TransactionIAppHibernationServiceIsHibernatingForUser          = binder.FirstCallTransaction + 0
	TransactionIAppHibernationServiceSetHibernatingForUser         = binder.FirstCallTransaction + 1
	TransactionIAppHibernationServiceIsHibernatingGlobally         = binder.FirstCallTransaction + 2
	TransactionIAppHibernationServiceSetHibernatingGlobally        = binder.FirstCallTransaction + 3
	TransactionIAppHibernationServiceGetHibernatingPackagesForUser = binder.FirstCallTransaction + 4
	TransactionIAppHibernationServiceGetHibernationStatsForUser    = binder.FirstCallTransaction + 5
	TransactionIAppHibernationServiceIsOatArtifactDeletionEnabled  = binder.FirstCallTransaction + 6
)
View Source
const (
	MethodIAppHibernationServiceIsHibernatingForUser          = "isHibernatingForUser"
	MethodIAppHibernationServiceSetHibernatingForUser         = "setHibernatingForUser"
	MethodIAppHibernationServiceIsHibernatingGlobally         = "isHibernatingGlobally"
	MethodIAppHibernationServiceSetHibernatingGlobally        = "setHibernatingGlobally"
	MethodIAppHibernationServiceGetHibernatingPackagesForUser = "getHibernatingPackagesForUser"
	MethodIAppHibernationServiceGetHibernationStatsForUser    = "getHibernationStatsForUser"
	MethodIAppHibernationServiceIsOatArtifactDeletionEnabled  = "isOatArtifactDeletionEnabled"
)
View Source
const DescriptorIAppHibernationService = "android.apphibernation.IAppHibernationService"

Variables

This section is empty.

Functions

This section is empty.

Types

type AppHibernationServiceProxy

type AppHibernationServiceProxy struct {
	Remote binder.IBinder
}

func NewAppHibernationServiceProxy

func NewAppHibernationServiceProxy(
	remote binder.IBinder,
) *AppHibernationServiceProxy

func (*AppHibernationServiceProxy) AsBinder

func (*AppHibernationServiceProxy) GetHibernatingPackagesForUser

func (p *AppHibernationServiceProxy) GetHibernatingPackagesForUser(
	ctx context.Context,
) ([]string, error)

func (*AppHibernationServiceProxy) GetHibernationStatsForUser

func (p *AppHibernationServiceProxy) GetHibernationStatsForUser(
	ctx context.Context,
	packageNames []string,
) (map[string]HibernationStats, error)

func (*AppHibernationServiceProxy) IsHibernatingForUser

func (p *AppHibernationServiceProxy) IsHibernatingForUser(
	ctx context.Context,
	packageName string,
) (bool, error)

func (*AppHibernationServiceProxy) IsHibernatingGlobally

func (p *AppHibernationServiceProxy) IsHibernatingGlobally(
	ctx context.Context,
	packageName string,
) (bool, error)

func (*AppHibernationServiceProxy) IsOatArtifactDeletionEnabled

func (p *AppHibernationServiceProxy) IsOatArtifactDeletionEnabled(
	ctx context.Context,
) (bool, error)

func (*AppHibernationServiceProxy) SetHibernatingForUser

func (p *AppHibernationServiceProxy) SetHibernatingForUser(
	ctx context.Context,
	packageName string,
	isHibernating bool,
) error

func (*AppHibernationServiceProxy) SetHibernatingGlobally

func (p *AppHibernationServiceProxy) SetHibernatingGlobally(
	ctx context.Context,
	packageName string,
	isHibernating bool,
) error

type AppHibernationServiceStub

type AppHibernationServiceStub struct {
	Impl      IAppHibernationService
	Transport binder.VersionAwareTransport
}

AppHibernationServiceStub dispatches incoming binder transactions to a typed IAppHibernationService implementation.

func (*AppHibernationServiceStub) Descriptor

func (s *AppHibernationServiceStub) Descriptor() string

func (*AppHibernationServiceStub) OnTransaction

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

type HibernationStats

type HibernationStats struct {
	DiskBytesSaved int64
}

func (*HibernationStats) MarshalParcel

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

func (*HibernationStats) UnmarshalParcel

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

type IAppHibernationService

type IAppHibernationService interface {
	AsBinder() binder.IBinder
	IsHibernatingForUser(ctx context.Context, packageName string) (bool, error)
	SetHibernatingForUser(ctx context.Context, packageName string, isHibernating bool) error
	IsHibernatingGlobally(ctx context.Context, packageName string) (bool, error)
	SetHibernatingGlobally(ctx context.Context, packageName string, isHibernating bool) error
	GetHibernatingPackagesForUser(ctx context.Context) ([]string, error)
	GetHibernationStatsForUser(ctx context.Context, packageNames []string) (map[string]HibernationStats, error)
	IsOatArtifactDeletionEnabled(ctx context.Context) (bool, error)
}

func NewAppHibernationServiceStub

func NewAppHibernationServiceStub(
	impl IAppHibernationServiceServer,
) IAppHibernationService

NewAppHibernationServiceStub creates a server-side IAppHibernationService wrapping the given server implementation. The returned value satisfies IAppHibernationService 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 IAppHibernationServiceServer

type IAppHibernationServiceServer interface {
	IsHibernatingForUser(ctx context.Context, packageName string) (bool, error)
	SetHibernatingForUser(ctx context.Context, packageName string, isHibernating bool) error
	IsHibernatingGlobally(ctx context.Context, packageName string) (bool, error)
	SetHibernatingGlobally(ctx context.Context, packageName string, isHibernating bool) error
	GetHibernatingPackagesForUser(ctx context.Context) ([]string, error)
	GetHibernationStatsForUser(ctx context.Context, packageNames []string) (map[string]HibernationStats, error)
	IsOatArtifactDeletionEnabled(ctx context.Context) (bool, error)
}

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