health

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: CC0-1.0 Imports: 6 Imported by: 0

Documentation

Overview

Package health provides Go bindings for android.os.health.

Index

Constants

View Source
const (
	MeasurementBluetoothIdleMs            = consts.MeasurementBluetoothIdleMs
	MeasurementBluetoothPowerMams         = consts.MeasurementBluetoothPowerMams
	MeasurementBluetoothRxBytes           = consts.MeasurementBluetoothRxBytes
	MeasurementBluetoothRxMs              = consts.MeasurementBluetoothRxMs
	MeasurementBluetoothRxPackets         = consts.MeasurementBluetoothRxPackets
	MeasurementBluetoothTxBytes           = consts.MeasurementBluetoothTxBytes
	MeasurementBluetoothTxMs              = consts.MeasurementBluetoothTxMs
	MeasurementBluetoothTxPackets         = consts.MeasurementBluetoothTxPackets
	MeasurementButtonUserActivityCount    = consts.MeasurementButtonUserActivityCount
	MeasurementCpuPowerMams               = consts.MeasurementCpuPowerMams
	MeasurementMobileIdleMs               = consts.MeasurementMobileIdleMs
	MeasurementMobilePowerMams            = consts.MeasurementMobilePowerMams
	MeasurementMobileRxBytes              = consts.MeasurementMobileRxBytes
	MeasurementMobileRxMs                 = consts.MeasurementMobileRxMs
	MeasurementMobileRxPackets            = consts.MeasurementMobileRxPackets
	MeasurementMobileTxBytes              = consts.MeasurementMobileTxBytes
	MeasurementMobileTxMs                 = consts.MeasurementMobileTxMs
	MeasurementMobileTxPackets            = consts.MeasurementMobileTxPackets
	MeasurementOtherUserActivityCount     = consts.MeasurementOtherUserActivityCount
	MeasurementRealtimeBatteryMs          = consts.MeasurementRealtimeBatteryMs
	MeasurementRealtimeScreenOffBatteryMs = consts.MeasurementRealtimeScreenOffBatteryMs
	MeasurementSystemCpuTimeMs            = consts.MeasurementSystemCpuTimeMs
	MeasurementTouchUserActivityCount     = consts.MeasurementTouchUserActivityCount
	MeasurementUptimeBatteryMs            = consts.MeasurementUptimeBatteryMs
	MeasurementUptimeScreenOffBatteryMs   = consts.MeasurementUptimeScreenOffBatteryMs
	MeasurementUserCpuTimeMs              = consts.MeasurementUserCpuTimeMs
	MeasurementWifiFullLockMs             = consts.MeasurementWifiFullLockMs
	MeasurementWifiIdleMs                 = consts.MeasurementWifiIdleMs
	MeasurementWifiMulticastMs            = consts.MeasurementWifiMulticastMs
	MeasurementWifiPowerMams              = consts.MeasurementWifiPowerMams
	MeasurementWifiRunningMs              = consts.MeasurementWifiRunningMs
	MeasurementWifiRxBytes                = consts.MeasurementWifiRxBytes
	MeasurementWifiRxMs                   = consts.MeasurementWifiRxMs
	MeasurementWifiRxPackets              = consts.MeasurementWifiRxPackets
	MeasurementWifiTxBytes                = consts.MeasurementWifiTxBytes
	MeasurementWifiTxMs                   = consts.MeasurementWifiTxMs
	MeasurementWifiTxPackets              = consts.MeasurementWifiTxPackets
	StatsPackages                         = consts.StatsPackages
	StatsPids                             = consts.StatsPids
	StatsProcesses                        = consts.StatsProcesses
	TimersJobs                            = consts.TimersJobs
	TimersSensors                         = consts.TimersSensors
	TimersSyncs                           = consts.TimersSyncs
	TimersWakelocksDraw                   = consts.TimersWakelocksDraw
	TimersWakelocksFull                   = consts.TimersWakelocksFull
	TimersWakelocksPartial                = consts.TimersWakelocksPartial
	TimersWakelocksWindow                 = consts.TimersWakelocksWindow
	TimerAudio                            = consts.TimerAudio
	TimerBluetoothScan                    = consts.TimerBluetoothScan
	TimerCamera                           = consts.TimerCamera
	TimerFlashlight                       = consts.TimerFlashlight
	TimerForegroundActivity               = consts.TimerForegroundActivity
	TimerGpsSensor                        = consts.TimerGpsSensor
	TimerMobileRadioActive                = consts.TimerMobileRadioActive
	TimerProcessStateBackgroundMs         = consts.TimerProcessStateBackgroundMs
	TimerProcessStateCachedMs             = consts.TimerProcessStateCachedMs
	TimerProcessStateForegroundMs         = consts.TimerProcessStateForegroundMs
	TimerProcessStateForegroundServiceMs  = consts.TimerProcessStateForegroundServiceMs
	TimerProcessStateTopMs                = consts.TimerProcessStateTopMs
	TimerProcessStateTopSleepingMs        = consts.TimerProcessStateTopSleepingMs
	TimerVibrator                         = consts.TimerVibrator
	TimerVideo                            = consts.TimerVideo
	TimerWifiScan                         = consts.TimerWifiScan
	Creator                               = consts.Creator
	MeasurementsWakeupAlarmsCount         = consts.MeasurementsWakeupAlarmsCount
	StatsServices                         = consts.StatsServices
	MeasurementWakeNestingCount           = consts.MeasurementWakeNestingCount
	MeasurementWakeStartMs                = consts.MeasurementWakeStartMs
	MeasurementWakeSumMs                  = consts.MeasurementWakeSumMs
	MeasurementLaunchCount                = consts.MeasurementLaunchCount
	MeasurementStartServiceCount          = consts.MeasurementStartServiceCount
	MeasurementAnrCount                   = consts.MeasurementAnrCount
	MeasurementCrashesCount               = consts.MeasurementCrashesCount
	MeasurementForegroundMs               = consts.MeasurementForegroundMs
	MeasurementStartsCount                = consts.MeasurementStartsCount
	MeasurementSystemTimeMs               = consts.MeasurementSystemTimeMs
	MeasurementUserTimeMs                 = consts.MeasurementUserTimeMs
)

