OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/android/traffic_stats.h" | 5 #include "net/android/traffic_stats.h" |
6 | 6 |
7 #include "jni/AndroidTrafficStats_jni.h" | 7 #include "jni/AndroidTrafficStats_jni.h" |
8 | 8 |
9 namespace net { | 9 namespace net { |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 *bytes = Java_AndroidTrafficStats_getCurrentUidTxBytes(env); | 36 *bytes = Java_AndroidTrafficStats_getCurrentUidTxBytes(env); |
37 return *bytes != ERROR_NOT_SUPPORTED; | 37 return *bytes != ERROR_NOT_SUPPORTED; |
38 } | 38 } |
39 | 39 |
40 bool GetCurrentUidRxBytes(int64_t* bytes) { | 40 bool GetCurrentUidRxBytes(int64_t* bytes) { |
41 JNIEnv* env = base::android::AttachCurrentThread(); | 41 JNIEnv* env = base::android::AttachCurrentThread(); |
42 *bytes = Java_AndroidTrafficStats_getCurrentUidRxBytes(env); | 42 *bytes = Java_AndroidTrafficStats_getCurrentUidRxBytes(env); |
43 return *bytes != ERROR_NOT_SUPPORTED; | 43 return *bytes != ERROR_NOT_SUPPORTED; |
44 } | 44 } |
45 | 45 |
46 bool Register(JNIEnv* env) { | |
47 return RegisterNativesImpl(env); | |
48 } | |
49 | |
50 } // namespace traffic_stats | 46 } // namespace traffic_stats |
51 | 47 |
52 } // namespace android | 48 } // namespace android |
53 | 49 |
54 } // namespace net | 50 } // namespace net |
OLD | NEW |