Merge "Move some constants from TrafficStatsConstants to NetworkStackConstants" am: e427565991 am: 40b438abcc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1625861 Change-Id: Ideb5a5abbd074a8c905861e902977c442317fc02
This commit is contained in:
@@ -540,7 +540,6 @@ filegroup {
|
|||||||
"core/java/com/android/internal/util/RingBufferIndices.java",
|
"core/java/com/android/internal/util/RingBufferIndices.java",
|
||||||
"core/java/com/android/internal/util/State.java",
|
"core/java/com/android/internal/util/State.java",
|
||||||
"core/java/com/android/internal/util/StateMachine.java",
|
"core/java/com/android/internal/util/StateMachine.java",
|
||||||
"core/java/com/android/internal/util/TrafficStatsConstants.java",
|
|
||||||
"core/java/com/android/internal/util/WakeupMessage.java",
|
"core/java/com/android/internal/util/WakeupMessage.java",
|
||||||
"core/java/com/android/internal/util/TokenBucket.java",
|
"core/java/com/android/internal/util/TokenBucket.java",
|
||||||
],
|
],
|
||||||
@@ -566,7 +565,6 @@ filegroup {
|
|||||||
"core/java/com/android/internal/util/MessageUtils.java",
|
"core/java/com/android/internal/util/MessageUtils.java",
|
||||||
"core/java/com/android/internal/util/State.java",
|
"core/java/com/android/internal/util/State.java",
|
||||||
"core/java/com/android/internal/util/StateMachine.java",
|
"core/java/com/android/internal/util/StateMachine.java",
|
||||||
"core/java/com/android/internal/util/TrafficStatsConstants.java",
|
|
||||||
"core/java/com/android/internal/util/WakeupMessage.java",
|
"core/java/com/android/internal/util/WakeupMessage.java",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,24 +21,8 @@ package com.android.internal.util;
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public class TrafficStatsConstants {
|
public class TrafficStatsConstants {
|
||||||
// These tags are used by the network stack to do traffic for its own purposes. Traffic
|
|
||||||
// tagged with these will be counted toward the network stack and must stay inside the
|
|
||||||
// range defined by
|
|
||||||
// {@link android.net.TrafficStats#TAG_NETWORK_STACK_RANGE_START} and
|
|
||||||
// {@link android.net.TrafficStats#TAG_NETWORK_STACK_RANGE_END}.
|
|
||||||
public static final int TAG_SYSTEM_DHCP = 0xFFFFFE01;
|
|
||||||
public static final int TAG_SYSTEM_NEIGHBOR = 0xFFFFFE02;
|
|
||||||
public static final int TAG_SYSTEM_DHCP_SERVER = 0xFFFFFE03;
|
|
||||||
|
|
||||||
public static final int TAG_SYSTEM_NTP = 0xFFFFFF41;
|
public static final int TAG_SYSTEM_NTP = 0xFFFFFF41;
|
||||||
public static final int TAG_SYSTEM_GPS = 0xFFFFFF44;
|
public static final int TAG_SYSTEM_GPS = 0xFFFFFF44;
|
||||||
public static final int TAG_SYSTEM_PAC = 0xFFFFFF45;
|
public static final int TAG_SYSTEM_PAC = 0xFFFFFF45;
|
||||||
|
|
||||||
// These tags are used by the network stack to do traffic on behalf of apps. Traffic
|
|
||||||
// tagged with these will be counted toward the app on behalf of which the network
|
|
||||||
// stack is doing this traffic. These values must stay inside the range defined by
|
|
||||||
// {@link android.net.TrafficStats#TAG_NETWORK_STACK_IMPERSONATION_RANGE_START} and
|
|
||||||
// {@link android.net.TrafficStats#TAG_NETWORK_STACK_IMPERSONATION_RANGE_END}.
|
|
||||||
public static final int TAG_SYSTEM_PROBE = 0xFFFFFF81;
|
|
||||||
public static final int TAG_SYSTEM_DNS = 0xFFFFFF82;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ import android.widget.ProgressBar;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.android.internal.util.ArrayUtils;
|
import com.android.internal.util.ArrayUtils;
|
||||||
import com.android.internal.util.TrafficStatsConstants;
|
import com.android.net.module.util.NetworkStackConstants;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
@@ -238,7 +238,7 @@ public class CaptivePortalLoginActivity extends Activity {
|
|||||||
HttpURLConnection urlConnection = null;
|
HttpURLConnection urlConnection = null;
|
||||||
int httpResponseCode = 500;
|
int httpResponseCode = 500;
|
||||||
int oldTag = TrafficStats.getAndSetThreadStatsTag(
|
int oldTag = TrafficStats.getAndSetThreadStatsTag(
|
||||||
TrafficStatsConstants.TAG_SYSTEM_PROBE);
|
NetworkStackConstants.TAG_SYSTEM_PROBE);
|
||||||
try {
|
try {
|
||||||
urlConnection = (HttpURLConnection) mNetwork.openConnection(
|
urlConnection = (HttpURLConnection) mNetwork.openConnection(
|
||||||
new URL(mCm.getCaptivePortalServerUrl()));
|
new URL(mCm.getCaptivePortalServerUrl()));
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import android.text.TextUtils;
|
|||||||
import android.util.Pair;
|
import android.util.Pair;
|
||||||
|
|
||||||
import com.android.internal.util.IndentingPrintWriter;
|
import com.android.internal.util.IndentingPrintWriter;
|
||||||
import com.android.internal.util.TrafficStatsConstants;
|
import com.android.net.module.util.NetworkStackConstants;
|
||||||
|
|
||||||
import libcore.io.IoUtils;
|
import libcore.io.IoUtils;
|
||||||
|
|
||||||
@@ -446,7 +446,7 @@ public class NetworkDiagnostics {
|
|||||||
int sockType, int protocol, long writeTimeout, long readTimeout, int dstPort)
|
int sockType, int protocol, long writeTimeout, long readTimeout, int dstPort)
|
||||||
throws ErrnoException, IOException {
|
throws ErrnoException, IOException {
|
||||||
final int oldTag = TrafficStats.getAndSetThreadStatsTag(
|
final int oldTag = TrafficStats.getAndSetThreadStatsTag(
|
||||||
TrafficStatsConstants.TAG_SYSTEM_PROBE);
|
NetworkStackConstants.TAG_SYSTEM_PROBE);
|
||||||
try {
|
try {
|
||||||
mFileDescriptor = Os.socket(mAddressFamily, sockType, protocol);
|
mFileDescriptor = Os.socket(mAddressFamily, sockType, protocol);
|
||||||
} finally {
|
} finally {
|
||||||
@@ -745,7 +745,7 @@ public class NetworkDiagnostics {
|
|||||||
if (ensureMeasurementNecessary()) return;
|
if (ensureMeasurementNecessary()) return;
|
||||||
|
|
||||||
// No need to restore the tag, since this thread is only used for this measurement.
|
// No need to restore the tag, since this thread is only used for this measurement.
|
||||||
TrafficStats.getAndSetThreadStatsTag(TrafficStatsConstants.TAG_SYSTEM_PROBE);
|
TrafficStats.getAndSetThreadStatsTag(NetworkStackConstants.TAG_SYSTEM_PROBE);
|
||||||
|
|
||||||
try (SSLSocket sslSocket = setupSSLSocket()) {
|
try (SSLSocket sslSocket = setupSSLSocket()) {
|
||||||
sendDoTProbe(sslSocket);
|
sendDoTProbe(sslSocket);
|
||||||
|
|||||||
Reference in New Issue
Block a user