Package org.robolectric.shadows
Class ShadowStatsManager
java.lang.Object
org.robolectric.shadows.ShadowStatsManager
@Implements(value=android.app.StatsManager.class,
isInAndroidSdk=false,
minSdk=28)
public class ShadowStatsManager
extends Object
Shadow for
StatsManager.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA key used to store the configKey and subscriberId in the broadcastSubscriberMap. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddConfig(long configKey, byte[] config) static voidaddReportData(long configKey, byte[] data) Adds metrics data that the shadow should return fromStatsManager.getReports(long).Retrieves the broadcast subscriber map stored in the shadow as a result of.invalid reference
StatsManager#setBroadcastSubscriber()static byte[]getConfigData(long configKey) Retrieves the statsd configurations stored in the shadow as a result ofStatsManager.addConfig(long, byte[])andStatsManager.removeConfig(long).protected long[]protected byte[]getReports(long configKey) protected byte[]protected voidremoveConfig(long configKey) static voidreset()protected voidsetBroadcastSubscriber(PendingIntent pendingIntent, long configKey, long subscriberId) static voidsetRegisteredExperimentIds(long[] experimentIds) Sets the registered experiment ids that the shadow should return fromStatsManager.getRegisteredExperimentIds().static voidsetStatsMetadata(byte[] metadata) Sets the statsd metadata that the shadow should return fromStatsManager.getStatsMetadata().
-
Constructor Details
-
ShadowStatsManager
public ShadowStatsManager()
-
-
Method Details
-
reset
-
addReportData
public static void addReportData(long configKey, byte[] data) Adds metrics data that the shadow should return fromStatsManager.getReports(long). -
setStatsMetadata
public static void setStatsMetadata(byte[] metadata) Sets the statsd metadata that the shadow should return fromStatsManager.getStatsMetadata(). -
setRegisteredExperimentIds
public static void setRegisteredExperimentIds(long[] experimentIds) Sets the registered experiment ids that the shadow should return fromStatsManager.getRegisteredExperimentIds(). -
getConfigData
public static byte[] getConfigData(long configKey) Retrieves the statsd configurations stored in the shadow as a result ofStatsManager.addConfig(long, byte[])andStatsManager.removeConfig(long). -
getBroadcastSubscriberMap
public static Map<ShadowStatsManager.BroadcastSubscriberKey,PendingIntent> getBroadcastSubscriberMap()Retrieves the broadcast subscriber map stored in the shadow as a result of.invalid reference
StatsManager#setBroadcastSubscriber()- Returns:
- A map where the keys are
ShadowStatsManager.BroadcastSubscriberKeyobjects, which contain the configKey and subscriberId, and the values arePendingIntentobjects.
-
getReports
-
getStatsMetadata
-
addConfig
-
removeConfig
-
setBroadcastSubscriber
@Implementation protected void setBroadcastSubscriber(PendingIntent pendingIntent, long configKey, long subscriberId) -
getRegisteredExperimentIds
-