1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef NET_ANDROID_TRAFFIC_STATS_H_
6 #define NET_ANDROID_TRAFFIC_STATS_H_
8 // This file provides functions that interact with TrafficStats APIs that are
9 // provided on Android.
14 #include "net/base/net_export.h"
20 namespace traffic_stats
{
22 // Returns true if the number of bytes transmitted since device boot is
23 // available and sets |*bytes| to that value. Counts packets across all network
24 // interfaces, and always increases monotonically since device boot.
25 // Statistics are measured at the network layer, so they include both TCP and
26 // UDP usage. |bytes| must not be nullptr.
27 NET_EXPORT
bool GetTotalTxBytes(int64_t* bytes
);
29 bool Register(JNIEnv
* env
);
31 } // namespace traffic_stats
33 } // namespace android
37 #endif // NET_ANDROID_TRAFFIC_STATS_H_