thermal

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

Documentation

Overview

Package thermal provides Go bindings for Android thermal 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 AThermalManager handle.

func NewManager

func NewManager() *Manager

NewManager creates a new Manager.

func NewManagerFromPointer

func NewManagerFromPointer(ptr unsafe.Pointer) *Manager

NewManagerFromPointer wraps a raw AThermalManager 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 AThermalManager.

func (*Manager) AThermal_getThermalHeadroom

func (h *Manager) AThermal_getThermalHeadroom(forecastSeconds int32) float32

AThermal_getThermalHeadroom returns the value directly.

func (*Manager) Close

func (h *Manager) Close() error

Close releases the underlying NDK handle.

func (*Manager) CurrentStatus

func (h *Manager) CurrentStatus() ThermalStatus

CurrentStatus returns the value directly.

func (*Manager) Pointer

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

Pointer returns the underlying pointer as unsafe.Pointer.

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 ThermalHeadroomThreshold

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

ThermalHeadroomThreshold wraps the NDK AThermalHeadroomThreshold handle.

func NewThermalHeadroomThresholdFromPointer

func NewThermalHeadroomThresholdFromPointer(ptr unsafe.Pointer) *ThermalHeadroomThreshold

NewThermalHeadroomThresholdFromPointer wraps a raw AThermalHeadroomThreshold pointer.

func NewThermalHeadroomThresholdFromUintPtr added in v0.0.4

func NewThermalHeadroomThresholdFromUintPtr(ptr uintptr) *ThermalHeadroomThreshold

NewThermalHeadroomThresholdFromUintPtr wraps a uintptr as a ThermalHeadroomThreshold. The caller must ensure ptr points to a valid AThermalHeadroomThreshold.

func (*ThermalHeadroomThreshold) Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

func (*ThermalHeadroomThreshold) UintPtr added in v0.0.4

func (h *ThermalHeadroomThreshold) 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 ThermalStatus

type ThermalStatus int32
const (
	StatusError     ThermalStatus = -1
	StatusNone      ThermalStatus = 0
	StatusLight     ThermalStatus = 1
	StatusModerate  ThermalStatus = 2
	StatusSevere    ThermalStatus = 3
	StatusCritical  ThermalStatus = 4
	StatusEmergency ThermalStatus = 5
	StatusShutdown  ThermalStatus = 6
)

func (ThermalStatus) String

func (v ThermalStatus) String() string

Jump to

Keyboard shortcuts

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