Variables

This section is empty.

Functions

func Init

func Init(env *jni.Env) error

Init resolves all JNI class and method references for this package. It is safe to call multiple times (uses sync.Once internally). Exported for E2E testing on Android.

Types

type PackageHealthStats added in v0.0.8

type PackageHealthStats struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

PackageHealthStats wraps android.os.health.PackageHealthStats.

func (*PackageHealthStats) ToString added in v0.0.8

func (m *PackageHealthStats) ToString() (string, error)

ToString calls android.os.health.PackageHealthStats.toString.

type PidHealthStats added in v0.0.8

type PidHealthStats struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

PidHealthStats wraps android.os.health.PidHealthStats.

func (*PidHealthStats) ToString added in v0.0.8

func (m *PidHealthStats) ToString() (string, error)

ToString calls android.os.health.PidHealthStats.toString.

type ProcessHealthStats added in v0.0.8

type ProcessHealthStats struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

ProcessHealthStats wraps android.os.health.ProcessHealthStats.

func (*ProcessHealthStats) ToString added in v0.0.8

func (m *ProcessHealthStats) ToString() (string, error)

ToString calls android.os.health.ProcessHealthStats.toString.

type ServiceHealthStats added in v0.0.8

type ServiceHealthStats struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

ServiceHealthStats wraps android.os.health.ServiceHealthStats.

func (*ServiceHealthStats) ToString added in v0.0.8

func (m *ServiceHealthStats) ToString() (string, error)

ToString calls android.os.health.ServiceHealthStats.toString.

type Stats

type Stats struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

Stats wraps android.os.health.HealthStats.

func (*Stats) GetDataType

func (m *Stats) GetDataType() (string, error)

GetDataType calls android.os.health.HealthStats.getDataType.

func (*Stats) GetMeasurement

func (m *Stats) GetMeasurement(arg0 int32) (int64, error)

GetMeasurement calls android.os.health.HealthStats.getMeasurement.

func (*Stats) GetMeasurementKeyAt

func (m *Stats) GetMeasurementKeyAt(arg0 int32) (int32, error)

