blob: 08344050f4e7c461baedca8a05ec227c3b5bb1b1 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.server;
18
19import android.content.Context;
Ken Shirriff1719a392009-12-07 15:57:35 -080020import android.net.TrafficStats;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080021import android.os.INetStatService;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080022
23public class NetStatService extends INetStatService.Stub {
24
25 public NetStatService(Context context) {
26
27 }
28
29 public long getMobileTxPackets() {
Ken Shirriff1719a392009-12-07 15:57:35 -080030 return TrafficStats.getMobileTxPkts();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080031 }
32
33 public long getMobileRxPackets() {
Ken Shirriff1719a392009-12-07 15:57:35 -080034 return TrafficStats.getMobileRxPkts();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080035 }
36
37 public long getMobileTxBytes() {
Ken Shirriff1719a392009-12-07 15:57:35 -080038 return TrafficStats.getMobileTxBytes();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080039 }
40
41 public long getMobileRxBytes() {
Ken Shirriff1719a392009-12-07 15:57:35 -080042 return TrafficStats.getMobileRxBytes();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080043 }
44
45 public long getTotalTxPackets() {
Ken Shirriff1719a392009-12-07 15:57:35 -080046 return TrafficStats.getTotalTxPkts();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080047 }
48
49 public long getTotalRxPackets() {
Ken Shirriff1719a392009-12-07 15:57:35 -080050 return TrafficStats.getTotalRxPkts();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080051 }
52
53 public long getTotalTxBytes() {
Ken Shirriff1719a392009-12-07 15:57:35 -080054 return TrafficStats.getTotalTxBytes();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080055 }
56
57 public long getTotalRxBytes() {
Ken Shirriff1719a392009-12-07 15:57:35 -080058 return TrafficStats.getTotalRxBytes();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080059 }
60}