API to adjust network stats. DO NOT MERGE.

Enables system apps to correctly account network usage performed on
behalf of another application.

Bug: 6695246
Change-Id: I39e243afd57936b6b30157a6ca511a17b6c55c39
This commit is contained in:
Jeff Sharkey
2012-07-27 17:35:32 -07:00
parent e94ac8b67e
commit 6615400fe8
3 changed files with 39 additions and 0 deletions

View File

@@ -695,6 +695,14 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
mGlobalAlertBytes = mSettings.getGlobalAlertBytes(mPersistThreshold);
}
@Override
public void adjustNetworkStats(int uid, int tag, long rxBytes, long rxPackets, long txBytes,
long txPackets, long operationCount) {
mContext.enforceCallingOrSelfPermission(MODIFY_NETWORK_ACCOUNTING, TAG);
// TODO: store adjusted network stats in separate data structure
}
/**
* Receiver that watches for {@link IConnectivityManager} to claim network
* interfaces. Used to associate {@link TelephonyManager#getSubscriberId()}