thermal

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

Documentation

Index

Constants

View Source
const (
	TransactionIThermalGetCoolingDevices                            = binder.FirstCallTransaction + 0
	TransactionIThermalGetCoolingDevicesWithType                    = binder.FirstCallTransaction + 1
	TransactionIThermalGetTemperatures                              = binder.FirstCallTransaction + 2
	TransactionIThermalGetTemperaturesWithType                      = binder.FirstCallTransaction + 3
	TransactionIThermalGetTemperatureThresholds                     = binder.FirstCallTransaction + 4
	TransactionIThermalGetTemperatureThresholdsWithType             = binder.FirstCallTransaction + 5
	TransactionIThermalRegisterThermalChangedCallback               = binder.FirstCallTransaction + 6
	TransactionIThermalRegisterThermalChangedCallbackWithType       = binder.FirstCallTransaction + 7
	TransactionIThermalUnregisterThermalChangedCallback             = binder.FirstCallTransaction + 8
	TransactionIThermalRegisterCoolingDeviceChangedCallbackWithType = binder.FirstCallTransaction + 9
	TransactionIThermalUnregisterCoolingDeviceChangedCallback       = binder.FirstCallTransaction + 10
)
View Source
const (
	MethodIThermalGetCoolingDevices                            = "getCoolingDevices"
	MethodIThermalGetCoolingDevicesWithType                    = "getCoolingDevicesWithType"
	MethodIThermalGetTemperatures                              = "getTemperatures"
	MethodIThermalGetTemperaturesWithType                      = "getTemperaturesWithType"
	MethodIThermalGetTemperatureThresholds                     = "getTemperatureThresholds"
	MethodIThermalGetTemperatureThresholdsWithType             = "getTemperatureThresholdsWithType"
	MethodIThermalRegisterThermalChangedCallback               = "registerThermalChangedCallback"
	MethodIThermalRegisterThermalChangedCallbackWithType       = "registerThermalChangedCallbackWithType"
	MethodIThermalUnregisterThermalChangedCallback             = "unregisterThermalChangedCallback"
	MethodIThermalRegisterCoolingDeviceChangedCallbackWithType = "registerCoolingDeviceChangedCallbackWithType"
	MethodIThermalUnregisterCoolingDeviceChangedCallback       = "unregisterCoolingDeviceChangedCallback"
)
View Source
const DescriptorICoolingDeviceChangedCallback = "android.hardware.thermal.ICoolingDeviceChangedCallback"
View Source
const DescriptorIThermal = "android.hardware.thermal.IThermal"
View Source
const DescriptorIThermalChangedCallback = "android.hardware.thermal.IThermalChangedCallback"
View Source
const (
	MethodICoolingDeviceChangedCallbackNotifyCoolingDeviceChanged = "notifyCoolingDeviceChanged"
)
View Source
const (
	MethodIThermalChangedCallbackNotifyThrottling = "notifyThrottling"
)
View Source
const (
	TransactionICoolingDeviceChangedCallbackNotifyCoolingDeviceChanged = binder.FirstCallTransaction + 0
)
View Source
const (
	TransactionIThermalChangedCallbackNotifyThrottling = binder.FirstCallTransaction + 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CoolingDevice

type CoolingDevice struct {
	Type         CoolingType
	Name         string
	Value        int64
	PowerLimitMw int64
	PowerMw      int64
	TimeWindowMs int64
}

func (*CoolingDevice) MarshalParcel

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

func (*CoolingDevice) UnmarshalParcel

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

type CoolingDeviceChangedCallbackProxy

type CoolingDeviceChangedCallbackProxy struct {
	Remote binder.IBinder
}

func NewCoolingDeviceChangedCallbackProxy

func NewCoolingDeviceChangedCallbackProxy(
	remote binder.IBinder,
) *CoolingDeviceChangedCallbackProxy

func (*CoolingDeviceChangedCallbackProxy) AsBinder

func (*CoolingDeviceChangedCallbackProxy) NotifyCoolingDeviceChanged

func (p *CoolingDeviceChangedCallbackProxy) NotifyCoolingDeviceChanged(
	ctx context.Context,
	coolingDevice CoolingDevice,
) error

type CoolingDeviceChangedCallbackStub

type CoolingDeviceChangedCallbackStub struct {
	Impl      ICoolingDeviceChangedCallback
	Transport binder.VersionAwareTransport
}

CoolingDeviceChangedCallbackStub dispatches incoming binder transactions to a typed ICoolingDeviceChangedCallback implementation.

func (*CoolingDeviceChangedCallbackStub) Descriptor

func (s *CoolingDeviceChangedCallbackStub) Descriptor() string

func (*CoolingDeviceChangedCallbackStub) OnTransaction

type CoolingType

type CoolingType int32
const (
	CoolingTypeFAN            CoolingType = 0
	CoolingTypeBATTERY        CoolingType = 1
	CoolingTypeCPU            CoolingType = 2
	CoolingTypeGPU            CoolingType = 3
	CoolingTypeMODEM          CoolingType = 4
	CoolingTypeNPU            CoolingType = 5
	CoolingTypeCOMPONENT      CoolingType = 6
	CoolingTypeTPU            CoolingType = 7
	CoolingTypePowerAmplifier CoolingType = 8
	CoolingTypeDISPLAY        CoolingType = 9
	CoolingTypeSPEAKER        CoolingType = 10
	CoolingTypeWIFI           CoolingType = 11
	CoolingTypeCAMERA         CoolingType = 12
	CoolingTypeFLASHLIGHT     CoolingType = 13
	CoolingTypeUsbPort        CoolingType = 14
)

type ICoolingDeviceChangedCallback

type ICoolingDeviceChangedCallback interface {
	AsBinder() binder.IBinder
	NotifyCoolingDeviceChanged(ctx context.Context, coolingDevice CoolingDevice) error
}

func NewCoolingDeviceChangedCallbackStub

func NewCoolingDeviceChangedCallbackStub(
	impl ICoolingDeviceChangedCallbackServer,
) ICoolingDeviceChangedCallback

NewCoolingDeviceChangedCallbackStub creates a server-side ICoolingDeviceChangedCallback wrapping the given server implementation. The returned value satisfies ICoolingDeviceChangedCallback 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 ICoolingDeviceChangedCallbackServer

type ICoolingDeviceChangedCallbackServer interface {
	NotifyCoolingDeviceChanged(ctx context.Context, coolingDevice CoolingDevice) error
}

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

type IThermal

type IThermal interface {
	AsBinder() binder.IBinder
	GetCoolingDevices(ctx context.Context) ([]CoolingDevice, error)
	GetCoolingDevicesWithType(ctx context.Context, type_ CoolingType) ([]CoolingDevice, error)
	GetTemperatures(ctx context.Context) ([]Temperature, error)
	GetTemperaturesWithType(ctx context.Context, type_ TemperatureType) ([]Temperature, error)
	GetTemperatureThresholds(ctx context.Context) ([]TemperatureThreshold, error)
	GetTemperatureThresholdsWithType(ctx context.Context, type_ TemperatureType) ([]TemperatureThreshold, error)
	RegisterThermalChangedCallback(ctx context.Context, callback IThermalChangedCallback) error
	RegisterThermalChangedCallbackWithType(ctx context.Context, callback IThermalChangedCallback, type_ TemperatureType) error
	UnregisterThermalChangedCallback(ctx context.Context, callback IThermalChangedCallback) error
	RegisterCoolingDeviceChangedCallbackWithType(ctx context.Context, callback ICoolingDeviceChangedCallback, type_ CoolingType) error
	UnregisterCoolingDeviceChangedCallback(ctx context.Context, callback ICoolingDeviceChangedCallback) error
}

func NewThermalStub

func NewThermalStub(
	impl IThermalServer,
) IThermal

NewThermalStub creates a server-side IThermal wrapping the given server implementation. The returned value satisfies IThermal 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 IThermalChangedCallback

type IThermalChangedCallback interface {
	AsBinder() binder.IBinder
	NotifyThrottling(ctx context.Context, temperature Temperature) error
}

func NewThermalChangedCallbackStub

func NewThermalChangedCallbackStub(
	impl IThermalChangedCallbackServer,
) IThermalChangedCallback

NewThermalChangedCallbackStub creates a server-side IThermalChangedCallback wrapping the given server implementation. The returned value satisfies IThermalChangedCallback 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 IThermalChangedCallbackServer

type IThermalChangedCallbackServer interface {
	NotifyThrottling(ctx context.Context, temperature Temperature) error
}

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

type IThermalServer

type IThermalServer interface {
	GetCoolingDevices(ctx context.Context) ([]CoolingDevice, error)
	GetCoolingDevicesWithType(ctx context.Context, type_ CoolingType) ([]CoolingDevice, error)
	GetTemperatures(ctx context.Context) ([]Temperature, error)
	GetTemperaturesWithType(ctx context.Context, type_ TemperatureType) ([]Temperature, error)
	GetTemperatureThresholds(ctx context.Context) ([]TemperatureThreshold, error)
	GetTemperatureThresholdsWithType(ctx context.Context, type_ TemperatureType) ([]TemperatureThreshold, error)
	RegisterThermalChangedCallback(ctx context.Context, callback IThermalChangedCallback) error
	RegisterThermalChangedCallbackWithType(ctx context.Context, callback IThermalChangedCallback, type_ TemperatureType) error
	UnregisterThermalChangedCallback(ctx context.Context, callback IThermalChangedCallback) error
	RegisterCoolingDeviceChangedCallbackWithType(ctx context.Context, callback ICoolingDeviceChangedCallback, type_ CoolingType) error
	UnregisterCoolingDeviceChangedCallback(ctx context.Context, callback ICoolingDeviceChangedCallback) error
}

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

type Temperature

type Temperature struct {
	Type             TemperatureType
	Name             string
	Value            float32
	ThrottlingStatus ThrottlingSeverity
}

func (*Temperature) MarshalParcel

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

func (*Temperature) UnmarshalParcel

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

type TemperatureThreshold

type TemperatureThreshold struct {
	Type                     TemperatureType
	Name                     string
	HotThrottlingThresholds  []float32
	ColdThrottlingThresholds []float32
}

func (*TemperatureThreshold) MarshalParcel

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

func (*TemperatureThreshold) UnmarshalParcel

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

type TemperatureType

type TemperatureType int32
const (
	TemperatureTypeUNKNOWN        TemperatureType = -1
	TemperatureTypeCPU            TemperatureType = 0
	TemperatureTypeGPU            TemperatureType = 1
	TemperatureTypeBATTERY        TemperatureType = 2
	TemperatureTypeSKIN           TemperatureType = 3
	TemperatureTypeUsbPort        TemperatureType = 4
	TemperatureTypePowerAmplifier TemperatureType = 5
	TemperatureTypeBclVoltage     TemperatureType = 6
	TemperatureTypeBclCurrent     TemperatureType = 7
	TemperatureTypeBclPercentage  TemperatureType = 8
	TemperatureTypeNPU            TemperatureType = 9
	TemperatureTypeTPU            TemperatureType = 10
	TemperatureTypeDISPLAY        TemperatureType = 11
	TemperatureTypeMODEM          TemperatureType = 12
	TemperatureTypeSOC            TemperatureType = 13
	TemperatureTypeWIFI           TemperatureType = 14
	TemperatureTypeCAMERA         TemperatureType = 15
	TemperatureTypeFLASHLIGHT     TemperatureType = 16
	TemperatureTypeSPEAKER        TemperatureType = 17
	TemperatureTypeAMBIENT        TemperatureType = 18
	TemperatureTypePOGO           TemperatureType = 19
)

type ThermalChangedCallbackProxy

type ThermalChangedCallbackProxy struct {
	Remote binder.IBinder
}

func NewThermalChangedCallbackProxy

func NewThermalChangedCallbackProxy(
	remote binder.IBinder,
) *ThermalChangedCallbackProxy

func (*ThermalChangedCallbackProxy) AsBinder

func (*ThermalChangedCallbackProxy) NotifyThrottling

func (p *ThermalChangedCallbackProxy) NotifyThrottling(
	ctx context.Context,
	temperature Temperature,
) error

type ThermalChangedCallbackStub

type ThermalChangedCallbackStub struct {
	Impl      IThermalChangedCallback
	Transport binder.VersionAwareTransport
}

ThermalChangedCallbackStub dispatches incoming binder transactions to a typed IThermalChangedCallback implementation.

func (*ThermalChangedCallbackStub) Descriptor

func (s *ThermalChangedCallbackStub) Descriptor() string

func (*ThermalChangedCallbackStub) OnTransaction

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

type ThermalProxy

type ThermalProxy struct {
	Remote binder.IBinder
}

func NewThermalProxy

func NewThermalProxy(
	remote binder.IBinder,
) *ThermalProxy

func (*ThermalProxy) AsBinder

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

func (*ThermalProxy) GetCoolingDevices

func (p *ThermalProxy) GetCoolingDevices(
	ctx context.Context,
) ([]CoolingDevice, error)

func (*ThermalProxy) GetCoolingDevicesWithType

func (p *ThermalProxy) GetCoolingDevicesWithType(
	ctx context.Context,
	type_ CoolingType,
) ([]CoolingDevice, error)

func (*ThermalProxy) GetTemperatureThresholds

func (p *ThermalProxy) GetTemperatureThresholds(
	ctx context.Context,
) ([]TemperatureThreshold, error)

func (*ThermalProxy) GetTemperatureThresholdsWithType

func (p *ThermalProxy) GetTemperatureThresholdsWithType(
	ctx context.Context,
	type_ TemperatureType,
) ([]TemperatureThreshold, error)

func (*ThermalProxy) GetTemperatures

func (p *ThermalProxy) GetTemperatures(
	ctx context.Context,
) ([]Temperature, error)

func (*ThermalProxy) GetTemperaturesWithType

func (p *ThermalProxy) GetTemperaturesWithType(
	ctx context.Context,
	type_ TemperatureType,
) ([]Temperature, error)

func (*ThermalProxy) RegisterCoolingDeviceChangedCallbackWithType

func (p *ThermalProxy) RegisterCoolingDeviceChangedCallbackWithType(
	ctx context.Context,
	callback ICoolingDeviceChangedCallback,
	type_ CoolingType,
) error

func (*ThermalProxy) RegisterThermalChangedCallback

func (p *ThermalProxy) RegisterThermalChangedCallback(
	ctx context.Context,
	callback IThermalChangedCallback,
) error

func (*ThermalProxy) RegisterThermalChangedCallbackWithType

func (p *ThermalProxy) RegisterThermalChangedCallbackWithType(
	ctx context.Context,
	callback IThermalChangedCallback,
	type_ TemperatureType,
) error

func (*ThermalProxy) UnregisterCoolingDeviceChangedCallback

func (p *ThermalProxy) UnregisterCoolingDeviceChangedCallback(
	ctx context.Context,
	callback ICoolingDeviceChangedCallback,
) error

func (*ThermalProxy) UnregisterThermalChangedCallback

func (p *ThermalProxy) UnregisterThermalChangedCallback(
	ctx context.Context,
	callback IThermalChangedCallback,
) error

type ThermalStub

type ThermalStub struct {
	Impl      IThermal
	Transport binder.VersionAwareTransport
}

ThermalStub dispatches incoming binder transactions to a typed IThermal implementation.

func (*ThermalStub) Descriptor

func (s *ThermalStub) Descriptor() string

func (*ThermalStub) OnTransaction

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

type ThrottlingSeverity

type ThrottlingSeverity int32
const (
	ThrottlingSeverityNONE      ThrottlingSeverity = 0
	ThrottlingSeverityLIGHT     ThrottlingSeverity = 1
	ThrottlingSeverityMODERATE  ThrottlingSeverity = 2
	ThrottlingSeveritySEVERE    ThrottlingSeverity = 3
	ThrottlingSeverityCRITICAL  ThrottlingSeverity = 4
	ThrottlingSeverityEMERGENCY ThrottlingSeverity = 5
	ThrottlingSeveritySHUTDOWN  ThrottlingSeverity = 6
)

Jump to

Keyboard shortcuts

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