Documentation
¶
Index ¶
- Constants
- type Channel
- type EnergyConsumer
- type EnergyConsumerAttribution
- type EnergyConsumerResult
- type EnergyConsumerType
- type EnergyMeasurement
- type IPowerStats
- type IPowerStatsServer
- type PowerEntity
- type PowerStatsProxy
- func (p *PowerStatsProxy) AsBinder() binder.IBinder
- func (p *PowerStatsProxy) GetEnergyConsumed(ctx context.Context, energyConsumerIds []int32) ([]EnergyConsumerResult, error)
- func (p *PowerStatsProxy) GetEnergyConsumerInfo(ctx context.Context) ([]EnergyConsumer, error)
- func (p *PowerStatsProxy) GetEnergyMeterInfo(ctx context.Context) ([]Channel, error)
- func (p *PowerStatsProxy) GetPowerEntityInfo(ctx context.Context) ([]PowerEntity, error)
- func (p *PowerStatsProxy) GetStateResidency(ctx context.Context, powerEntityIds []int32) ([]StateResidencyResult, error)
- func (p *PowerStatsProxy) ReadEnergyMeter(ctx context.Context, channelIds []int32) ([]EnergyMeasurement, error)
- type PowerStatsStub
- type State
- type StateResidency
- type StateResidencyResult
Constants ¶
View Source
const ( TransactionIPowerStatsGetPowerEntityInfo = binder.FirstCallTransaction + 0 TransactionIPowerStatsGetStateResidency = binder.FirstCallTransaction + 1 TransactionIPowerStatsGetEnergyConsumerInfo = binder.FirstCallTransaction + 2 TransactionIPowerStatsGetEnergyConsumed = binder.FirstCallTransaction + 3 TransactionIPowerStatsGetEnergyMeterInfo = binder.FirstCallTransaction + 4 TransactionIPowerStatsReadEnergyMeter = binder.FirstCallTransaction + 5 )
View Source
const ( MethodIPowerStatsGetPowerEntityInfo = "getPowerEntityInfo" MethodIPowerStatsGetStateResidency = "getStateResidency" MethodIPowerStatsGetEnergyConsumerInfo = "getEnergyConsumerInfo" MethodIPowerStatsGetEnergyConsumed = "getEnergyConsumed" MethodIPowerStatsGetEnergyMeterInfo = "getEnergyMeterInfo" MethodIPowerStatsReadEnergyMeter = "readEnergyMeter" )
View Source
const DescriptorIPowerStats = "android.hardware.power.stats.IPowerStats"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnergyConsumer ¶
type EnergyConsumer struct {
Id int32
Ordinal int32
Type EnergyConsumerType
Name string
}
func (*EnergyConsumer) MarshalParcel ¶
func (s *EnergyConsumer) MarshalParcel( p *parcel.Parcel, ) error
func (*EnergyConsumer) UnmarshalParcel ¶
func (s *EnergyConsumer) UnmarshalParcel( p *parcel.Parcel, ) error
type EnergyConsumerAttribution ¶
func (*EnergyConsumerAttribution) MarshalParcel ¶
func (s *EnergyConsumerAttribution) MarshalParcel( p *parcel.Parcel, ) error
func (*EnergyConsumerAttribution) UnmarshalParcel ¶
func (s *EnergyConsumerAttribution) UnmarshalParcel( p *parcel.Parcel, ) error
type EnergyConsumerResult ¶
type EnergyConsumerResult struct {
Id int32
TimestampMs int64
EnergyUWs int64
Attribution []EnergyConsumerAttribution
}
func (*EnergyConsumerResult) MarshalParcel ¶
func (s *EnergyConsumerResult) MarshalParcel( p *parcel.Parcel, ) error
func (*EnergyConsumerResult) UnmarshalParcel ¶
func (s *EnergyConsumerResult) UnmarshalParcel( p *parcel.Parcel, ) error
type EnergyConsumerType ¶
type EnergyConsumerType int32
const ( EnergyConsumerTypeOTHER EnergyConsumerType = 0 EnergyConsumerTypeBLUETOOTH EnergyConsumerType = 1 EnergyConsumerTypeCpuCluster EnergyConsumerType = 2 EnergyConsumerTypeDISPLAY EnergyConsumerType = 3 EnergyConsumerTypeGNSS EnergyConsumerType = 4 EnergyConsumerTypeMobileRadio EnergyConsumerType = 5 EnergyConsumerTypeWIFI EnergyConsumerType = 6 EnergyConsumerTypeCAMERA EnergyConsumerType = 7 )
type EnergyMeasurement ¶
func (*EnergyMeasurement) MarshalParcel ¶
func (s *EnergyMeasurement) MarshalParcel( p *parcel.Parcel, ) error
func (*EnergyMeasurement) UnmarshalParcel ¶
func (s *EnergyMeasurement) UnmarshalParcel( p *parcel.Parcel, ) error
type IPowerStats ¶
type IPowerStats interface {
AsBinder() binder.IBinder
GetPowerEntityInfo(ctx context.Context) ([]PowerEntity, error)
GetStateResidency(ctx context.Context, powerEntityIds []int32) ([]StateResidencyResult, error)
GetEnergyConsumerInfo(ctx context.Context) ([]EnergyConsumer, error)
GetEnergyConsumed(ctx context.Context, energyConsumerIds []int32) ([]EnergyConsumerResult, error)
GetEnergyMeterInfo(ctx context.Context) ([]Channel, error)
ReadEnergyMeter(ctx context.Context, channelIds []int32) ([]EnergyMeasurement, error)
}
func NewPowerStatsStub ¶
func NewPowerStatsStub( impl IPowerStatsServer, ) IPowerStats
NewPowerStatsStub creates a server-side IPowerStats wrapping the given server implementation. The returned value satisfies IPowerStats 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 IPowerStatsServer ¶
type IPowerStatsServer interface {
GetPowerEntityInfo(ctx context.Context) ([]PowerEntity, error)
GetStateResidency(ctx context.Context, powerEntityIds []int32) ([]StateResidencyResult, error)
GetEnergyConsumerInfo(ctx context.Context) ([]EnergyConsumer, error)
GetEnergyConsumed(ctx context.Context, energyConsumerIds []int32) ([]EnergyConsumerResult, error)
GetEnergyMeterInfo(ctx context.Context) ([]Channel, error)
ReadEnergyMeter(ctx context.Context, channelIds []int32) ([]EnergyMeasurement, error)
}
IPowerStatsServer is the server-side interface that user implementations provide to NewPowerStatsStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).
type PowerEntity ¶
func (*PowerEntity) MarshalParcel ¶
func (s *PowerEntity) MarshalParcel( p *parcel.Parcel, ) error
func (*PowerEntity) UnmarshalParcel ¶
func (s *PowerEntity) UnmarshalParcel( p *parcel.Parcel, ) error
type PowerStatsProxy ¶
func NewPowerStatsProxy ¶
func NewPowerStatsProxy( remote binder.IBinder, ) *PowerStatsProxy
func (*PowerStatsProxy) AsBinder ¶
func (p *PowerStatsProxy) AsBinder() binder.IBinder
func (*PowerStatsProxy) GetEnergyConsumed ¶
func (p *PowerStatsProxy) GetEnergyConsumed( ctx context.Context, energyConsumerIds []int32, ) ([]EnergyConsumerResult, error)
func (*PowerStatsProxy) GetEnergyConsumerInfo ¶
func (p *PowerStatsProxy) GetEnergyConsumerInfo( ctx context.Context, ) ([]EnergyConsumer, error)
func (*PowerStatsProxy) GetEnergyMeterInfo ¶
func (p *PowerStatsProxy) GetEnergyMeterInfo( ctx context.Context, ) ([]Channel, error)
func (*PowerStatsProxy) GetPowerEntityInfo ¶
func (p *PowerStatsProxy) GetPowerEntityInfo( ctx context.Context, ) ([]PowerEntity, error)
func (*PowerStatsProxy) GetStateResidency ¶
func (p *PowerStatsProxy) GetStateResidency( ctx context.Context, powerEntityIds []int32, ) ([]StateResidencyResult, error)
func (*PowerStatsProxy) ReadEnergyMeter ¶
func (p *PowerStatsProxy) ReadEnergyMeter( ctx context.Context, channelIds []int32, ) ([]EnergyMeasurement, error)
type PowerStatsStub ¶
type PowerStatsStub struct {
Impl IPowerStats
Transport binder.VersionAwareTransport
}
PowerStatsStub dispatches incoming binder transactions to a typed IPowerStats implementation.
func (*PowerStatsStub) Descriptor ¶
func (s *PowerStatsStub) Descriptor() string
func (*PowerStatsStub) OnTransaction ¶
func (s *PowerStatsStub) OnTransaction( ctx context.Context, code binder.TransactionCode, _data *parcel.Parcel, ) (*parcel.Parcel, error)
type StateResidency ¶
type StateResidency struct {
Id int32
TotalTimeInStateMs int64
TotalStateEntryCount int64
LastEntryTimestampMs int64
}
func (*StateResidency) MarshalParcel ¶
func (s *StateResidency) MarshalParcel( p *parcel.Parcel, ) error
func (*StateResidency) UnmarshalParcel ¶
func (s *StateResidency) UnmarshalParcel( p *parcel.Parcel, ) error
type StateResidencyResult ¶
type StateResidencyResult struct {
Id int32
StateResidencyData []StateResidency
}
func (*StateResidencyResult) MarshalParcel ¶
func (s *StateResidencyResult) MarshalParcel( p *parcel.Parcel, ) error
func (*StateResidencyResult) UnmarshalParcel ¶
func (s *StateResidencyResult) UnmarshalParcel( p *parcel.Parcel, ) error
Click to show internal directories.
Click to hide internal directories.