Skip to content

AppUsageProbe

Collects usage information on the apps installed on this device as AppUsage data.

Used for the AppsSamplingPackage.APP_USAGE measure. The period starts at the last time this probe collected data or, the first time, at HistoricSamplingConfiguration.past before now. The period ends now.

Only runs on Android, and needs the PACKAGE_USAGE_STATS permission.

Inheritance

Constructors

AppUsageProbe

AppUsageProbe()

Properties

samplingConfiguration

HistoricSamplingConfiguration get samplingConfiguration
override

The sampling configuration for this probe.

Configuration is obtained in the following order:

Returns null in case no configuration is found.

See also the section on Sampling schemes and configurations in the CARP Core Framework. In addition to CARP Core, CARP Mobile Sensing also supports sampling schemes in the sampling packages, which are used as the 4th possible configuration in the list above.

Methods

getMeasurement

Future<Measurement> getMeasurement()
override

Subclasses should implement this method to collect a Measurement.

Can return null if no data is available. Can return an Error measurement if an error occurs.