usage

package
v0.0.7 Latest Latest
Warning

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

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

Documentation

Overview

Package usage provides Go bindings for android.app.usage.

Index

Constants

View Source
const (
	Creator                             = consts.Creator
	ActivityPaused                      = consts.ActivityPaused
	ActivityResumed                     = consts.ActivityResumed
	ActivityStopped                     = consts.ActivityStopped
	ConfigurationChange                 = consts.ConfigurationChange
	DeviceShutdown                      = consts.DeviceShutdown
	DeviceStartup                       = consts.DeviceStartup
	ForegroundServiceStart              = consts.ForegroundServiceStart
	ForegroundServiceStop               = consts.ForegroundServiceStop
	KeyguardHidden                      = consts.KeyguardHidden
	KeyguardShown                       = consts.KeyguardShown
	MoveToBackground                    = consts.MoveToBackground
	MoveToForeground                    = consts.MoveToForeground
	None                                = consts.None
	ScreenInteractive                   = consts.ScreenInteractive
	ScreenNonInteractive                = consts.ScreenNonInteractive
	ShortcutInvocation                  = consts.ShortcutInvocation
	StandbyBucketChanged                = consts.StandbyBucketChanged
	UserInteraction                     = consts.UserInteraction
	DefaultNetworkAll                   = consts.DefaultNetworkAll
	DefaultNetworkNo                    = consts.DefaultNetworkNo
	DefaultNetworkYes                   = consts.DefaultNetworkYes
	MeteredAll                          = consts.MeteredAll
	MeteredNo                           = consts.MeteredNo
	MeteredYes                          = consts.MeteredYes
	RoamingAll                          = consts.RoamingAll
	RoamingNo                           = consts.RoamingNo
	RoamingYes                          = consts.RoamingYes
	StateAll                            = consts.StateAll
	StateDefault                        = consts.StateDefault
	StateForeground                     = consts.StateForeground
	TagNone                             = consts.TagNone
	UidAll                              = consts.UidAll
	UidRemoved                          = consts.UidRemoved
	UidTethering                        = consts.UidTethering
	IntervalBest                        = consts.IntervalBest
	IntervalDaily                       = consts.IntervalDaily
	IntervalMonthly                     = consts.IntervalMonthly
	IntervalWeekly                      = consts.IntervalWeekly
	IntervalYearly                      = consts.IntervalYearly
	StandbyBucketActive                 = consts.StandbyBucketActive
	StandbyBucketFrequent               = consts.StandbyBucketFrequent
	StandbyBucketRare                   = consts.StandbyBucketRare
	StandbyBucketRestricted             = consts.StandbyBucketRestricted
	StandbyBucketWorkingSet             = consts.StandbyBucketWorkingSet
	AppDataTypeFileTypeApk              = consts.AppDataTypeFileTypeApk
	AppDataTypeFileTypeCurrentProfile   = consts.AppDataTypeFileTypeCurrentProfile
	AppDataTypeFileTypeDexoptArtifact   = consts.AppDataTypeFileTypeDexoptArtifact
	AppDataTypeFileTypeDm               = consts.AppDataTypeFileTypeDm
	AppDataTypeFileTypeReferenceProfile = consts.AppDataTypeFileTypeReferenceProfile
	AppDataTypeLib                      = consts.AppDataTypeLib
)
View Source
const (
	ExtraEventAction   = consts.ExtraEventAction
	ExtraEventCategory = consts.ExtraEventCategory
)

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 ConfigurationStats added in v0.0.7

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

ConfigurationStats wraps android.app.usage.ConfigurationStats.

func NewConfigurationStats added in v0.0.7

func NewConfigurationStats(vm *jni.VM, arg0 *jni.Object) (*ConfigurationStats, error)

NewConfigurationStats creates a new android.app.usage.ConfigurationStats instance.

func (*ConfigurationStats) DescribeContents added in v0.0.7

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

DescribeContents calls android.app.usage.ConfigurationStats.describeContents.

func (*ConfigurationStats) GetActivationCount added in v0.0.7

func (m *ConfigurationStats) GetActivationCount() (int32, error)

GetActivationCount calls android.app.usage.ConfigurationStats.getActivationCount.

func (*ConfigurationStats) GetConfiguration added in v0.0.7

