Snap for 4716599 from 08d79be6bdd098a1adef6c3f707a4b8169f3ada2 to pi-release
Change-Id: I0a608654cdf67f3a56d0b8894f5458d212cb59d7
This commit is contained in:
@@ -237,20 +237,26 @@ public final class NetworkStats implements AutoCloseable {
|
|||||||
DEFAULT_NETWORK_YES
|
DEFAULT_NETWORK_YES
|
||||||
})
|
})
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
public @interface DefaultNetwork {}
|
public @interface DefaultNetworkStatus {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Combined usage for this network regardless of whether it was the active default network.
|
* Combined usage for this network regardless of default network status.
|
||||||
*/
|
*/
|
||||||
public static final int DEFAULT_NETWORK_ALL = -1;
|
public static final int DEFAULT_NETWORK_ALL = -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Usage that occurs while this network is not the active default network.
|
* Usage that occurs while this network is not a default network.
|
||||||
|
*
|
||||||
|
* <p>This implies that the app responsible for this usage requested that it occur on a
|
||||||
|
* specific network different from the one(s) the system would have selected for it.
|
||||||
*/
|
*/
|
||||||
public static final int DEFAULT_NETWORK_NO = 0x1;
|
public static final int DEFAULT_NETWORK_NO = 0x1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Usage that occurs while this network is the active default network.
|
* Usage that occurs while this network is a default network.
|
||||||
|
*
|
||||||
|
* <p>This implies that the app either did not select a specific network for this usage,
|
||||||
|
* or it selected a network that the system could have selected for app traffic.
|
||||||
*/
|
*/
|
||||||
public static final int DEFAULT_NETWORK_YES = 0x2;
|
public static final int DEFAULT_NETWORK_YES = 0x2;
|
||||||
|
|
||||||
@@ -262,7 +268,7 @@ public final class NetworkStats implements AutoCloseable {
|
|||||||
private int mUid;
|
private int mUid;
|
||||||
private int mTag;
|
private int mTag;
|
||||||
private int mState;
|
private int mState;
|
||||||
private int mDefaultNetwork;
|
private int mDefaultNetworkStatus;
|
||||||
private int mMetered;
|
private int mMetered;
|
||||||
private int mRoaming;
|
private int mRoaming;
|
||||||
private long mBeginTimeStamp;
|
private long mBeginTimeStamp;
|
||||||
@@ -323,8 +329,9 @@ public final class NetworkStats implements AutoCloseable {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static @DefaultNetwork int convertDefaultNetwork(int defaultNetwork) {
|
private static @DefaultNetworkStatus int convertDefaultNetworkStatus(
|
||||||
switch (defaultNetwork) {
|
int defaultNetworkStatus) {
|
||||||
|
switch (defaultNetworkStatus) {
|
||||||
case android.net.NetworkStats.DEFAULT_NETWORK_ALL : return DEFAULT_NETWORK_ALL;
|
case android.net.NetworkStats.DEFAULT_NETWORK_ALL : return DEFAULT_NETWORK_ALL;
|
||||||
case android.net.NetworkStats.DEFAULT_NETWORK_NO: return DEFAULT_NETWORK_NO;
|
case android.net.NetworkStats.DEFAULT_NETWORK_NO: return DEFAULT_NETWORK_NO;
|
||||||
case android.net.NetworkStats.DEFAULT_NETWORK_YES: return DEFAULT_NETWORK_YES;
|
case android.net.NetworkStats.DEFAULT_NETWORK_YES: return DEFAULT_NETWORK_YES;
|
||||||
@@ -397,18 +404,15 @@ public final class NetworkStats implements AutoCloseable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default network state. One of the following values:<p/>
|
* Default network status. One of the following values:<p/>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>{@link #DEFAULT_NETWORK_ALL}</li>
|
* <li>{@link #DEFAULT_NETWORK_ALL}</li>
|
||||||
* <li>{@link #DEFAULT_NETWORK_NO}</li>
|
* <li>{@link #DEFAULT_NETWORK_NO}</li>
|
||||||
* <li>{@link #DEFAULT_NETWORK_YES}</li>
|
* <li>{@link #DEFAULT_NETWORK_YES}</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* <p>Indicates whether the network usage occurred on the system default network for this
|
|
||||||
* type of traffic, or whether the application chose to send this traffic on a network that
|
|
||||||
* was not the one selected by the system.
|
|
||||||
*/
|
*/
|
||||||
public @DefaultNetwork int getDefaultNetwork() {
|
public @DefaultNetworkStatus int getDefaultNetworkStatus() {
|
||||||
return mDefaultNetwork;
|
return mDefaultNetworkStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -605,7 +609,7 @@ public final class NetworkStats implements AutoCloseable {
|
|||||||
bucketOut.mUid = Bucket.convertUid(mRecycledSummaryEntry.uid);
|
bucketOut.mUid = Bucket.convertUid(mRecycledSummaryEntry.uid);
|
||||||
bucketOut.mTag = Bucket.convertTag(mRecycledSummaryEntry.tag);
|
bucketOut.mTag = Bucket.convertTag(mRecycledSummaryEntry.tag);
|
||||||
bucketOut.mState = Bucket.convertState(mRecycledSummaryEntry.set);
|
bucketOut.mState = Bucket.convertState(mRecycledSummaryEntry.set);
|
||||||
bucketOut.mDefaultNetwork = Bucket.convertDefaultNetwork(
|
bucketOut.mDefaultNetworkStatus = Bucket.convertDefaultNetworkStatus(
|
||||||
mRecycledSummaryEntry.defaultNetwork);
|
mRecycledSummaryEntry.defaultNetwork);
|
||||||
bucketOut.mMetered = Bucket.convertMetered(mRecycledSummaryEntry.metered);
|
bucketOut.mMetered = Bucket.convertMetered(mRecycledSummaryEntry.metered);
|
||||||
bucketOut.mRoaming = Bucket.convertRoaming(mRecycledSummaryEntry.roaming);
|
bucketOut.mRoaming = Bucket.convertRoaming(mRecycledSummaryEntry.roaming);
|
||||||
@@ -657,7 +661,7 @@ public final class NetworkStats implements AutoCloseable {
|
|||||||
bucketOut.mUid = Bucket.convertUid(getUid());
|
bucketOut.mUid = Bucket.convertUid(getUid());
|
||||||
bucketOut.mTag = Bucket.convertTag(mTag);
|
bucketOut.mTag = Bucket.convertTag(mTag);
|
||||||
bucketOut.mState = mState;
|
bucketOut.mState = mState;
|
||||||
bucketOut.mDefaultNetwork = Bucket.DEFAULT_NETWORK_ALL;
|
bucketOut.mDefaultNetworkStatus = Bucket.DEFAULT_NETWORK_ALL;
|
||||||
bucketOut.mMetered = Bucket.METERED_ALL;
|
bucketOut.mMetered = Bucket.METERED_ALL;
|
||||||
bucketOut.mRoaming = Bucket.ROAMING_ALL;
|
bucketOut.mRoaming = Bucket.ROAMING_ALL;
|
||||||
bucketOut.mBeginTimeStamp = mRecycledHistoryEntry.bucketStart;
|
bucketOut.mBeginTimeStamp = mRecycledHistoryEntry.bucketStart;
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import static com.android.internal.util.Preconditions.checkNotNull;
|
|||||||
import android.annotation.IntDef;
|
import android.annotation.IntDef;
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.RequiresPermission;
|
import android.annotation.RequiresPermission;
|
||||||
import android.annotation.SystemApi;
|
|
||||||
import android.annotation.SystemService;
|
import android.annotation.SystemService;
|
||||||
import android.annotation.TestApi;
|
import android.annotation.TestApi;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -666,7 +665,6 @@ public final class IpSecManager {
|
|||||||
* to create Network objects which are accessible to the Android system.
|
* to create Network objects which are accessible to the Android system.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
|
||||||
public static final class IpSecTunnelInterface implements AutoCloseable {
|
public static final class IpSecTunnelInterface implements AutoCloseable {
|
||||||
private final String mOpPackageName;
|
private final String mOpPackageName;
|
||||||
private final IIpSecService mService;
|
private final IIpSecService mService;
|
||||||
@@ -693,7 +691,6 @@ public final class IpSecManager {
|
|||||||
* @param prefixLen length of the InetAddress prefix
|
* @param prefixLen length of the InetAddress prefix
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
|
||||||
@RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS)
|
@RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS)
|
||||||
public void addAddress(@NonNull InetAddress address, int prefixLen) throws IOException {
|
public void addAddress(@NonNull InetAddress address, int prefixLen) throws IOException {
|
||||||
try {
|
try {
|
||||||
@@ -713,7 +710,6 @@ public final class IpSecManager {
|
|||||||
* @param prefixLen length of the InetAddress prefix
|
* @param prefixLen length of the InetAddress prefix
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
|
||||||
@RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS)
|
@RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS)
|
||||||
public void removeAddress(@NonNull InetAddress address, int prefixLen) throws IOException {
|
public void removeAddress(@NonNull InetAddress address, int prefixLen) throws IOException {
|
||||||
try {
|
try {
|
||||||
@@ -809,7 +805,6 @@ public final class IpSecManager {
|
|||||||
* @throws ResourceUnavailableException indicating that too many encapsulation sockets are open
|
* @throws ResourceUnavailableException indicating that too many encapsulation sockets are open
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS)
|
@RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS)
|
||||||
public IpSecTunnelInterface createIpSecTunnelInterface(@NonNull InetAddress localAddress,
|
public IpSecTunnelInterface createIpSecTunnelInterface(@NonNull InetAddress localAddress,
|
||||||
@@ -836,7 +831,6 @@ public final class IpSecManager {
|
|||||||
* layer failure.
|
* layer failure.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
|
||||||
@RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS)
|
@RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS)
|
||||||
public void applyTunnelModeTransform(@NonNull IpSecTunnelInterface tunnel,
|
public void applyTunnelModeTransform(@NonNull IpSecTunnelInterface tunnel,
|
||||||
@PolicyDirection int direction, @NonNull IpSecTransform transform) throws IOException {
|
@PolicyDirection int direction, @NonNull IpSecTransform transform) throws IOException {
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import static com.android.internal.util.Preconditions.checkNotNull;
|
|||||||
import android.annotation.IntDef;
|
import android.annotation.IntDef;
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.RequiresPermission;
|
import android.annotation.RequiresPermission;
|
||||||
import android.annotation.SystemApi;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Binder;
|
import android.os.Binder;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
@@ -250,7 +249,6 @@ public final class IpSecTransform implements AutoCloseable {
|
|||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
|
||||||
public static class NattKeepaliveCallback {
|
public static class NattKeepaliveCallback {
|
||||||
/** The specified {@code Network} is not connected. */
|
/** The specified {@code Network} is not connected. */
|
||||||
public static final int ERROR_INVALID_NETWORK = 1;
|
public static final int ERROR_INVALID_NETWORK = 1;
|
||||||
@@ -281,7 +279,6 @@ public final class IpSecTransform implements AutoCloseable {
|
|||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
|
||||||
@RequiresPermission(anyOf = {
|
@RequiresPermission(anyOf = {
|
||||||
android.Manifest.permission.MANAGE_IPSEC_TUNNELS,
|
android.Manifest.permission.MANAGE_IPSEC_TUNNELS,
|
||||||
android.Manifest.permission.PACKET_KEEPALIVE_OFFLOAD
|
android.Manifest.permission.PACKET_KEEPALIVE_OFFLOAD
|
||||||
@@ -324,7 +321,6 @@ public final class IpSecTransform implements AutoCloseable {
|
|||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
|
||||||
@RequiresPermission(anyOf = {
|
@RequiresPermission(anyOf = {
|
||||||
android.Manifest.permission.MANAGE_IPSEC_TUNNELS,
|
android.Manifest.permission.MANAGE_IPSEC_TUNNELS,
|
||||||
android.Manifest.permission.PACKET_KEEPALIVE_OFFLOAD
|
android.Manifest.permission.PACKET_KEEPALIVE_OFFLOAD
|
||||||
@@ -477,7 +473,6 @@ public final class IpSecTransform implements AutoCloseable {
|
|||||||
* @throws IOException indicating other errors
|
* @throws IOException indicating other errors
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS)
|
@RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS)
|
||||||
public IpSecTransform buildTunnelModeTransform(
|
public IpSecTransform buildTunnelModeTransform(
|
||||||
|
|||||||
Reference in New Issue
Block a user