Skip to content

Commit 24d19fb

Browse files
committed
Revert "API to adjust network stats."
1 parent 8ab8fbb commit 24d19fb

File tree

3 files changed

+0
-39
lines changed

3 files changed

+0
-39
lines changed

core/java/android/net/INetworkStatsService.aidl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,4 @@ interface INetworkStatsService {
4545
/** Advise persistance threshold; may be overridden internally. */
4646
void advisePersistThreshold(long thresholdBytes);
4747

48-
/** Adjust recorded network stats. */
49-
void adjustNetworkStats(int uid, int tag, long rxBytes, long rxPackets, long txBytes, long txPackets, long operationCount);
50-
5148
}

core/java/android/net/TrafficStats.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,6 @@ public class TrafficStats {
8888
*/
8989
public static final int TAG_SYSTEM_BACKUP = 0xFFFFFF03;
9090

91-
/**
92-
* Default tag value for cloud messaging traffic.
93-
*
94-
* @hide
95-
*/
96-
public static final int TAG_SYSTEM_CLOUD_MESSAGING = 0xFFFFFF04;
97-
9891
private static INetworkStatsService sStatsService;
9992

10093
private synchronized static INetworkStatsService getStatsService() {
@@ -253,27 +246,6 @@ public static void incrementOperationCount(int tag, int operationCount) {
253246
}
254247
}
255248

256-
/**
257-
* Adjust network statistics for the given UID and tag by the requested
258-
* amount. This can be used to correctly account network usage performed on
259-
* behalf of another application. Values can be negative.
260-
* <p>
261-
* Requires that caller holds
262-
* {@link android.Manifest.permission#MODIFY_NETWORK_ACCOUNTING} permission.
263-
*
264-
* @see #setThreadStatsUid(int)
265-
* @hide
266-
*/
267-
public static void adjustNetworkStats(int uid, int tag, long rxBytes, long rxPackets,
268-
long txBytes, long txPackets, long operationCount) {
269-
try {
270-
getStatsService().adjustNetworkStats(
271-
uid, tag, rxBytes, rxPackets, txBytes, txPackets, operationCount);
272-
} catch (RemoteException e) {
273-
throw new RuntimeException(e);
274-
}
275-
}
276-
277249
/** {@hide} */
278250
public static void closeQuietly(INetworkStatsSession session) {
279251
// TODO: move to NetworkStatsService once it exists

services/java/com/android/server/net/NetworkStatsService.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -695,14 +695,6 @@ private void updatePersistThresholds() {
695695
mGlobalAlertBytes = mSettings.getGlobalAlertBytes(mPersistThreshold);
696696
}
697697

698-
@Override
699-
public void adjustNetworkStats(int uid, int tag, long rxBytes, long rxPackets, long txBytes,
700-
long txPackets, long operationCount) {
701-
mContext.enforceCallingOrSelfPermission(MODIFY_NETWORK_ACCOUNTING, TAG);
702-
703-
// TODO: store adjusted network stats in separate data structure
704-
}
705-
706698
/**
707699
* Receiver that watches for {@link IConnectivityManager} to claim network
708700
* interfaces. Used to associate {@link TelephonyManager#getSubscriberId()}

0 commit comments

Comments
 (0)