GetMeasurementKeyAt calls android.os.health.HealthStats.getMeasurementKeyAt.

func (*Stats) GetMeasurementKeyCount

func (m *Stats) GetMeasurementKeyCount() (int32, error)

GetMeasurementKeyCount calls android.os.health.HealthStats.getMeasurementKeyCount.

func (*Stats) GetMeasurementsKeyAt

func (m *Stats) GetMeasurementsKeyAt(arg0 int32) (int32, error)

GetMeasurementsKeyAt calls android.os.health.HealthStats.getMeasurementsKeyAt.

func (*Stats) GetMeasurementsKeyCount

func (m *Stats) GetMeasurementsKeyCount() (int32, error)

GetMeasurementsKeyCount calls android.os.health.HealthStats.getMeasurementsKeyCount.

func (*Stats) GetStatsKeyAt

func (m *Stats) GetStatsKeyAt(arg0 int32) (int32, error)

GetStatsKeyAt calls android.os.health.HealthStats.getStatsKeyAt.

func (*Stats) GetStatsKeyCount

func (m *Stats) GetStatsKeyCount() (int32, error)

GetStatsKeyCount calls android.os.health.HealthStats.getStatsKeyCount.

func (*Stats) GetTimer

func (m *Stats) GetTimer(arg0 int32) (*jni.Object, error)

GetTimer calls android.os.health.HealthStats.getTimer.

func (*Stats) GetTimerCount

func (m *Stats) GetTimerCount(arg0 int32) (int32, error)

GetTimerCount calls android.os.health.HealthStats.getTimerCount.

func (*Stats) GetTimerKeyAt

func (m *Stats) GetTimerKeyAt(arg0 int32) (int32, error)

GetTimerKeyAt calls android.os.health.HealthStats.getTimerKeyAt.

func (*Stats) GetTimerKeyCount

func (m *Stats) GetTimerKeyCount() (int32, error)

GetTimerKeyCount calls android.os.health.HealthStats.getTimerKeyCount.

func (*Stats) GetTimerTime

func (m *Stats) GetTimerTime(arg0 int32) (int64, error)

GetTimerTime calls android.os.health.HealthStats.getTimerTime.

func (*Stats) GetTimersKeyAt

func (m *Stats) GetTimersKeyAt(arg0 int32) (int32, error)

GetTimersKeyAt calls android.os.health.HealthStats.getTimersKeyAt.

func (*Stats) GetTimersKeyCount

func (m *Stats) GetTimersKeyCount() (int32, error)

GetTimersKeyCount calls android.os.health.HealthStats.getTimersKeyCount.

func (*Stats) HasMeasurement

func (m *Stats) HasMeasurement(arg0 int32) (bool, error)

HasMeasurement calls android.os.health.HealthStats.hasMeasurement.

func (*Stats) HasMeasurements

func (m *Stats) HasMeasurements(arg0 int32) (bool, error)

HasMeasurements calls android.os.health.HealthStats.hasMeasurements.

func (*Stats) HasStats

func (m *Stats) HasStats(arg0 int32) (bool, error)

HasStats calls android.os.health.HealthStats.hasStats.

func (*Stats) HasTimer

func (m *Stats) HasTimer(arg0 int32) (bool, error)

HasTimer calls android.os.health.HealthStats.hasTimer.

func (*Stats) HasTimers

func (m *Stats) HasTimers(arg0 int32) (bool, error)

HasTimers calls android.os.health.HealthStats.hasTimers.

func (*Stats) ToString added in v0.0.8

func (m *Stats) ToString() (string, error)

ToString calls android.os.health.HealthStats.toString.

type SystemHealthManager

type SystemHealthManager struct {
	VM  *jni.VM
	Ctx *app.Context
	Obj *jni.GlobalRef
}

SystemHealthManager wraps android.os.health.SystemHealthManager.

func NewSystemHealthManager

func NewSystemHealthManager(ctx *app.Context) (*SystemHealthManager, error)

NewSystemHealthManager obtains android.os.health.SystemHealthManager from the Android system service manager.

func (*SystemHealthManager) Close

func (m *SystemHealthManager) Close()

Close releases the global reference to the underlying Java object. After Close, the SystemHealthManager must not be used.

