public class ConnectivityMetricsLogger extends Object
Modifier and Type | Field and Description |
---|---|
static int |
COMPONENT_TAG_BLUETOOTH |
static int |
COMPONENT_TAG_CONNECTIVITY |
static int |
COMPONENT_TAG_TELECOM |
static int |
COMPONENT_TAG_TELEPHONY |
static int |
COMPONENT_TAG_WIFI |
static String |
CONNECTIVITY_METRICS_LOGGER_SERVICE |
static String |
DATA_KEY_EVENTS_COUNT |
protected IConnectivityMetricsLogger |
mService |
protected long |
mServiceUnblockedTimestampMillis |
static int |
NUMBER_OF_COMPONENTS |
static int |
TAG_SKIPPED_EVENTS |
Constructor and Description |
---|
ConnectivityMetricsLogger() |
ConnectivityMetricsLogger(IConnectivityMetricsLogger service) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkLoggerService() |
ConnectivityMetricsEvent[] |
getEvents(ConnectivityMetricsEvent.Reference reference)
Retrieve events
|
void |
logEvent(long timestamp,
int componentTag,
int eventTag,
Parcelable data)
Log a ConnectivityMetricsEvent.
|
boolean |
register(PendingIntent newEventsIntent)
Register PendingIntent which will be sent when new events are ready to be retrieved.
|
boolean |
unregister(PendingIntent newEventsIntent) |
public static final String CONNECTIVITY_METRICS_LOGGER_SERVICE
public static final int COMPONENT_TAG_CONNECTIVITY
public static final int COMPONENT_TAG_BLUETOOTH
public static final int COMPONENT_TAG_WIFI
public static final int COMPONENT_TAG_TELECOM
public static final int COMPONENT_TAG_TELEPHONY
public static final int NUMBER_OF_COMPONENTS
public static final int TAG_SKIPPED_EVENTS
public static final String DATA_KEY_EVENTS_COUNT
protected IConnectivityMetricsLogger mService
protected volatile long mServiceUnblockedTimestampMillis
public ConnectivityMetricsLogger()
public ConnectivityMetricsLogger(IConnectivityMetricsLogger service)
protected boolean checkLoggerService()
public void logEvent(long timestamp, int componentTag, int eventTag, Parcelable data)
timestamp
- is the epoch timestamp of the event in ms.componentTag
- is the COMPONENT_* constant the event belongs to.eventTag
- is an event type constant whose meaning is specific to the component tag.data
- is a Parcelable instance representing the event.public ConnectivityMetricsEvent[] getEvents(ConnectivityMetricsEvent.Reference reference)
reference
- of the last event previously returned. The function will return
events following it.
If 0 then all events will be returned.
After the function call it will contain reference of the
last returned event.public boolean register(PendingIntent newEventsIntent)
public boolean unregister(PendingIntent newEventsIntent)