func (m *ConfigurationStats) GetConfiguration() (*jni.Object, error)

GetConfiguration calls android.app.usage.ConfigurationStats.getConfiguration.

func (*ConfigurationStats) GetFirstTimeStamp added in v0.0.7

func (m *ConfigurationStats) GetFirstTimeStamp() (int64, error)

GetFirstTimeStamp calls android.app.usage.ConfigurationStats.getFirstTimeStamp.

func (*ConfigurationStats) GetLastTimeActive added in v0.0.7

func (m *ConfigurationStats) GetLastTimeActive() (int64, error)

GetLastTimeActive calls android.app.usage.ConfigurationStats.getLastTimeActive.

func (*ConfigurationStats) GetLastTimeStamp added in v0.0.7

func (m *ConfigurationStats) GetLastTimeStamp() (int64, error)

GetLastTimeStamp calls android.app.usage.ConfigurationStats.getLastTimeStamp.

func (*ConfigurationStats) GetTotalTimeActive added in v0.0.7

func (m *ConfigurationStats) GetTotalTimeActive() (int64, error)

GetTotalTimeActive calls android.app.usage.ConfigurationStats.getTotalTimeActive.

func (*ConfigurationStats) WriteToParcel added in v0.0.7

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

WriteToParcel calls android.app.usage.ConfigurationStats.writeToParcel.

type EventStats added in v0.0.7

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

EventStats wraps android.app.usage.EventStats.

func NewEventStats added in v0.0.7

func NewEventStats(vm *jni.VM, arg0 *jni.Object) (*EventStats, error)

NewEventStats creates a new android.app.usage.EventStats instance.

func (*EventStats) Add added in v0.0.7

func (m *EventStats) Add(arg0 *jni.Object) error

Add calls android.app.usage.EventStats.add.

func (*EventStats) DescribeContents added in v0.0.7

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

DescribeContents calls android.app.usage.EventStats.describeContents.

func (*EventStats) GetCount added in v0.0.7

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

GetCount calls android.app.usage.EventStats.getCount.

func (*EventStats) GetEventType added in v0.0.7

func (m *EventStats) GetEventType() (int32, error)

GetEventType calls android.app.usage.EventStats.getEventType.

func (*EventStats) GetFirstTimeStamp added in v0.0.7

func (m *EventStats) GetFirstTimeStamp() (int64, error)

GetFirstTimeStamp calls android.app.usage.EventStats.getFirstTimeStamp.

func (*EventStats) GetLastEventTime added in v0.0.7

func (m *EventStats) GetLastEventTime() (int64, error)

GetLastEventTime calls android.app.usage.EventStats.getLastEventTime.

func (*EventStats) GetLastTimeStamp added in v0.0.7

func (m *EventStats) GetLastTimeStamp() (int64, error)

GetLastTimeStamp calls android.app.usage.EventStats.getLastTimeStamp.

func (*EventStats) GetTotalTime added in v0.0.7

func (m *EventStats) GetTotalTime() (int64, error)

GetTotalTime calls android.app.usage.EventStats.getTotalTime.

func (*EventStats) WriteToParcel added in v0.0.7

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

WriteToParcel calls android.app.usage.EventStats.writeToParcel.

type Events added in v0.0.7

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

Events wraps android.app.usage.UsageEvents.

func (*Events) DescribeContents added in v0.0.7

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

DescribeContents calls android.app.usage.UsageEvents.describeContents.

func (*Events) GetNextEvent added in v0.0.7

func (m *Events) GetNextEvent(arg0 *jni.Object) (bool, error)

GetNextEvent calls android.app.usage.UsageEvents.getNextEvent.

func (*Events) HasNextEvent added in v0.0.7

func (m *Events) HasNextEvent() (bool, error)

HasNextEvent calls android.app.usage.UsageEvents.hasNextEvent.

func (*Events) WriteToParcel added in v0.0.7

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

WriteToParcel calls android.app.usage.UsageEvents.writeToParcel.

type EventsEvent added in v0.0.7

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

EventsEvent wraps android.app.usage.UsageEvents$Event.

func (*EventsEvent) GetAppStandbyBucket added in v0.0.7

func (m *EventsEvent) GetAppStandbyBucket() (int32, error)

GetAppStandbyBucket calls android.app.usage.UsageEvents$Event.getAppStandbyBucket.