func (*SystemHealthManager) GetCpuHeadroom

func (m *SystemHealthManager) GetCpuHeadroom(arg0 *jni.Object) (float32, error)

GetCpuHeadroom calls android.os.health.SystemHealthManager.getCpuHeadroom.

func (*SystemHealthManager) GetCpuHeadroomMinIntervalMillis

func (m *SystemHealthManager) GetCpuHeadroomMinIntervalMillis() (int64, error)

GetCpuHeadroomMinIntervalMillis calls android.os.health.SystemHealthManager.getCpuHeadroomMinIntervalMillis.

func (*SystemHealthManager) GetGpuHeadroom

func (m *SystemHealthManager) GetGpuHeadroom(arg0 *jni.Object) (float32, error)

GetGpuHeadroom calls android.os.health.SystemHealthManager.getGpuHeadroom.

func (*SystemHealthManager) GetGpuHeadroomMinIntervalMillis

func (m *SystemHealthManager) GetGpuHeadroomMinIntervalMillis() (int64, error)

GetGpuHeadroomMinIntervalMillis calls android.os.health.SystemHealthManager.getGpuHeadroomMinIntervalMillis.

func (*SystemHealthManager) GetMaxCpuHeadroomTidsSize

func (m *SystemHealthManager) GetMaxCpuHeadroomTidsSize() (int32, error)

GetMaxCpuHeadroomTidsSize calls android.os.health.SystemHealthManager.getMaxCpuHeadroomTidsSize.

func (*SystemHealthManager) TakeMyUidSnapshot

func (m *SystemHealthManager) TakeMyUidSnapshot() (*jni.Object, error)

TakeMyUidSnapshot calls android.os.health.SystemHealthManager.takeMyUidSnapshot.

func (*SystemHealthManager) TakeUidSnapshot

func (m *SystemHealthManager) TakeUidSnapshot(arg0 int32) (*jni.Object, error)

TakeUidSnapshot calls android.os.health.SystemHealthManager.takeUidSnapshot.

func (*SystemHealthManager) TakeUidSnapshots

func (m *SystemHealthManager) TakeUidSnapshots(arg0 *jni.Object) (*jni.Object, error)

TakeUidSnapshots calls android.os.health.SystemHealthManager.takeUidSnapshots.

func (*SystemHealthManager) ToString added in v0.0.8

func (m *SystemHealthManager) ToString() (string, error)

ToString calls android.os.health.SystemHealthManager.toString.

type TimerStat

type TimerStat struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

TimerStat wraps android.os.health.TimerStat.

func NewTimerStat

func NewTimerStat(vm *jni.VM) (*TimerStat, error)

NewTimerStat creates a new android.os.health.TimerStat instance.

func (*TimerStat) DescribeContents

func (m *TimerStat) DescribeContents() (int32, error)

DescribeContents calls android.os.health.TimerStat.describeContents.

func (*TimerStat) GetCount

func (m *TimerStat) GetCount() (int32, error)

GetCount calls android.os.health.TimerStat.getCount.

func (*TimerStat) GetTime

func (m *TimerStat) GetTime() (int64, error)

GetTime calls android.os.health.TimerStat.getTime.

func (*TimerStat) SetCount

func (m *TimerStat) SetCount(arg0 int32) error

SetCount calls android.os.health.TimerStat.setCount.

func (*TimerStat) SetTime

func (m *TimerStat) SetTime(arg0 int64) error

SetTime calls android.os.health.TimerStat.setTime.

func (*TimerStat) ToString added in v0.0.8

func (m *TimerStat) ToString() (string, error)

ToString calls android.os.health.TimerStat.toString.

func (*TimerStat) WriteToParcel

func (m *TimerStat) WriteToParcel(arg0 *jni.Object, arg1 int32) error

WriteToParcel calls android.os.health.TimerStat.writeToParcel.

type UidHealthStats added in v0.0.8

type UidHealthStats struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

UidHealthStats wraps android.os.health.UidHealthStats.

func (*UidHealthStats) ToString added in v0.0.8

func (m *UidHealthStats) ToString() (string, error)

ToString calls android.os.health.UidHealthStats.toString.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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