public
static
class
NetworkStats.Bucket
extends Object
java.lang.Object | |
↳ | android.app.usage.NetworkStats.Bucket |
Buckets are the smallest elements of a query result. As some dimensions of a result may be aggregated (e.g. time or state) some values may be equal across all buckets.
Constants | |
---|---|
int |
ROAMING_ALL
Combined usage across all roaming states. |
int |
ROAMING_NO
Usage that occurs on a home, non-roaming network. |
int |
ROAMING_YES
Usage that occurs on a roaming network. |
int |
STATE_ALL
Combined usage across all states. |
int |
STATE_DEFAULT
Usage not accounted for in any other state. |
int |
STATE_FOREGROUND
Foreground usage. |
int |
TAG_NONE
Special TAG value for total data across all tags |
int |
UID_ALL
Special UID value for aggregate/unspecified. |
int |
UID_REMOVED
Special UID value for removed apps. |
int |
UID_TETHERING
Special UID value for data usage by tethering. |
Public constructors | |
---|---|
NetworkStats.Bucket()
|
Public methods | |
---|---|
long
|
getEndTimeStamp()
End timestamp of the bucket's time interval. |
int
|
getRoaming()
Roaming state. |
long
|
getRxBytes()
Number of bytes received during the bucket's time interval. |
long
|
getRxPackets()
Number of packets received during the bucket's time interval. |
long
|
getStartTimeStamp()
Start timestamp of the bucket's time interval. |
int
|
getState()
Usage state. |
int
|
getTag()
Tag of the bucket. |
long
|
getTxBytes()
Number of bytes transmitted during the bucket's time interval. |
long
|
getTxPackets()
Number of packets transmitted during the bucket's time interval. |
int
|
getUid()
Key of the bucket. |
Inherited methods | |
---|---|
From
class
java.lang.Object
|
int ROAMING_ALL
Combined usage across all roaming states. Covers both roaming and non-roaming usage.
Constant Value: -1 (0xffffffff)
int ROAMING_NO
Usage that occurs on a home, non-roaming network.
Any cellular usage in this bucket was incurred while the device was connected to a tower owned or operated by the user's wireless carrier, or a tower that the user's wireless carrier has indicated should be treated as a home network regardless.
This is also the default value for network types that do not support roaming.
Constant Value: 1 (0x00000001)
int ROAMING_YES
Usage that occurs on a roaming network.
Any cellular usage in this bucket as incurred while the device was roaming on another carrier's network, for which additional charges may apply.
Constant Value: 2 (0x00000002)
int STATE_ALL
Combined usage across all states.
Constant Value: -1 (0xffffffff)
int STATE_DEFAULT
Usage not accounted for in any other state.
Constant Value: 1 (0x00000001)
int STATE_FOREGROUND
Foreground usage.
Constant Value: 2 (0x00000002)
int TAG_NONE
Special TAG value for total data across all tags
Constant Value: 0 (0x00000000)
int UID_ALL
Special UID value for aggregate/unspecified.
Constant Value: -1 (0xffffffff)
int UID_REMOVED
Special UID value for removed apps.
Constant Value: -4 (0xfffffffc)
int UID_TETHERING
Special UID value for data usage by tethering.
Constant Value: -5 (0xfffffffb)
long getEndTimeStamp ()
End timestamp of the bucket's time interval. Defined in terms of "Unix time", see
currentTimeMillis()
.
Returns | |
---|---|
long |
End of interval. |
int getRoaming ()
Roaming state. One of the following values:
Returns | |
---|---|
int |
long getRxBytes ()
Number of bytes received during the bucket's time interval. Statistics are measured at the network layer, so they include both TCP and UDP usage.
Returns | |
---|---|
long |
Number of bytes. |
long getRxPackets ()
Number of packets received during the bucket's time interval. Statistics are measured at the network layer, so they include both TCP and UDP usage.
Returns | |
---|---|
long |
Number of packets. |
long getStartTimeStamp ()
Start timestamp of the bucket's time interval. Defined in terms of "Unix time", see
currentTimeMillis()
.
Returns | |
---|---|
long |
Start of interval. |
int getState ()
Usage state. One of the following values:
Returns | |
---|---|
int |
Usage state. |
long getTxBytes ()
Number of bytes transmitted during the bucket's time interval. Statistics are measured at the network layer, so they include both TCP and UDP usage.
Returns | |
---|---|
long |
Number of bytes. |
long getTxPackets ()
Number of packets transmitted during the bucket's time interval. Statistics are measured at the network layer, so they include both TCP and UDP usage.
Returns | |
---|---|
long |
Number of packets. |
int getUid ()
Key of the bucket. Usually an app uid or one of the following special values:
Returns | |
---|---|
int |
Bucket key. |