func (*EventsEvent) GetClassName added in v0.0.7

func (m *EventsEvent) GetClassName() (string, error)

GetClassName calls android.app.usage.UsageEvents$Event.getClassName.

func (*EventsEvent) GetConfiguration added in v0.0.7

func (m *EventsEvent) GetConfiguration() (*jni.Object, error)

GetConfiguration calls android.app.usage.UsageEvents$Event.getConfiguration.

func (*EventsEvent) GetEventType added in v0.0.7

func (m *EventsEvent) GetEventType() (int32, error)

GetEventType calls android.app.usage.UsageEvents$Event.getEventType.

func (*EventsEvent) GetExtras added in v0.0.7

func (m *EventsEvent) GetExtras() (*jni.Object, error)

GetExtras calls android.app.usage.UsageEvents$Event.getExtras.

func (*EventsEvent) GetPackageName added in v0.0.7

func (m *EventsEvent) GetPackageName() (string, error)

GetPackageName calls android.app.usage.UsageEvents$Event.getPackageName.

func (*EventsEvent) GetShortcutId added in v0.0.7

func (m *EventsEvent) GetShortcutId() (string, error)

GetShortcutId calls android.app.usage.UsageEvents$Event.getShortcutId.

func (*EventsEvent) GetTimeStamp added in v0.0.7

func (m *EventsEvent) GetTimeStamp() (int64, error)

GetTimeStamp calls android.app.usage.UsageEvents$Event.getTimeStamp.

type EventsQuery added in v0.0.7

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

EventsQuery wraps android.app.usage.UsageEventsQuery.

func (*EventsQuery) DescribeContents added in v0.0.7

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

DescribeContents calls android.app.usage.UsageEventsQuery.describeContents.

func (*EventsQuery) GetBeginTimeMillis added in v0.0.7

func (m *EventsQuery) GetBeginTimeMillis() (int64, error)

GetBeginTimeMillis calls android.app.usage.UsageEventsQuery.getBeginTimeMillis.

func (*EventsQuery) GetEndTimeMillis added in v0.0.7

func (m *EventsQuery) GetEndTimeMillis() (int64, error)

GetEndTimeMillis calls android.app.usage.UsageEventsQuery.getEndTimeMillis.

func (*EventsQuery) GetEventTypes added in v0.0.7

func (m *EventsQuery) GetEventTypes() (*jni.Object, error)

GetEventTypes calls android.app.usage.UsageEventsQuery.getEventTypes.

func (*EventsQuery) WriteToParcel added in v0.0.7

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

WriteToParcel calls android.app.usage.UsageEventsQuery.writeToParcel.

type EventsQueryBuilder added in v0.0.7

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

EventsQueryBuilder wraps android.app.usage.UsageEventsQuery$Builder.

func (*EventsQueryBuilder) Build added in v0.0.7

func (m *EventsQueryBuilder) Build() (*jni.Object, error)

Build calls android.app.usage.UsageEventsQuery$Builder.build.

func (*EventsQueryBuilder) SetEventTypes added in v0.0.7

func (m *EventsQueryBuilder) SetEventTypes(arg0 *jni.Object) (*jni.Object, error)

SetEventTypes calls android.app.usage.UsageEventsQuery$Builder.setEventTypes.

func (*EventsQueryBuilder) SetPackageNames added in v0.0.7

func (m *EventsQueryBuilder) SetPackageNames(arg0 *jni.Object) (*jni.Object, error)

SetPackageNames calls android.app.usage.UsageEventsQuery$Builder.setPackageNames.

type ExternalStorageStats added in v0.0.7

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

ExternalStorageStats wraps android.app.usage.ExternalStorageStats.

func (*ExternalStorageStats) DescribeContents added in v0.0.7

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

DescribeContents calls android.app.usage.ExternalStorageStats.describeContents.

func (*ExternalStorageStats) GetAppBytes added in v0.0.7

func (m *ExternalStorageStats) GetAppBytes() (int64, error)

GetAppBytes calls android.app.usage.ExternalStorageStats.getAppBytes.

func (*ExternalStorageStats) GetAudioBytes added in v0.0.7

func (m *ExternalStorageStats) GetAudioBytes() (int64, error)

GetAudioBytes calls android.app.usage.ExternalStorageStats.getAudioBytes.

