hint

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 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 (*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.

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 (*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) 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 (*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.

Jump to

Keyboard shortcuts

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