hint

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package hint provides Go bindings for Android performance hint management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error int32

Error represents an NDK error code.

func (Error) Error

func (e Error) Error() string

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager wraps the NDK APerformanceHintManager handle.

func APerformanceHint_getManager

func APerformanceHint_getManager() *Manager

APerformanceHint_getManager calls the underlying C function.

func NewManagerFromPointer

func NewManagerFromPointer(ptr unsafe.Pointer) *Manager

NewManagerFromPointer wraps a raw APerformanceHintManager pointer.

func NewManagerFromUintPtr added in v0.0.4

func NewManagerFromUintPtr(ptr uintptr) *Manager

NewManagerFromUintPtr wraps a uintptr as a Manager. The caller must ensure ptr points to a valid APerformanceHintManager.

func (*Manager) CreateSession

func (h *Manager) CreateSession(threadIds *int32, size uint64, initialTargetWorkDuration time.Duration) *Session

CreateSession creates a new Session from this Manager.

func (*Manager) Pointer

func (h *Manager) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

func (*Manager) PreferredUpdateRateNanos

func (h *Manager) PreferredUpdateRateNanos() int64

PreferredUpdateRateNanos returns the value directly.

func (*Manager) UintPtr added in v0.0.4

func (h *Manager) UintPtr() uintptr

UintPtr returns the underlying pointer as a uintptr. This is useful for interop with gomobile bind, golang.org/x/mobile, gioui.org, and other packages that represent native handles as uintptr.

type Pid_t

type Pid_t = capi.Pid_t

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session wraps the NDK APerformanceHintSession handle.

func NewSessionFromPointer

func NewSessionFromPointer(ptr unsafe.Pointer) *Session

NewSessionFromPointer wraps a raw APerformanceHintSession pointer.

func NewSessionFromUintPtr added in v0.0.4

func NewSessionFromUintPtr(ptr uintptr) *Session

NewSessionFromUintPtr wraps a uintptr as a Session. The caller must ensure ptr points to a valid APerformanceHintSession.

func (*Session) APerformanceHint_reportActualWorkDuration2

func (h *Session) APerformanceHint_reportActualWorkDuration2(workDuration *WorkDuration) error

APerformanceHint_reportActualWorkDuration2 calls the underlying NDK function.

func (*Session) APerformanceHint_setPreferPowerEfficiency

func (h *Session) APerformanceHint_setPreferPowerEfficiency(enabled bool) error

APerformanceHint_setPreferPowerEfficiency calls the underlying NDK function.

func (*Session) APerformanceHint_setThreads

func (h *Session) APerformanceHint_setThreads(threadIds *Pid_t, size uint64) error

APerformanceHint_setThreads calls the underlying NDK function.

func (*Session) Close

func (h *Session) Close() error

Close releases the underlying NDK handle.

func (*Session) Pointer

func (h *Session) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

func (*Session) ReportActualWorkDuration

func (h *Session) ReportActualWorkDuration(actualDuration time.Duration) error

ReportActualWorkDuration calls the underlying NDK function.

func (*Session) UintPtr added in v0.0.4

func (h *Session) UintPtr() uintptr

UintPtr returns the underlying pointer as a uintptr. This is useful for interop with gomobile bind, golang.org/x/mobile, gioui.org, and other packages that represent native handles as uintptr.

func (*Session) UpdateTargetWorkDuration

func (h *Session) UpdateTargetWorkDuration(targetDuration time.Duration) error

UpdateTargetWorkDuration calls the underlying NDK function.

type WorkDuration

type WorkDuration struct {
	// contains filtered or unexported fields
}

WorkDuration wraps the NDK AWorkDuration handle.

func NewWorkDuration

func NewWorkDuration() *WorkDuration

NewWorkDuration creates a new WorkDuration.

func NewWorkDurationFromPointer

func NewWorkDurationFromPointer(ptr unsafe.Pointer) *WorkDuration

NewWorkDurationFromPointer wraps a raw AWorkDuration pointer.

func NewWorkDurationFromUintPtr added in v0.0.4

func NewWorkDurationFromUintPtr(ptr uintptr) *WorkDuration

NewWorkDurationFromUintPtr wraps a uintptr as a WorkDuration. The caller must ensure ptr points to a valid AWorkDuration.

func (*WorkDuration) Close

func (h *WorkDuration) Close() error

Close releases the underlying NDK handle.

func (*WorkDuration) Pointer

func (h *WorkDuration) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

func (*WorkDuration) SetActualCpuDurationNanos

func (h *WorkDuration) SetActualCpuDurationNanos(actualCpuDurationNanos int64)

SetActualCpuDurationNanos calls the underlying NDK function.

func (*WorkDuration) SetActualGpuDurationNanos

func (h *WorkDuration) SetActualGpuDurationNanos(actualGpuDurationNanos int64)

SetActualGpuDurationNanos calls the underlying NDK function.

func (*WorkDuration) SetActualTotalDurationNanos

func (h *WorkDuration) SetActualTotalDurationNanos(actualTotalDurationNanos int64)

SetActualTotalDurationNanos calls the underlying NDK function.

func (*WorkDuration) SetWorkPeriodStartTimestampNanos

func (h *WorkDuration) SetWorkPeriodStartTimestampNanos(workPeriodStartTimestampNanos int64)

SetWorkPeriodStartTimestampNanos calls the underlying NDK function.

func (*WorkDuration) UintPtr added in v0.0.4

func (h *WorkDuration) UintPtr() uintptr

UintPtr returns the underlying pointer as a uintptr. This is useful for interop with gomobile bind, golang.org/x/mobile, gioui.org, and other packages that represent native handles as uintptr.

Jump to

Keyboard shortcuts

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