func (*ExternalStorageStats) GetImageBytes added in v0.0.7

func (m *ExternalStorageStats) GetImageBytes() (int64, error)

GetImageBytes calls android.app.usage.ExternalStorageStats.getImageBytes.

func (*ExternalStorageStats) GetTotalBytes added in v0.0.7

func (m *ExternalStorageStats) GetTotalBytes() (int64, error)

GetTotalBytes calls android.app.usage.ExternalStorageStats.getTotalBytes.

func (*ExternalStorageStats) GetVideoBytes added in v0.0.7

func (m *ExternalStorageStats) GetVideoBytes() (int64, error)

GetVideoBytes calls android.app.usage.ExternalStorageStats.getVideoBytes.

func (*ExternalStorageStats) WriteToParcel added in v0.0.7

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

WriteToParcel calls android.app.usage.ExternalStorageStats.writeToParcel.

type NetworkStats added in v0.0.7

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

NetworkStats wraps android.app.usage.NetworkStats.

func (*NetworkStats) Close added in v0.0.7

func (m *NetworkStats) Close() error

Close calls android.app.usage.NetworkStats.close.

func (*NetworkStats) GetNextBucket added in v0.0.7

func (m *NetworkStats) GetNextBucket(arg0 *jni.Object) (bool, error)

GetNextBucket calls android.app.usage.NetworkStats.getNextBucket.

func (*NetworkStats) HasNextBucket added in v0.0.7

func (m *NetworkStats) HasNextBucket() (bool, error)

HasNextBucket calls android.app.usage.NetworkStats.hasNextBucket.

type NetworkStatsBucket added in v0.0.7

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

NetworkStatsBucket wraps android.app.usage.NetworkStats$Bucket.

func (*NetworkStatsBucket) GetDefaultNetworkStatus added in v0.0.7

func (m *NetworkStatsBucket) GetDefaultNetworkStatus() (int32, error)

GetDefaultNetworkStatus calls android.app.usage.NetworkStats$Bucket.getDefaultNetworkStatus.

func (*NetworkStatsBucket) GetEndTimeStamp added in v0.0.7

func (m *NetworkStatsBucket) GetEndTimeStamp() (int64, error)

GetEndTimeStamp calls android.app.usage.NetworkStats$Bucket.getEndTimeStamp.

func (*NetworkStatsBucket) GetMetered added in v0.0.7

func (m *NetworkStatsBucket) GetMetered() (int32, error)

GetMetered calls android.app.usage.NetworkStats$Bucket.getMetered.

func (*NetworkStatsBucket) GetRoaming added in v0.0.7

func (m *NetworkStatsBucket) GetRoaming() (int32, error)

GetRoaming calls android.app.usage.NetworkStats$Bucket.getRoaming.

func (*NetworkStatsBucket) GetRxBytes added in v0.0.7

func (m *NetworkStatsBucket) GetRxBytes() (int64, error)

GetRxBytes calls android.app.usage.NetworkStats$Bucket.getRxBytes.

func (*NetworkStatsBucket) GetRxPackets added in v0.0.7

func (m *NetworkStatsBucket) GetRxPackets() (int64, error)

GetRxPackets calls android.app.usage.NetworkStats$Bucket.getRxPackets.

func (*NetworkStatsBucket) GetStartTimeStamp added in v0.0.7

func (m *NetworkStatsBucket) GetStartTimeStamp() (int64, error)

GetStartTimeStamp calls android.app.usage.NetworkStats$Bucket.getStartTimeStamp.

func (*NetworkStatsBucket) GetState added in v0.0.7

func (m *NetworkStatsBucket) GetState() (int32, error)

GetState calls android.app.usage.NetworkStats$Bucket.getState.

func (*NetworkStatsBucket) GetTag added in v0.0.7

func (m *NetworkStatsBucket) GetTag() (int32, error)

GetTag calls android.app.usage.NetworkStats$Bucket.getTag.

func (*NetworkStatsBucket) GetTxBytes added in v0.0.7

func (m *NetworkStatsBucket) GetTxBytes() (int64, error)

GetTxBytes calls android.app.usage.NetworkStats$Bucket.getTxBytes.

func (*NetworkStatsBucket) GetTxPackets added in v0.0.7

func (m *NetworkStatsBucket) GetTxPackets() (int64, error)

