Introduce socket stats tag for restore traffic
As well as system API for emplacing it. Change-Id: If33fbd23552261efe3b00d75c22ff823564f43e6
This commit is contained in:
@@ -87,12 +87,21 @@ public class TrafficStats {
|
|||||||
public static final int TAG_SYSTEM_MEDIA = 0xFFFFFF02;
|
public static final int TAG_SYSTEM_MEDIA = 0xFFFFFF02;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default tag value for {@link BackupManager} traffic.
|
* Default tag value for {@link BackupManager} backup traffic; that is,
|
||||||
|
* traffic from the device to the storage backend.
|
||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public static final int TAG_SYSTEM_BACKUP = 0xFFFFFF03;
|
public static final int TAG_SYSTEM_BACKUP = 0xFFFFFF03;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default tag value for {@link BackupManager} restore traffic; that is,
|
||||||
|
* app data retrieved from the storage backend at install time.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final int TAG_SYSTEM_RESTORE = 0xFFFFFF04;
|
||||||
|
|
||||||
private static INetworkStatsService sStatsService;
|
private static INetworkStatsService sStatsService;
|
||||||
|
|
||||||
private synchronized static INetworkStatsService getStatsService() {
|
private synchronized static INetworkStatsService getStatsService() {
|
||||||
@@ -141,6 +150,16 @@ public class TrafficStats {
|
|||||||
setThreadStatsTag(TAG_SYSTEM_BACKUP);
|
setThreadStatsTag(TAG_SYSTEM_BACKUP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* System API for restore-related support components to tag network traffic
|
||||||
|
* appropriately.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@SystemApi
|
||||||
|
public static void setThreadStatsTagRestore() {
|
||||||
|
setThreadStatsTag(TAG_SYSTEM_RESTORE);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the active tag used when accounting {@link Socket} traffic originating
|
* Get the active tag used when accounting {@link Socket} traffic originating
|
||||||
* from the current thread. Only one active tag per thread is supported.
|
* from the current thread. Only one active tag per thread is supported.
|
||||||
|
|||||||
Reference in New Issue
Block a user