public class RadioStateCollector extends SystemMetricsCollector<RadioStateMetrics>
When sending or receiving data, the RadioStateCollector
should be then notified to
ensure Radio state estimations are computed correctly.
Depending on the type of Active Network the Collector will attempt to estimate when Radio turns On and Off taking care of eventual tail time. The latter is the amount of time Radio might be kept active to preserve battery consumption and reduce latency of transition.
Constructor and Description |
---|
RadioStateCollector(Context context) |
Modifier and Type | Method and Description |
---|---|
RadioStateMetrics |
createMetrics()
Creates an empty instance of the corresponding system metrics.
|
boolean |
getSnapshot(RadioStateMetrics snapshot)
Note that access to snapshot instances is not synchronized and must be taken care of
by the caller requesting getSnapshot.
|
void |
onRadioActive(long startTimeMs,
long endTimeMs) |
void |
onRadioActiveNow() |
public boolean getSnapshot(RadioStateMetrics snapshot)
SystemMetricsCollector
getSnapshot
in class SystemMetricsCollector<RadioStateMetrics>
snapshot
- snapshot on which the data will be writtenpublic RadioStateMetrics createMetrics()
SystemMetricsCollector
Explicitly having this function available reduces a significant amount of boilerplate
createMetrics
in class SystemMetricsCollector<RadioStateMetrics>
public void onRadioActiveNow()
public void onRadioActive(long startTimeMs, long endTimeMs)