GetTxPackets calls android.app.usage.NetworkStats$Bucket.getTxPackets.

func (*NetworkStatsBucket) GetUid added in v0.0.7

func (m *NetworkStatsBucket) GetUid() (int32, error)

GetUid calls android.app.usage.NetworkStats$Bucket.getUid.

type NetworkStatsManager added in v0.0.7

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

NetworkStatsManager wraps android.app.usage.NetworkStatsManager.

func NewNetworkStatsManager added in v0.0.7

func NewNetworkStatsManager(ctx *app.Context) (*NetworkStatsManager, error)

NewNetworkStatsManager obtains android.app.usage.NetworkStatsManager from the Android system service manager.

func (*NetworkStatsManager) Close added in v0.0.7

func (m *NetworkStatsManager) Close()

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

func (*NetworkStatsManager) QueryDetails added in v0.0.7

func (m *NetworkStatsManager) QueryDetails(
	arg0 int32,
	arg1 string,
	arg2 int64,
	arg3 int64,
) (*jni.Object, error)

QueryDetails calls android.app.usage.NetworkStatsManager.queryDetails.

func (*NetworkStatsManager) QueryDetailsForUid added in v0.0.7

func (m *NetworkStatsManager) QueryDetailsForUid(
	arg0 int32,
	arg1 string,
	arg2 int64,
	arg3 int64,
	arg4 int32,
) (*jni.Object, error)

QueryDetailsForUid calls android.app.usage.NetworkStatsManager.queryDetailsForUid.

func (*NetworkStatsManager) QueryDetailsForUidTag added in v0.0.7

func (m *NetworkStatsManager) QueryDetailsForUidTag(
	arg0 int32,
	arg1 string,
	arg2 int64,
	arg3 int64,
	arg4 int32,
	arg5 int32,
) (*jni.Object, error)

QueryDetailsForUidTag calls android.app.usage.NetworkStatsManager.queryDetailsForUidTag.

func (*NetworkStatsManager) QueryDetailsForUidTagState added in v0.0.7

func (m *NetworkStatsManager) QueryDetailsForUidTagState(
	arg0 int32,
	arg1 string,
	arg2 int64,
	arg3 int64,
	arg4 int32,
	arg5 int32,
	arg6 int32,
) (*jni.Object, error)

QueryDetailsForUidTagState calls android.app.usage.NetworkStatsManager.queryDetailsForUidTagState.

func (*NetworkStatsManager) QuerySummary added in v0.0.7

func (m *NetworkStatsManager) QuerySummary(
	arg0 int32,
	arg1 string,
	arg2 int64,
	arg3 int64,
) (*jni.Object, error)

QuerySummary calls android.app.usage.NetworkStatsManager.querySummary.

func (*NetworkStatsManager) QuerySummaryForDevice added in v0.0.7

func (m *NetworkStatsManager) QuerySummaryForDevice(
	arg0 int32,
	arg1 string,
	arg2 int64,
	arg3 int64,
) (*jni.Object, error)

QuerySummaryForDevice calls android.app.usage.NetworkStatsManager.querySummaryForDevice.

func (*NetworkStatsManager) QuerySummaryForUser added in v0.0.7

func (m *NetworkStatsManager) QuerySummaryForUser(
	arg0 int32,
	arg1 string,
	arg2 int64,
	arg3 int64,
) (*jni.Object, error)

QuerySummaryForUser calls android.app.usage.NetworkStatsManager.querySummaryForUser.

func (*NetworkStatsManager) RegisterUsageCallback added in v0.0.7

func (m *NetworkStatsManager) RegisterUsageCallback(
	arg0 int32,
	arg1 string,
	arg2 int64,
	arg3 *jni.Object,
) error

RegisterUsageCallback calls android.app.usage.NetworkStatsManager.registerUsageCallback.

func (*NetworkStatsManager) UnregisterUsageCallback added in v0.0.7

func (m *NetworkStatsManager) UnregisterUsageCallback(arg0 *jni.Object) error

UnregisterUsageCallback calls android.app.usage.NetworkStatsManager.unregisterUsageCallback.

type NetworkStatsManagerUsageCallback added in v0.0.7

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

NetworkStatsManagerUsageCallback wraps android.app.usage.NetworkStatsManager$UsageCallback.

