Documentation
¶
Index ¶
- Constants
- type Boost
- type ChannelConfig
- type ChannelMessage
- type ChannelMessageChannelMessageContents
- func (u *ChannelMessageChannelMessageContents) GetHint() (SessionHint, bool)
- func (u *ChannelMessageChannelMessageContents) GetMode() (ChannelMessageChannelMessageContentsSessionModeSetter, bool)
- func (u *ChannelMessageChannelMessageContents) GetReserved() ([]int64, bool)
- func (u *ChannelMessageChannelMessageContents) GetTargetDuration() (int64, bool)
- func (u *ChannelMessageChannelMessageContents) GetWorkDuration() (WorkDurationFixedV1, bool)
- func (u *ChannelMessageChannelMessageContents) MarshalParcel(p *parcel.Parcel) error
- func (u *ChannelMessageChannelMessageContents) SetHint(v SessionHint)
- func (u *ChannelMessageChannelMessageContents) SetMode(v ChannelMessageChannelMessageContentsSessionModeSetter)
- func (u *ChannelMessageChannelMessageContents) SetReserved(v []int64)
- func (u *ChannelMessageChannelMessageContents) SetTargetDuration(v int64)
- func (u *ChannelMessageChannelMessageContents) SetWorkDuration(v WorkDurationFixedV1)
- func (u *ChannelMessageChannelMessageContents) UnmarshalParcel(p *parcel.Parcel) error
- type ChannelMessageChannelMessageContentsSessionModeSetter
- type IPower
- type IPowerHintSession
- type IPowerHintSessionServer
- type IPowerServer
- type Mode
- type PowerHintSessionProxy
- func (p *PowerHintSessionProxy) AsBinder() binder.IBinder
- func (p *PowerHintSessionProxy) Close(ctx context.Context) error
- func (p *PowerHintSessionProxy) GetSessionConfig(ctx context.Context) (SessionConfig, error)
- func (p *PowerHintSessionProxy) Pause(ctx context.Context) error
- func (p *PowerHintSessionProxy) ReportActualWorkDuration(ctx context.Context, durations []WorkDuration) error
- func (p *PowerHintSessionProxy) Resume(ctx context.Context) error
- func (p *PowerHintSessionProxy) SendHint(ctx context.Context, hint SessionHint) error
- func (p *PowerHintSessionProxy) SetMode(ctx context.Context, type_ SessionMode, enabled bool) error
- func (p *PowerHintSessionProxy) SetThreads(ctx context.Context, threadIds []int32) error
- func (p *PowerHintSessionProxy) UpdateTargetWorkDuration(ctx context.Context, targetDurationNanos int64) error
- type PowerHintSessionStub
- type PowerProxy
- func (p *PowerProxy) AsBinder() binder.IBinder
- func (p *PowerProxy) CloseSessionChannel(ctx context.Context, tgid int32, uid int32) error
- func (p *PowerProxy) CreateHintSession(ctx context.Context, tgid int32, uid int32, threadIds []int32, ...) (IPowerHintSession, error)
- func (p *PowerProxy) CreateHintSessionWithConfig(ctx context.Context, tgid int32, uid int32, threadIds []int32, ...) (IPowerHintSession, error)
- func (p *PowerProxy) GetHintSessionPreferredRate(ctx context.Context) (int64, error)
- func (p *PowerProxy) GetSessionChannel(ctx context.Context, tgid int32, uid int32) (ChannelConfig, error)
- func (p *PowerProxy) IsBoostSupported(ctx context.Context, type_ Boost) (bool, error)
- func (p *PowerProxy) IsModeSupported(ctx context.Context, type_ Mode) (bool, error)
- func (p *PowerProxy) SetBoost(ctx context.Context, type_ Boost, durationMs int32) error
- func (p *PowerProxy) SetMode(ctx context.Context, type_ Mode, enabled bool) error
- type PowerStub
- type SessionConfig
- type SessionHint
- type SessionMode
- type SessionTag
- type WorkDuration
- type WorkDurationFixedV1
Constants ¶
const ( ChannelMessageChannelMessageContentsTagReserved int32 = 0 ChannelMessageChannelMessageContentsTagTargetDuration int32 = 1 ChannelMessageChannelMessageContentsTagHint int32 = 2 ChannelMessageChannelMessageContentsTagMode int32 = 3 ChannelMessageChannelMessageContentsTagWorkDuration int32 = 4 )
const ( TransactionIPowerSetMode = binder.FirstCallTransaction + 0 TransactionIPowerIsModeSupported = binder.FirstCallTransaction + 1 TransactionIPowerSetBoost = binder.FirstCallTransaction + 2 TransactionIPowerIsBoostSupported = binder.FirstCallTransaction + 3 TransactionIPowerCreateHintSession = binder.FirstCallTransaction + 4 TransactionIPowerGetHintSessionPreferredRate = binder.FirstCallTransaction + 5 TransactionIPowerCreateHintSessionWithConfig = binder.FirstCallTransaction + 6 TransactionIPowerGetSessionChannel = binder.FirstCallTransaction + 7 TransactionIPowerCloseSessionChannel = binder.FirstCallTransaction + 8 )
const ( MethodIPowerSetMode = "setMode" MethodIPowerIsModeSupported = "isModeSupported" MethodIPowerSetBoost = "setBoost" MethodIPowerIsBoostSupported = "isBoostSupported" MethodIPowerCreateHintSession = "createHintSession" MethodIPowerGetHintSessionPreferredRate = "getHintSessionPreferredRate" MethodIPowerCreateHintSessionWithConfig = "createHintSessionWithConfig" MethodIPowerGetSessionChannel = "getSessionChannel" MethodIPowerCloseSessionChannel = "closeSessionChannel" )
const ( TransactionIPowerHintSessionUpdateTargetWorkDuration = binder.FirstCallTransaction + 0 TransactionIPowerHintSessionReportActualWorkDuration = binder.FirstCallTransaction + 1 TransactionIPowerHintSessionPause = binder.FirstCallTransaction + 2 TransactionIPowerHintSessionResume = binder.FirstCallTransaction + 3 TransactionIPowerHintSessionClose = binder.FirstCallTransaction + 4 TransactionIPowerHintSessionSendHint = binder.FirstCallTransaction + 5 TransactionIPowerHintSessionSetThreads = binder.FirstCallTransaction + 6 TransactionIPowerHintSessionSetMode = binder.FirstCallTransaction + 7 TransactionIPowerHintSessionGetSessionConfig = binder.FirstCallTransaction + 8 )
const ( MethodIPowerHintSessionUpdateTargetWorkDuration = "updateTargetWorkDuration" MethodIPowerHintSessionReportActualWorkDuration = "reportActualWorkDuration" MethodIPowerHintSessionPause = "pause" MethodIPowerHintSessionResume = "resume" MethodIPowerHintSessionClose = "close" MethodIPowerHintSessionSendHint = "sendHint" MethodIPowerHintSessionSetThreads = "setThreads" MethodIPowerHintSessionSetMode = "setMode" MethodIPowerHintSessionGetSessionConfig = "getSessionConfig" )
const DescriptorIPower = "android.hardware.power.IPower"
const DescriptorIPowerHintSession = "android.hardware.power.IPowerHintSession"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelConfig ¶
type ChannelConfig struct {
ChannelDescriptor fmq.MQDescriptor
EventFlagDescriptor *fmq.MQDescriptor
ReadFlagBitmask int32
WriteFlagBitmask int32
}
func (*ChannelConfig) MarshalParcel ¶
func (s *ChannelConfig) MarshalParcel( p *parcel.Parcel, ) error
func (*ChannelConfig) UnmarshalParcel ¶
func (s *ChannelConfig) UnmarshalParcel( p *parcel.Parcel, ) error
type ChannelMessage ¶
type ChannelMessage struct {
SessionID int32
TimeStampNanos int64
Data ChannelMessageChannelMessageContents
}
func (*ChannelMessage) MarshalParcel ¶
func (s *ChannelMessage) MarshalParcel( p *parcel.Parcel, ) error
func (*ChannelMessage) UnmarshalParcel ¶
func (s *ChannelMessage) UnmarshalParcel( p *parcel.Parcel, ) error
type ChannelMessageChannelMessageContents ¶
type ChannelMessageChannelMessageContents struct {
Tag int32
Reserved []int64
TargetDuration int64
Hint SessionHint
Mode ChannelMessageChannelMessageContentsSessionModeSetter
WorkDuration WorkDurationFixedV1
}
func (*ChannelMessageChannelMessageContents) GetHint ¶
func (u *ChannelMessageChannelMessageContents) GetHint() (SessionHint, bool)
func (*ChannelMessageChannelMessageContents) GetMode ¶
func (u *ChannelMessageChannelMessageContents) GetMode() (ChannelMessageChannelMessageContentsSessionModeSetter, bool)
func (*ChannelMessageChannelMessageContents) GetReserved ¶
func (u *ChannelMessageChannelMessageContents) GetReserved() ([]int64, bool)
func (*ChannelMessageChannelMessageContents) GetTargetDuration ¶
func (u *ChannelMessageChannelMessageContents) GetTargetDuration() (int64, bool)
func (*ChannelMessageChannelMessageContents) GetWorkDuration ¶
func (u *ChannelMessageChannelMessageContents) GetWorkDuration() (WorkDurationFixedV1, bool)
func (*ChannelMessageChannelMessageContents) MarshalParcel ¶
func (u *ChannelMessageChannelMessageContents) MarshalParcel( p *parcel.Parcel, ) error
func (*ChannelMessageChannelMessageContents) SetHint ¶
func (u *ChannelMessageChannelMessageContents) SetHint( v SessionHint, )
func (*ChannelMessageChannelMessageContents) SetMode ¶
func (u *ChannelMessageChannelMessageContents) SetMode( v ChannelMessageChannelMessageContentsSessionModeSetter, )
func (*ChannelMessageChannelMessageContents) SetReserved ¶
func (u *ChannelMessageChannelMessageContents) SetReserved( v []int64, )
func (*ChannelMessageChannelMessageContents) SetTargetDuration ¶
func (u *ChannelMessageChannelMessageContents) SetTargetDuration( v int64, )
func (*ChannelMessageChannelMessageContents) SetWorkDuration ¶
func (u *ChannelMessageChannelMessageContents) SetWorkDuration( v WorkDurationFixedV1, )
func (*ChannelMessageChannelMessageContents) UnmarshalParcel ¶
func (u *ChannelMessageChannelMessageContents) UnmarshalParcel( p *parcel.Parcel, ) error
type ChannelMessageChannelMessageContentsSessionModeSetter ¶
type ChannelMessageChannelMessageContentsSessionModeSetter struct {
ModeInt SessionMode
Enabled bool
}
func (*ChannelMessageChannelMessageContentsSessionModeSetter) MarshalParcel ¶
func (s *ChannelMessageChannelMessageContentsSessionModeSetter) MarshalParcel( p *parcel.Parcel, ) error
func (*ChannelMessageChannelMessageContentsSessionModeSetter) UnmarshalParcel ¶
func (s *ChannelMessageChannelMessageContentsSessionModeSetter) UnmarshalParcel( p *parcel.Parcel, ) error
type IPower ¶
type IPower interface {
AsBinder() binder.IBinder
SetMode(ctx context.Context, type_ Mode, enabled bool) error
IsModeSupported(ctx context.Context, type_ Mode) (bool, error)
SetBoost(ctx context.Context, type_ Boost, durationMs int32) error
IsBoostSupported(ctx context.Context, type_ Boost) (bool, error)
CreateHintSession(ctx context.Context, tgid int32, uid int32, threadIds []int32, durationNanos int64) (IPowerHintSession, error)
GetHintSessionPreferredRate(ctx context.Context) (int64, error)
CreateHintSessionWithConfig(ctx context.Context, tgid int32, uid int32, threadIds []int32, durationNanos int64, tag SessionTag, config SessionConfig) (IPowerHintSession, error)
GetSessionChannel(ctx context.Context, tgid int32, uid int32) (ChannelConfig, error)
CloseSessionChannel(ctx context.Context, tgid int32, uid int32) error
}
func NewPowerStub ¶
func NewPowerStub( impl IPowerServer, ) IPower
NewPowerStub creates a server-side IPower wrapping the given server implementation. The returned value satisfies IPower 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 IPowerHintSession ¶
type IPowerHintSession interface {
AsBinder() binder.IBinder
UpdateTargetWorkDuration(ctx context.Context, targetDurationNanos int64) error
ReportActualWorkDuration(ctx context.Context, durations []WorkDuration) error
Pause(ctx context.Context) error
Resume(ctx context.Context) error
Close(ctx context.Context) error
SendHint(ctx context.Context, hint SessionHint) error
SetThreads(ctx context.Context, threadIds []int32) error
SetMode(ctx context.Context, type_ SessionMode, enabled bool) error
GetSessionConfig(ctx context.Context) (SessionConfig, error)
}
func NewPowerHintSessionStub ¶
func NewPowerHintSessionStub( impl IPowerHintSessionServer, ) IPowerHintSession
NewPowerHintSessionStub creates a server-side IPowerHintSession wrapping the given server implementation. The returned value satisfies IPowerHintSession 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 IPowerHintSessionServer ¶
type IPowerHintSessionServer interface {
UpdateTargetWorkDuration(ctx context.Context, targetDurationNanos int64) error
ReportActualWorkDuration(ctx context.Context, durations []WorkDuration) error
Pause(ctx context.Context) error
Resume(ctx context.Context) error
Close(ctx context.Context) error
SendHint(ctx context.Context, hint SessionHint) error
SetThreads(ctx context.Context, threadIds []int32) error
SetMode(ctx context.Context, type_ SessionMode, enabled bool) error
GetSessionConfig(ctx context.Context) (SessionConfig, error)
}
IPowerHintSessionServer is the server-side interface that user implementations provide to NewPowerHintSessionStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).
type IPowerServer ¶
type IPowerServer interface {
SetMode(ctx context.Context, type_ Mode, enabled bool) error
IsModeSupported(ctx context.Context, type_ Mode) (bool, error)
SetBoost(ctx context.Context, type_ Boost, durationMs int32) error
IsBoostSupported(ctx context.Context, type_ Boost) (bool, error)
CreateHintSession(ctx context.Context, tgid int32, uid int32, threadIds []int32, durationNanos int64) (IPowerHintSession, error)
GetHintSessionPreferredRate(ctx context.Context) (int64, error)
CreateHintSessionWithConfig(ctx context.Context, tgid int32, uid int32, threadIds []int32, durationNanos int64, tag SessionTag, config SessionConfig) (IPowerHintSession, error)
GetSessionChannel(ctx context.Context, tgid int32, uid int32) (ChannelConfig, error)
CloseSessionChannel(ctx context.Context, tgid int32, uid int32) error
}
IPowerServer is the server-side interface that user implementations provide to NewPowerStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).
type Mode ¶
type Mode int32
const ( ModeDoubleTapToWake Mode = 0 ModeLowPower Mode = 1 ModeSustainedPerformance Mode = 2 ModeFixedPerformance Mode = 3 ModeVR Mode = 4 ModeLAUNCH Mode = 5 ModeExpensiveRendering Mode = 6 ModeINTERACTIVE Mode = 7 ModeDeviceIdle Mode = 8 ModeDisplayInactive Mode = 9 ModeAudioStreamingLowLatency Mode = 10 ModeCameraStreamingSecure Mode = 11 ModeCameraStreamingLow Mode = 12 ModeCameraStreamingMid Mode = 13 ModeCameraStreamingHigh Mode = 14 ModeGAME Mode = 15 ModeGameLoading Mode = 16 ModeDisplayChange Mode = 17 ModeAutomotiveProjection Mode = 18 )
type PowerHintSessionProxy ¶
func NewPowerHintSessionProxy ¶
func NewPowerHintSessionProxy( remote binder.IBinder, ) *PowerHintSessionProxy
func (*PowerHintSessionProxy) AsBinder ¶
func (p *PowerHintSessionProxy) AsBinder() binder.IBinder
func (*PowerHintSessionProxy) Close ¶
func (p *PowerHintSessionProxy) Close( ctx context.Context, ) error
func (*PowerHintSessionProxy) GetSessionConfig ¶
func (p *PowerHintSessionProxy) GetSessionConfig( ctx context.Context, ) (SessionConfig, error)
func (*PowerHintSessionProxy) Pause ¶
func (p *PowerHintSessionProxy) Pause( ctx context.Context, ) error
func (*PowerHintSessionProxy) ReportActualWorkDuration ¶
func (p *PowerHintSessionProxy) ReportActualWorkDuration( ctx context.Context, durations []WorkDuration, ) error
func (*PowerHintSessionProxy) Resume ¶
func (p *PowerHintSessionProxy) Resume( ctx context.Context, ) error
func (*PowerHintSessionProxy) SendHint ¶
func (p *PowerHintSessionProxy) SendHint( ctx context.Context, hint SessionHint, ) error
func (*PowerHintSessionProxy) SetMode ¶
func (p *PowerHintSessionProxy) SetMode( ctx context.Context, type_ SessionMode, enabled bool, ) error
func (*PowerHintSessionProxy) SetThreads ¶
func (p *PowerHintSessionProxy) SetThreads( ctx context.Context, threadIds []int32, ) error
func (*PowerHintSessionProxy) UpdateTargetWorkDuration ¶
func (p *PowerHintSessionProxy) UpdateTargetWorkDuration( ctx context.Context, targetDurationNanos int64, ) error
type PowerHintSessionStub ¶
type PowerHintSessionStub struct {
Impl IPowerHintSession
Transport binder.VersionAwareTransport
}
PowerHintSessionStub dispatches incoming binder transactions to a typed IPowerHintSession implementation.
func (*PowerHintSessionStub) Descriptor ¶
func (s *PowerHintSessionStub) Descriptor() string
func (*PowerHintSessionStub) OnTransaction ¶
func (s *PowerHintSessionStub) OnTransaction( ctx context.Context, code binder.TransactionCode, _data *parcel.Parcel, ) (*parcel.Parcel, error)
type PowerProxy ¶
func NewPowerProxy ¶
func NewPowerProxy( remote binder.IBinder, ) *PowerProxy
func (*PowerProxy) AsBinder ¶
func (p *PowerProxy) AsBinder() binder.IBinder
func (*PowerProxy) CloseSessionChannel ¶
func (*PowerProxy) CreateHintSession ¶
func (p *PowerProxy) CreateHintSession( ctx context.Context, tgid int32, uid int32, threadIds []int32, durationNanos int64, ) (IPowerHintSession, error)
func (*PowerProxy) CreateHintSessionWithConfig ¶
func (p *PowerProxy) CreateHintSessionWithConfig( ctx context.Context, tgid int32, uid int32, threadIds []int32, durationNanos int64, tag SessionTag, config SessionConfig, ) (IPowerHintSession, error)
func (*PowerProxy) GetHintSessionPreferredRate ¶
func (p *PowerProxy) GetHintSessionPreferredRate( ctx context.Context, ) (int64, error)
func (*PowerProxy) GetSessionChannel ¶
func (p *PowerProxy) GetSessionChannel( ctx context.Context, tgid int32, uid int32, ) (ChannelConfig, error)
func (*PowerProxy) IsBoostSupported ¶
func (*PowerProxy) IsModeSupported ¶
type PowerStub ¶
type PowerStub struct {
Impl IPower
Transport binder.VersionAwareTransport
}
PowerStub dispatches incoming binder transactions to a typed IPower implementation.
func (*PowerStub) Descriptor ¶
type SessionConfig ¶
type SessionConfig struct {
Id int64
}
func (*SessionConfig) MarshalParcel ¶
func (s *SessionConfig) MarshalParcel( p *parcel.Parcel, ) error
func (*SessionConfig) UnmarshalParcel ¶
func (s *SessionConfig) UnmarshalParcel( p *parcel.Parcel, ) error
type SessionHint ¶
type SessionHint int32
const ( SessionHintCpuLoadUp SessionHint = 0 SessionHintCpuLoadDown SessionHint = 1 SessionHintCpuLoadReset SessionHint = 2 SessionHintCpuLoadResume SessionHint = 3 SessionHintPowerEfficiency SessionHint = 4 SessionHintGpuLoadUp SessionHint = 5 SessionHintGpuLoadDown SessionHint = 6 SessionHintGpuLoadReset SessionHint = 7 )
type SessionTag ¶
type SessionTag int32
const ( SessionTagOTHER SessionTag = 0 SessionTagSURFACEFLINGER SessionTag = 1 SessionTagHWUI SessionTag = 2 SessionTagGAME SessionTag = 3 SessionTagAPP SessionTag = 4 )
type WorkDuration ¶
type WorkDuration struct {
TimeStampNanos int64
DurationNanos int64
WorkPeriodStartTimestampNanos int64
CpuDurationNanos int64
GpuDurationNanos int64
}
func (*WorkDuration) MarshalParcel ¶
func (s *WorkDuration) MarshalParcel( p *parcel.Parcel, ) error
func (*WorkDuration) UnmarshalParcel ¶
func (s *WorkDuration) UnmarshalParcel( p *parcel.Parcel, ) error
type WorkDurationFixedV1 ¶
type WorkDurationFixedV1 struct {
DurationNanos int64
WorkPeriodStartTimestampNanos int64
CpuDurationNanos int64
GpuDurationNanos int64
}
func (*WorkDurationFixedV1) MarshalParcel ¶
func (s *WorkDurationFixedV1) MarshalParcel( p *parcel.Parcel, ) error
func (*WorkDurationFixedV1) UnmarshalParcel ¶
func (s *WorkDurationFixedV1) UnmarshalParcel( p *parcel.Parcel, ) error