Move TrafficStats tags for the network stack constants

As per API council feedback, these constants should live in
a place that is private to the network stack, only with a
range defined in system API.

Bug: 129433383
Test: m
Change-Id: I84a90f84a9af6fef4667ee4d512ebd0413222086
(cherry picked from commit 79a6330650ca04bd7a08afbd63f8016a3b30bc72)
This commit is contained in:
Chalard Jean
2019-04-09 11:16:56 +09:00
parent 21dbd30681
commit 65081e4cf6

View File

@@ -89,6 +89,42 @@ public class TrafficStats {
*/
public static final int UID_TETHERING = -5;
/**
* Tag values in this range are reserved for the network stack. The network stack is
* running as UID {@link android.os.Process.NETWORK_STACK_UID} when in the mainline
* module separate process, and as the system UID otherwise.
*/
/** @hide */
@SystemApi
public static final int TAG_NETWORK_STACK_RANGE_START = 0xFFFFFD00;
/** @hide */
@SystemApi
public static final int TAG_NETWORK_STACK_RANGE_END = 0xFFFFFEFF;
/**
* Tags between 0xFFFFFF00 and 0xFFFFFFFF are reserved and used internally by system services
* like DownloadManager when performing traffic on behalf of an application.
*/
// Please note there is no enforcement of these constants, so do not rely on them to
// determine that the caller is a system caller.
/** @hide */
@SystemApi
public static final int TAG_SYSTEM_IMPERSONATION_RANGE_START = 0xFFFFFF00;
/** @hide */
@SystemApi
public static final int TAG_SYSTEM_IMPERSONATION_RANGE_END = 0xFFFFFF0F;
/**
* Tag values between these ranges are reserved for the network stack to do traffic
* on behalf of applications. It is a subrange of the range above.
*/
/** @hide */
@SystemApi
public static final int TAG_NETWORK_STACK_IMPERSONATION_RANGE_START = 0xFFFFFF80;
/** @hide */
@SystemApi
public static final int TAG_NETWORK_STACK_IMPERSONATION_RANGE_END = 0xFFFFFF8F;
/**
* Default tag value for {@link DownloadManager} traffic.
*
@@ -127,26 +163,9 @@ public class TrafficStats {
*/
public static final int TAG_SYSTEM_APP = 0xFFFFFF05;
// TODO : remove this constant when Wifi code is updated
/** @hide */
@SystemApi
@TestApi
public static final int TAG_SYSTEM_DHCP = 0xFFFFFF40;
/** @hide */
public static final int TAG_SYSTEM_NTP = 0xFFFFFF41;
/** @hide */
@SystemApi
@TestApi
public static final int TAG_SYSTEM_PROBE = 0xFFFFFF42;
/** @hide */
public static final int TAG_SYSTEM_NEIGHBOR = 0xFFFFFF43;
/** @hide */
public static final int TAG_SYSTEM_GPS = 0xFFFFFF44;
/** @hide */
public static final int TAG_SYSTEM_PAC = 0xFFFFFF45;
/** @hide */
@SystemApi
@TestApi
public static final int TAG_SYSTEM_DHCP_SERVER = 0xFFFFFF46;
private static INetworkStatsService sStatsService;