func (*NetworkStatsManagerUsageCallback) OnThresholdReached added in v0.0.7

func (m *NetworkStatsManagerUsageCallback) OnThresholdReached(arg0 int32, arg1 string) error

OnThresholdReached calls android.app.usage.NetworkStatsManager$UsageCallback.onThresholdReached.

type Stats added in v0.0.4

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

Stats wraps android.app.usage.UsageStats.

func NewStats added in v0.0.7

func NewStats(vm *jni.VM, arg0 *jni.Object) (*Stats, error)

NewStats creates a new android.app.usage.UsageStats instance.

func (*Stats) Add added in v0.0.4

func (m *Stats) Add(arg0 *jni.Object) error

Add calls android.app.usage.UsageStats.add.

func (*Stats) DescribeContents added in v0.0.4

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

DescribeContents calls android.app.usage.UsageStats.describeContents.

func (*Stats) GetFirstTimeStamp added in v0.0.4

func (m *Stats) GetFirstTimeStamp() (int64, error)

GetFirstTimeStamp calls android.app.usage.UsageStats.getFirstTimeStamp.

func (*Stats) GetLastTimeForegroundServiceUsed added in v0.0.4

func (m *Stats) GetLastTimeForegroundServiceUsed() (int64, error)

GetLastTimeForegroundServiceUsed calls android.app.usage.UsageStats.getLastTimeForegroundServiceUsed.

func (*Stats) GetLastTimeStamp added in v0.0.4

func (m *Stats) GetLastTimeStamp() (int64, error)

GetLastTimeStamp calls android.app.usage.UsageStats.getLastTimeStamp.

func (*Stats) GetLastTimeUsed added in v0.0.4

func (m *Stats) GetLastTimeUsed() (int64, error)

GetLastTimeUsed calls android.app.usage.UsageStats.getLastTimeUsed.

func (*Stats) GetLastTimeVisible added in v0.0.4

func (m *Stats) GetLastTimeVisible() (int64, error)

GetLastTimeVisible calls android.app.usage.UsageStats.getLastTimeVisible.

func (*Stats) GetPackageName added in v0.0.4

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

GetPackageName calls android.app.usage.UsageStats.getPackageName.

func (*Stats) GetTotalTimeForegroundServiceUsed added in v0.0.4

func (m *Stats) GetTotalTimeForegroundServiceUsed() (int64, error)

GetTotalTimeForegroundServiceUsed calls android.app.usage.UsageStats.getTotalTimeForegroundServiceUsed.

func (*Stats) GetTotalTimeInForeground added in v0.0.4

func (m *Stats) GetTotalTimeInForeground() (int64, error)

GetTotalTimeInForeground calls android.app.usage.UsageStats.getTotalTimeInForeground.

func (*Stats) GetTotalTimeVisible added in v0.0.4

func (m *Stats) GetTotalTimeVisible() (int64, error)

GetTotalTimeVisible calls android.app.usage.UsageStats.getTotalTimeVisible.

func (*Stats) WriteToParcel added in v0.0.4

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

WriteToParcel calls android.app.usage.UsageStats.writeToParcel.

type StatsManager added in v0.0.4

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

StatsManager wraps android.app.usage.UsageStatsManager.

func NewStatsManager added in v0.0.4

func NewStatsManager(ctx *app.Context) (*StatsManager, error)

NewStatsManager obtains android.app.usage.UsageStatsManager from the Android system service manager.

func (*StatsManager) Close added in v0.0.4

func (m *StatsManager) Close()

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

func (*StatsManager) GetAppStandbyBucket added in v0.0.4

func (m *StatsManager) GetAppStandbyBucket() (int32, error)

GetAppStandbyBucket calls android.app.usage.UsageStatsManager.getAppStandbyBucket.

func (*StatsManager) IsAppInactive added in v0.0.4

func (m *StatsManager) IsAppInactive(arg0 string) (bool, error)

IsAppInactive calls android.app.usage.UsageStatsManager.isAppInactive.

func (*StatsManager) QueryEvents1 added in v0.0.4

func (m *StatsManager) QueryEvents1(arg0 *jni.Object) (*jni.Object, error)

QueryEvents1 calls android.app.usage.UsageStatsManager.queryEvents.

func (*StatsManager) QueryEvents2_1 added in v0.0.4

func (m *StatsManager) QueryEvents2_1(arg0 int64, arg1 int64) (*jni.Object, error)

QueryEvents2_1 calls android.app.usage.UsageStatsManager.queryEvents.

func (*StatsManager) QueryEventsForSelf added in v0.0.4

func (m *StatsManager) QueryEventsForSelf(arg0 int64, arg1 int64) (*jni.Object, error)

QueryEventsForSelf calls android.app.usage.UsageStatsManager.queryEventsForSelf.

type StorageStats added in v0.0.7

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

StorageStats wraps android.app.usage.StorageStats.

func (*StorageStats) DescribeContents added in v0.0.7

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

DescribeContents calls android.app.usage.StorageStats.describeContents.

func (*StorageStats) GetAppBytes added in v0.0.7

func (m *StorageStats) GetAppBytes() (int64, error)

GetAppBytes calls android.app.usage.StorageStats.getAppBytes.

func (*StorageStats) GetAppBytesByDataType added in v0.0.7

func (m *StorageStats) GetAppBytesByDataType(arg0 int32) (int64, error)

GetAppBytesByDataType calls android.app.usage.StorageStats.getAppBytesByDataType.

func (*StorageStats) GetCacheBytes added in v0.0.7

func (m *StorageStats) GetCacheBytes() (int64, error)

GetCacheBytes calls android.app.usage.StorageStats.getCacheBytes.

func (*StorageStats) GetDataBytes added in v0.0.7

func (m *StorageStats) GetDataBytes() (int64, error)

GetDataBytes calls android.app.usage.StorageStats.getDataBytes.

func (*StorageStats) GetExternalCacheBytes added in v0.0.7

func (m *StorageStats) GetExternalCacheBytes() (int64, error)

GetExternalCacheBytes calls android.app.usage.StorageStats.getExternalCacheBytes.

func (*StorageStats) WriteToParcel added in v0.0.7

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

WriteToParcel calls android.app.usage.StorageStats.writeToParcel.

type StorageStatsManager added in v0.0.7

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

StorageStatsManager wraps android.app.usage.StorageStatsManager.

func NewStorageStatsManager added in v0.0.7

func NewStorageStatsManager(ctx *app.Context) (*StorageStatsManager, error)

NewStorageStatsManager obtains android.app.usage.StorageStatsManager from the Android system service manager.

func (*StorageStatsManager) Close added in v0.0.7

func (m *StorageStatsManager) Close()

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

func (*StorageStatsManager) GetFreeBytes added in v0.0.7

func (m *StorageStatsManager) GetFreeBytes(arg0 *jni.Object) (int64, error)

GetFreeBytes calls android.app.usage.StorageStatsManager.getFreeBytes.

func (*StorageStatsManager) GetTotalBytes added in v0.0.7

func (m *StorageStatsManager) GetTotalBytes(arg0 *jni.Object) (int64, error)

GetTotalBytes calls android.app.usage.StorageStatsManager.getTotalBytes.

func (*StorageStatsManager) QueryExternalStatsForUser added in v0.0.7

func (m *StorageStatsManager) QueryExternalStatsForUser(arg0 *jni.Object, arg1 *jni.Object) (*jni.Object, error)

QueryExternalStatsForUser calls android.app.usage.StorageStatsManager.queryExternalStatsForUser.

func (*StorageStatsManager) QueryStatsForPackage added in v0.0.7

func (m *StorageStatsManager) QueryStatsForPackage(
	arg0 *jni.Object,
	arg1 string,
	arg2 *jni.Object,
) (*jni.Object, error)

QueryStatsForPackage calls android.app.usage.StorageStatsManager.queryStatsForPackage.

func (*StorageStatsManager) QueryStatsForUid added in v0.0.7

func (m *StorageStatsManager) QueryStatsForUid(arg0 *jni.Object, arg1 int32) (*jni.Object, error)

QueryStatsForUid calls android.app.usage.StorageStatsManager.queryStatsForUid.

func (*StorageStatsManager) QueryStatsForUser added in v0.0.7

func (m *StorageStatsManager) QueryStatsForUser(arg0 *jni.Object, arg1 *jni.Object) (*jni.Object, error)

QueryStatsForUser calls android.app.usage.StorageStatsManager.queryStatsForUser.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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