1*344a7f5eSAndroid Build Coastguard Worker// Signature format: 2.0 2*344a7f5eSAndroid Build Coastguard Workerpackage android.app.usage { 3*344a7f5eSAndroid Build Coastguard Worker 4*344a7f5eSAndroid Build Coastguard Worker public class NetworkStatsManager { 5*344a7f5eSAndroid Build Coastguard Worker method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STATS_PROVIDER, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void registerNetworkStatsProvider(@NonNull String, @NonNull android.net.netstats.provider.NetworkStatsProvider); 6*344a7f5eSAndroid Build Coastguard Worker method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STATS_PROVIDER, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void unregisterNetworkStatsProvider(@NonNull android.net.netstats.provider.NetworkStatsProvider); 7*344a7f5eSAndroid Build Coastguard Worker } 8*344a7f5eSAndroid Build Coastguard Worker 9*344a7f5eSAndroid Build Coastguard Worker} 10*344a7f5eSAndroid Build Coastguard Worker 11*344a7f5eSAndroid Build Coastguard Workerpackage android.nearby { 12*344a7f5eSAndroid Build Coastguard Worker 13*344a7f5eSAndroid Build Coastguard Worker public interface BroadcastCallback { 14*344a7f5eSAndroid Build Coastguard Worker method public void onStatusChanged(int); 15*344a7f5eSAndroid Build Coastguard Worker field public static final int STATUS_FAILURE = 1; // 0x1 16*344a7f5eSAndroid Build Coastguard Worker field public static final int STATUS_FAILURE_ALREADY_REGISTERED = 2; // 0x2 17*344a7f5eSAndroid Build Coastguard Worker field public static final int STATUS_FAILURE_MISSING_PERMISSIONS = 4; // 0x4 18*344a7f5eSAndroid Build Coastguard Worker field public static final int STATUS_FAILURE_SIZE_EXCEED_LIMIT = 3; // 0x3 19*344a7f5eSAndroid Build Coastguard Worker field public static final int STATUS_OK = 0; // 0x0 20*344a7f5eSAndroid Build Coastguard Worker } 21*344a7f5eSAndroid Build Coastguard Worker 22*344a7f5eSAndroid Build Coastguard Worker public abstract class BroadcastRequest { 23*344a7f5eSAndroid Build Coastguard Worker method @NonNull public java.util.List<java.lang.Integer> getMediums(); 24*344a7f5eSAndroid Build Coastguard Worker method @IntRange(from=0xffffff81, to=126) public int getTxPower(); 25*344a7f5eSAndroid Build Coastguard Worker method public int getType(); 26*344a7f5eSAndroid Build Coastguard Worker method public int getVersion(); 27*344a7f5eSAndroid Build Coastguard Worker field public static final int BROADCAST_TYPE_NEARBY_PRESENCE = 3; // 0x3 28*344a7f5eSAndroid Build Coastguard Worker field public static final int BROADCAST_TYPE_UNKNOWN = -1; // 0xffffffff 29*344a7f5eSAndroid Build Coastguard Worker field public static final int MEDIUM_BLE = 1; // 0x1 30*344a7f5eSAndroid Build Coastguard Worker field public static final int PRESENCE_VERSION_UNKNOWN = -1; // 0xffffffff 31*344a7f5eSAndroid Build Coastguard Worker field public static final int PRESENCE_VERSION_V0 = 0; // 0x0 32*344a7f5eSAndroid Build Coastguard Worker field public static final int PRESENCE_VERSION_V1 = 1; // 0x1 33*344a7f5eSAndroid Build Coastguard Worker field public static final int UNKNOWN_TX_POWER = -127; // 0xffffff81 34*344a7f5eSAndroid Build Coastguard Worker } 35*344a7f5eSAndroid Build Coastguard Worker 36*344a7f5eSAndroid Build Coastguard Worker public final class CredentialElement implements android.os.Parcelable { 37*344a7f5eSAndroid Build Coastguard Worker ctor public CredentialElement(@NonNull String, @NonNull byte[]); 38*344a7f5eSAndroid Build Coastguard Worker method public int describeContents(); 39*344a7f5eSAndroid Build Coastguard Worker method @NonNull public String getKey(); 40*344a7f5eSAndroid Build Coastguard Worker method @NonNull public byte[] getValue(); 41*344a7f5eSAndroid Build Coastguard Worker method public void writeToParcel(@NonNull android.os.Parcel, int); 42*344a7f5eSAndroid Build Coastguard Worker field @NonNull public static final android.os.Parcelable.Creator<android.nearby.CredentialElement> CREATOR; 43*344a7f5eSAndroid Build Coastguard Worker } 44*344a7f5eSAndroid Build Coastguard Worker 45*344a7f5eSAndroid Build Coastguard Worker public final class DataElement implements android.os.Parcelable { 46*344a7f5eSAndroid Build Coastguard Worker ctor public DataElement(int, @NonNull byte[]); 47*344a7f5eSAndroid Build Coastguard Worker method public int describeContents(); 48*344a7f5eSAndroid Build Coastguard Worker method public int getKey(); 49*344a7f5eSAndroid Build Coastguard Worker method @NonNull public byte[] getValue(); 50*344a7f5eSAndroid Build Coastguard Worker method public void writeToParcel(@NonNull android.os.Parcel, int); 51*344a7f5eSAndroid Build Coastguard Worker field @NonNull public static final android.os.Parcelable.Creator<android.nearby.DataElement> CREATOR; 52*344a7f5eSAndroid Build Coastguard Worker } 53*344a7f5eSAndroid Build Coastguard Worker 54*344a7f5eSAndroid Build Coastguard Worker public abstract class NearbyDevice { 55*344a7f5eSAndroid Build Coastguard Worker method @NonNull public java.util.List<java.lang.Integer> getMediums(); 56*344a7f5eSAndroid Build Coastguard Worker method @Nullable public String getName(); 57*344a7f5eSAndroid Build Coastguard Worker method @IntRange(from=0xffffff81, to=126) public int getRssi(); 58*344a7f5eSAndroid Build Coastguard Worker method public static boolean isValidMedium(int); 59*344a7f5eSAndroid Build Coastguard Worker } 60*344a7f5eSAndroid Build Coastguard Worker 61*344a7f5eSAndroid Build Coastguard Worker public class NearbyManager { 62*344a7f5eSAndroid Build Coastguard Worker method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_ADVERTISE, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void startBroadcast(@NonNull android.nearby.BroadcastRequest, @NonNull java.util.concurrent.Executor, @NonNull android.nearby.BroadcastCallback); 63*344a7f5eSAndroid Build Coastguard Worker method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int startScan(@NonNull android.nearby.ScanRequest, @NonNull java.util.concurrent.Executor, @NonNull android.nearby.ScanCallback); 64*344a7f5eSAndroid Build Coastguard Worker method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_ADVERTISE, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void stopBroadcast(@NonNull android.nearby.BroadcastCallback); 65*344a7f5eSAndroid Build Coastguard Worker method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void stopScan(@NonNull android.nearby.ScanCallback); 66*344a7f5eSAndroid Build Coastguard Worker } 67*344a7f5eSAndroid Build Coastguard Worker 68*344a7f5eSAndroid Build Coastguard Worker public final class PresenceBroadcastRequest extends android.nearby.BroadcastRequest implements android.os.Parcelable { 69*344a7f5eSAndroid Build Coastguard Worker method public int describeContents(); 70*344a7f5eSAndroid Build Coastguard Worker method @NonNull public java.util.List<java.lang.Integer> getActions(); 71*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PrivateCredential getCredential(); 72*344a7f5eSAndroid Build Coastguard Worker method @NonNull public java.util.List<android.nearby.DataElement> getExtendedProperties(); 73*344a7f5eSAndroid Build Coastguard Worker method @NonNull public byte[] getSalt(); 74*344a7f5eSAndroid Build Coastguard Worker method public void writeToParcel(@NonNull android.os.Parcel, int); 75*344a7f5eSAndroid Build Coastguard Worker field @NonNull public static final android.os.Parcelable.Creator<android.nearby.PresenceBroadcastRequest> CREATOR; 76*344a7f5eSAndroid Build Coastguard Worker } 77*344a7f5eSAndroid Build Coastguard Worker 78*344a7f5eSAndroid Build Coastguard Worker public static final class PresenceBroadcastRequest.Builder { 79*344a7f5eSAndroid Build Coastguard Worker ctor public PresenceBroadcastRequest.Builder(@NonNull java.util.List<java.lang.Integer>, @NonNull byte[], @NonNull android.nearby.PrivateCredential); 80*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PresenceBroadcastRequest.Builder addAction(@IntRange(from=1, to=255) int); 81*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PresenceBroadcastRequest.Builder addExtendedProperty(@NonNull android.nearby.DataElement); 82*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PresenceBroadcastRequest build(); 83*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PresenceBroadcastRequest.Builder setTxPower(@IntRange(from=0xffffff81, to=126) int); 84*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PresenceBroadcastRequest.Builder setVersion(int); 85*344a7f5eSAndroid Build Coastguard Worker } 86*344a7f5eSAndroid Build Coastguard Worker 87*344a7f5eSAndroid Build Coastguard Worker public abstract class PresenceCredential { 88*344a7f5eSAndroid Build Coastguard Worker method @NonNull public byte[] getAuthenticityKey(); 89*344a7f5eSAndroid Build Coastguard Worker method @NonNull public java.util.List<android.nearby.CredentialElement> getCredentialElements(); 90*344a7f5eSAndroid Build Coastguard Worker method public int getIdentityType(); 91*344a7f5eSAndroid Build Coastguard Worker method @NonNull public byte[] getSecretId(); 92*344a7f5eSAndroid Build Coastguard Worker method public int getType(); 93*344a7f5eSAndroid Build Coastguard Worker field public static final int CREDENTIAL_TYPE_PRIVATE = 0; // 0x0 94*344a7f5eSAndroid Build Coastguard Worker field public static final int CREDENTIAL_TYPE_PUBLIC = 1; // 0x1 95*344a7f5eSAndroid Build Coastguard Worker field public static final int IDENTITY_TYPE_PRIVATE = 1; // 0x1 96*344a7f5eSAndroid Build Coastguard Worker field public static final int IDENTITY_TYPE_PROVISIONED = 2; // 0x2 97*344a7f5eSAndroid Build Coastguard Worker field public static final int IDENTITY_TYPE_TRUSTED = 3; // 0x3 98*344a7f5eSAndroid Build Coastguard Worker field public static final int IDENTITY_TYPE_UNKNOWN = 0; // 0x0 99*344a7f5eSAndroid Build Coastguard Worker } 100*344a7f5eSAndroid Build Coastguard Worker 101*344a7f5eSAndroid Build Coastguard Worker public final class PresenceDevice extends android.nearby.NearbyDevice implements android.os.Parcelable { 102*344a7f5eSAndroid Build Coastguard Worker method public int describeContents(); 103*344a7f5eSAndroid Build Coastguard Worker method @NonNull public String getDeviceId(); 104*344a7f5eSAndroid Build Coastguard Worker method @Nullable public String getDeviceImageUrl(); 105*344a7f5eSAndroid Build Coastguard Worker method public int getDeviceType(); 106*344a7f5eSAndroid Build Coastguard Worker method public long getDiscoveryTimestampMillis(); 107*344a7f5eSAndroid Build Coastguard Worker method @NonNull public byte[] getEncryptedIdentity(); 108*344a7f5eSAndroid Build Coastguard Worker method @NonNull public java.util.List<android.nearby.DataElement> getExtendedProperties(); 109*344a7f5eSAndroid Build Coastguard Worker method @NonNull public byte[] getSalt(); 110*344a7f5eSAndroid Build Coastguard Worker method @NonNull public byte[] getSecretId(); 111*344a7f5eSAndroid Build Coastguard Worker method public void writeToParcel(@NonNull android.os.Parcel, int); 112*344a7f5eSAndroid Build Coastguard Worker field @NonNull public static final android.os.Parcelable.Creator<android.nearby.PresenceDevice> CREATOR; 113*344a7f5eSAndroid Build Coastguard Worker } 114*344a7f5eSAndroid Build Coastguard Worker 115*344a7f5eSAndroid Build Coastguard Worker public static final class PresenceDevice.Builder { 116*344a7f5eSAndroid Build Coastguard Worker ctor public PresenceDevice.Builder(@NonNull String, @NonNull byte[], @NonNull byte[], @NonNull byte[]); 117*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PresenceDevice.Builder addExtendedProperty(@NonNull android.nearby.DataElement); 118*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PresenceDevice.Builder addMedium(int); 119*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PresenceDevice build(); 120*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PresenceDevice.Builder setDeviceImageUrl(@Nullable String); 121*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PresenceDevice.Builder setDeviceType(int); 122*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PresenceDevice.Builder setDiscoveryTimestampMillis(long); 123*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PresenceDevice.Builder setName(@Nullable String); 124*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PresenceDevice.Builder setRssi(int); 125*344a7f5eSAndroid Build Coastguard Worker } 126*344a7f5eSAndroid Build Coastguard Worker 127*344a7f5eSAndroid Build Coastguard Worker public final class PresenceScanFilter extends android.nearby.ScanFilter implements android.os.Parcelable { 128*344a7f5eSAndroid Build Coastguard Worker method public int describeContents(); 129*344a7f5eSAndroid Build Coastguard Worker method @NonNull public java.util.List<android.nearby.PublicCredential> getCredentials(); 130*344a7f5eSAndroid Build Coastguard Worker method @NonNull public java.util.List<android.nearby.DataElement> getExtendedProperties(); 131*344a7f5eSAndroid Build Coastguard Worker method @NonNull public java.util.List<java.lang.Integer> getPresenceActions(); 132*344a7f5eSAndroid Build Coastguard Worker method public void writeToParcel(@NonNull android.os.Parcel, int); 133*344a7f5eSAndroid Build Coastguard Worker field @NonNull public static final android.os.Parcelable.Creator<android.nearby.PresenceScanFilter> CREATOR; 134*344a7f5eSAndroid Build Coastguard Worker } 135*344a7f5eSAndroid Build Coastguard Worker 136*344a7f5eSAndroid Build Coastguard Worker public static final class PresenceScanFilter.Builder { 137*344a7f5eSAndroid Build Coastguard Worker ctor public PresenceScanFilter.Builder(); 138*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PresenceScanFilter.Builder addCredential(@NonNull android.nearby.PublicCredential); 139*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PresenceScanFilter.Builder addExtendedProperty(@NonNull android.nearby.DataElement); 140*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PresenceScanFilter.Builder addPresenceAction(@IntRange(from=1, to=255) int); 141*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PresenceScanFilter build(); 142*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PresenceScanFilter.Builder setMaxPathLoss(@IntRange(from=0, to=127) int); 143*344a7f5eSAndroid Build Coastguard Worker } 144*344a7f5eSAndroid Build Coastguard Worker 145*344a7f5eSAndroid Build Coastguard Worker public final class PrivateCredential extends android.nearby.PresenceCredential implements android.os.Parcelable { 146*344a7f5eSAndroid Build Coastguard Worker method public int describeContents(); 147*344a7f5eSAndroid Build Coastguard Worker method @NonNull public String getDeviceName(); 148*344a7f5eSAndroid Build Coastguard Worker method @NonNull public byte[] getMetadataEncryptionKey(); 149*344a7f5eSAndroid Build Coastguard Worker method public void writeToParcel(@NonNull android.os.Parcel, int); 150*344a7f5eSAndroid Build Coastguard Worker field @NonNull public static final android.os.Parcelable.Creator<android.nearby.PrivateCredential> CREATOR; 151*344a7f5eSAndroid Build Coastguard Worker } 152*344a7f5eSAndroid Build Coastguard Worker 153*344a7f5eSAndroid Build Coastguard Worker public static final class PrivateCredential.Builder { 154*344a7f5eSAndroid Build Coastguard Worker ctor public PrivateCredential.Builder(@NonNull byte[], @NonNull byte[], @NonNull byte[], @NonNull String); 155*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PrivateCredential.Builder addCredentialElement(@NonNull android.nearby.CredentialElement); 156*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PrivateCredential build(); 157*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PrivateCredential.Builder setIdentityType(int); 158*344a7f5eSAndroid Build Coastguard Worker } 159*344a7f5eSAndroid Build Coastguard Worker 160*344a7f5eSAndroid Build Coastguard Worker public final class PublicCredential extends android.nearby.PresenceCredential implements android.os.Parcelable { 161*344a7f5eSAndroid Build Coastguard Worker method public int describeContents(); 162*344a7f5eSAndroid Build Coastguard Worker method @NonNull public byte[] getEncryptedMetadata(); 163*344a7f5eSAndroid Build Coastguard Worker method @NonNull public byte[] getEncryptedMetadataKeyTag(); 164*344a7f5eSAndroid Build Coastguard Worker method @NonNull public byte[] getPublicKey(); 165*344a7f5eSAndroid Build Coastguard Worker method public void writeToParcel(@NonNull android.os.Parcel, int); 166*344a7f5eSAndroid Build Coastguard Worker field @NonNull public static final android.os.Parcelable.Creator<android.nearby.PublicCredential> CREATOR; 167*344a7f5eSAndroid Build Coastguard Worker } 168*344a7f5eSAndroid Build Coastguard Worker 169*344a7f5eSAndroid Build Coastguard Worker public static final class PublicCredential.Builder { 170*344a7f5eSAndroid Build Coastguard Worker ctor public PublicCredential.Builder(@NonNull byte[], @NonNull byte[], @NonNull byte[], @NonNull byte[], @NonNull byte[]); 171*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PublicCredential.Builder addCredentialElement(@NonNull android.nearby.CredentialElement); 172*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PublicCredential build(); 173*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.PublicCredential.Builder setIdentityType(int); 174*344a7f5eSAndroid Build Coastguard Worker } 175*344a7f5eSAndroid Build Coastguard Worker 176*344a7f5eSAndroid Build Coastguard Worker public interface ScanCallback { 177*344a7f5eSAndroid Build Coastguard Worker method public void onDiscovered(@NonNull android.nearby.NearbyDevice); 178*344a7f5eSAndroid Build Coastguard Worker method public void onLost(@NonNull android.nearby.NearbyDevice); 179*344a7f5eSAndroid Build Coastguard Worker method public void onUpdated(@NonNull android.nearby.NearbyDevice); 180*344a7f5eSAndroid Build Coastguard Worker } 181*344a7f5eSAndroid Build Coastguard Worker 182*344a7f5eSAndroid Build Coastguard Worker public abstract class ScanFilter { 183*344a7f5eSAndroid Build Coastguard Worker method @IntRange(from=0, to=127) public int getMaxPathLoss(); 184*344a7f5eSAndroid Build Coastguard Worker method public int getType(); 185*344a7f5eSAndroid Build Coastguard Worker } 186*344a7f5eSAndroid Build Coastguard Worker 187*344a7f5eSAndroid Build Coastguard Worker public final class ScanRequest implements android.os.Parcelable { 188*344a7f5eSAndroid Build Coastguard Worker method public int describeContents(); 189*344a7f5eSAndroid Build Coastguard Worker method @NonNull public java.util.List<android.nearby.ScanFilter> getScanFilters(); 190*344a7f5eSAndroid Build Coastguard Worker method public int getScanMode(); 191*344a7f5eSAndroid Build Coastguard Worker method public int getScanType(); 192*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.os.WorkSource getWorkSource(); 193*344a7f5eSAndroid Build Coastguard Worker method public boolean isBleEnabled(); 194*344a7f5eSAndroid Build Coastguard Worker method public static boolean isValidScanMode(int); 195*344a7f5eSAndroid Build Coastguard Worker method public static boolean isValidScanType(int); 196*344a7f5eSAndroid Build Coastguard Worker method @NonNull public static String scanModeToString(int); 197*344a7f5eSAndroid Build Coastguard Worker method public void writeToParcel(@NonNull android.os.Parcel, int); 198*344a7f5eSAndroid Build Coastguard Worker field @NonNull public static final android.os.Parcelable.Creator<android.nearby.ScanRequest> CREATOR; 199*344a7f5eSAndroid Build Coastguard Worker field public static final int SCAN_MODE_BALANCED = 1; // 0x1 200*344a7f5eSAndroid Build Coastguard Worker field public static final int SCAN_MODE_LOW_LATENCY = 2; // 0x2 201*344a7f5eSAndroid Build Coastguard Worker field public static final int SCAN_MODE_LOW_POWER = 0; // 0x0 202*344a7f5eSAndroid Build Coastguard Worker field public static final int SCAN_MODE_NO_POWER = -1; // 0xffffffff 203*344a7f5eSAndroid Build Coastguard Worker field public static final int SCAN_TYPE_FAST_PAIR = 1; // 0x1 204*344a7f5eSAndroid Build Coastguard Worker field public static final int SCAN_TYPE_NEARBY_PRESENCE = 2; // 0x2 205*344a7f5eSAndroid Build Coastguard Worker } 206*344a7f5eSAndroid Build Coastguard Worker 207*344a7f5eSAndroid Build Coastguard Worker public static final class ScanRequest.Builder { 208*344a7f5eSAndroid Build Coastguard Worker ctor public ScanRequest.Builder(); 209*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.ScanRequest.Builder addScanFilter(@NonNull android.nearby.ScanFilter); 210*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.ScanRequest build(); 211*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.ScanRequest.Builder setBleEnabled(boolean); 212*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.ScanRequest.Builder setScanMode(int); 213*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.nearby.ScanRequest.Builder setScanType(int); 214*344a7f5eSAndroid Build Coastguard Worker method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public android.nearby.ScanRequest.Builder setWorkSource(@Nullable android.os.WorkSource); 215*344a7f5eSAndroid Build Coastguard Worker } 216*344a7f5eSAndroid Build Coastguard Worker 217*344a7f5eSAndroid Build Coastguard Worker} 218*344a7f5eSAndroid Build Coastguard Worker 219*344a7f5eSAndroid Build Coastguard Workerpackage android.net { 220*344a7f5eSAndroid Build Coastguard Worker 221*344a7f5eSAndroid Build Coastguard Worker public class EthernetManager { 222*344a7f5eSAndroid Build Coastguard Worker method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.MANAGE_ETHERNET_NETWORKS}) public void disableInterface(@NonNull String, @Nullable java.util.concurrent.Executor, @Nullable android.os.OutcomeReceiver<java.lang.String,android.net.EthernetNetworkManagementException>); 223*344a7f5eSAndroid Build Coastguard Worker method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.MANAGE_ETHERNET_NETWORKS}) public void enableInterface(@NonNull String, @Nullable java.util.concurrent.Executor, @Nullable android.os.OutcomeReceiver<java.lang.String,android.net.EthernetNetworkManagementException>); 224*344a7f5eSAndroid Build Coastguard Worker method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public android.net.EthernetManager.TetheredInterfaceRequest requestTetheredInterface(@NonNull java.util.concurrent.Executor, @NonNull android.net.EthernetManager.TetheredInterfaceCallback); 225*344a7f5eSAndroid Build Coastguard Worker method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.MANAGE_ETHERNET_NETWORKS}) public void updateConfiguration(@NonNull String, @NonNull android.net.EthernetNetworkUpdateRequest, @Nullable java.util.concurrent.Executor, @Nullable android.os.OutcomeReceiver<java.lang.String,android.net.EthernetNetworkManagementException>); 226*344a7f5eSAndroid Build Coastguard Worker } 227*344a7f5eSAndroid Build Coastguard Worker 228*344a7f5eSAndroid Build Coastguard Worker public static interface EthernetManager.TetheredInterfaceCallback { 229*344a7f5eSAndroid Build Coastguard Worker method public void onAvailable(@NonNull String); 230*344a7f5eSAndroid Build Coastguard Worker method public void onUnavailable(); 231*344a7f5eSAndroid Build Coastguard Worker } 232*344a7f5eSAndroid Build Coastguard Worker 233*344a7f5eSAndroid Build Coastguard Worker public static class EthernetManager.TetheredInterfaceRequest { 234*344a7f5eSAndroid Build Coastguard Worker method public void release(); 235*344a7f5eSAndroid Build Coastguard Worker } 236*344a7f5eSAndroid Build Coastguard Worker 237*344a7f5eSAndroid Build Coastguard Worker public final class EthernetNetworkManagementException extends java.lang.RuntimeException implements android.os.Parcelable { 238*344a7f5eSAndroid Build Coastguard Worker ctor public EthernetNetworkManagementException(@NonNull String); 239*344a7f5eSAndroid Build Coastguard Worker method public int describeContents(); 240*344a7f5eSAndroid Build Coastguard Worker method public void writeToParcel(@NonNull android.os.Parcel, int); 241*344a7f5eSAndroid Build Coastguard Worker field @NonNull public static final android.os.Parcelable.Creator<android.net.EthernetNetworkManagementException> CREATOR; 242*344a7f5eSAndroid Build Coastguard Worker } 243*344a7f5eSAndroid Build Coastguard Worker 244*344a7f5eSAndroid Build Coastguard Worker public final class EthernetNetworkUpdateRequest implements android.os.Parcelable { 245*344a7f5eSAndroid Build Coastguard Worker method public int describeContents(); 246*344a7f5eSAndroid Build Coastguard Worker method @Nullable public android.net.IpConfiguration getIpConfiguration(); 247*344a7f5eSAndroid Build Coastguard Worker method @Nullable public android.net.NetworkCapabilities getNetworkCapabilities(); 248*344a7f5eSAndroid Build Coastguard Worker method public void writeToParcel(@NonNull android.os.Parcel, int); 249*344a7f5eSAndroid Build Coastguard Worker field @NonNull public static final android.os.Parcelable.Creator<android.net.EthernetNetworkUpdateRequest> CREATOR; 250*344a7f5eSAndroid Build Coastguard Worker } 251*344a7f5eSAndroid Build Coastguard Worker 252*344a7f5eSAndroid Build Coastguard Worker public static final class EthernetNetworkUpdateRequest.Builder { 253*344a7f5eSAndroid Build Coastguard Worker ctor public EthernetNetworkUpdateRequest.Builder(); 254*344a7f5eSAndroid Build Coastguard Worker ctor public EthernetNetworkUpdateRequest.Builder(@NonNull android.net.EthernetNetworkUpdateRequest); 255*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.net.EthernetNetworkUpdateRequest build(); 256*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.net.EthernetNetworkUpdateRequest.Builder setIpConfiguration(@Nullable android.net.IpConfiguration); 257*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.net.EthernetNetworkUpdateRequest.Builder setNetworkCapabilities(@Nullable android.net.NetworkCapabilities); 258*344a7f5eSAndroid Build Coastguard Worker } 259*344a7f5eSAndroid Build Coastguard Worker 260*344a7f5eSAndroid Build Coastguard Worker public class IpSecManager { 261*344a7f5eSAndroid Build Coastguard Worker method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void applyTunnelModeTransform(@NonNull android.net.IpSecManager.IpSecTunnelInterface, int, @NonNull android.net.IpSecTransform) throws java.io.IOException; 262*344a7f5eSAndroid Build Coastguard Worker method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public android.net.IpSecManager.IpSecTunnelInterface createIpSecTunnelInterface(@NonNull java.net.InetAddress, @NonNull java.net.InetAddress, @NonNull android.net.Network) throws java.io.IOException, android.net.IpSecManager.ResourceUnavailableException; 263*344a7f5eSAndroid Build Coastguard Worker } 264*344a7f5eSAndroid Build Coastguard Worker 265*344a7f5eSAndroid Build Coastguard Worker public static final class IpSecManager.IpSecTunnelInterface implements java.lang.AutoCloseable { 266*344a7f5eSAndroid Build Coastguard Worker method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void addAddress(@NonNull java.net.InetAddress, int) throws java.io.IOException; 267*344a7f5eSAndroid Build Coastguard Worker method public void close(); 268*344a7f5eSAndroid Build Coastguard Worker method @NonNull public String getInterfaceName(); 269*344a7f5eSAndroid Build Coastguard Worker method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void removeAddress(@NonNull java.net.InetAddress, int) throws java.io.IOException; 270*344a7f5eSAndroid Build Coastguard Worker method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void setUnderlyingNetwork(@NonNull android.net.Network) throws java.io.IOException; 271*344a7f5eSAndroid Build Coastguard Worker } 272*344a7f5eSAndroid Build Coastguard Worker 273*344a7f5eSAndroid Build Coastguard Worker public static class IpSecTransform.Builder { 274*344a7f5eSAndroid Build Coastguard Worker method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public android.net.IpSecTransform buildTunnelModeTransform(@NonNull java.net.InetAddress, @NonNull android.net.IpSecManager.SecurityParameterIndex) throws java.io.IOException, android.net.IpSecManager.ResourceUnavailableException, android.net.IpSecManager.SpiUnavailableException; 275*344a7f5eSAndroid Build Coastguard Worker } 276*344a7f5eSAndroid Build Coastguard Worker 277*344a7f5eSAndroid Build Coastguard Worker public final class NetworkStats implements java.lang.Iterable<android.net.NetworkStats.Entry> android.os.Parcelable { 278*344a7f5eSAndroid Build Coastguard Worker ctor public NetworkStats(long, int); 279*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.net.NetworkStats add(@NonNull android.net.NetworkStats); 280*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.net.NetworkStats addEntry(@NonNull android.net.NetworkStats.Entry); 281*344a7f5eSAndroid Build Coastguard Worker method public int describeContents(); 282*344a7f5eSAndroid Build Coastguard Worker method @NonNull public java.util.Iterator<android.net.NetworkStats.Entry> iterator(); 283*344a7f5eSAndroid Build Coastguard Worker method @NonNull public android.net.NetworkStats subtract(@NonNull android.net.NetworkStats); 284*344a7f5eSAndroid Build Coastguard Worker method public void writeToParcel(@NonNull android.os.Parcel, int); 285*344a7f5eSAndroid Build Coastguard Worker field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkStats> CREATOR; 286*344a7f5eSAndroid Build Coastguard Worker field public static final int DEFAULT_NETWORK_ALL = -1; // 0xffffffff 287*344a7f5eSAndroid Build Coastguard Worker field public static final int DEFAULT_NETWORK_NO = 0; // 0x0 288*344a7f5eSAndroid Build Coastguard Worker field public static final int DEFAULT_NETWORK_YES = 1; // 0x1 289*344a7f5eSAndroid Build Coastguard Worker field public static final String IFACE_VT = "vt_data0"; 290*344a7f5eSAndroid Build Coastguard Worker field public static final int METERED_ALL = -1; // 0xffffffff 291*344a7f5eSAndroid Build Coastguard Worker field public static final int METERED_NO = 0; // 0x0 292*344a7f5eSAndroid Build Coastguard Worker field public static final int METERED_YES = 1; // 0x1 293*344a7f5eSAndroid Build Coastguard Worker field public static final int ROAMING_ALL = -1; // 0xffffffff 294*344a7f5eSAndroid Build Coastguard Worker field public static final int ROAMING_NO = 0; // 0x0 295*344a7f5eSAndroid Build Coastguard Worker field public static final int ROAMING_YES = 1; // 0x1 296*344a7f5eSAndroid Build Coastguard Worker field public static final int SET_ALL = -1; // 0xffffffff 297*344a7f5eSAndroid Build Coastguard Worker field public static final int SET_DEFAULT = 0; // 0x0 298*344a7f5eSAndroid Build Coastguard Worker field public static final int SET_FOREGROUND = 1; // 0x1 299*344a7f5eSAndroid Build Coastguard Worker field public static final int TAG_NONE = 0; // 0x0 300*344a7f5eSAndroid Build Coastguard Worker field public static final int UID_ALL = -1; // 0xffffffff 301*344a7f5eSAndroid Build Coastguard Worker field public static final int UID_TETHERING = -5; // 0xfffffffb 302*344a7f5eSAndroid Build Coastguard Worker } 303*344a7f5eSAndroid Build Coastguard Worker 304*344a7f5eSAndroid Build Coastguard Worker public static class NetworkStats.Entry { 305*344a7f5eSAndroid Build Coastguard Worker ctor public NetworkStats.Entry(@Nullable String, int, int, int, int, int, int, long, long, long, long, long); 306*344a7f5eSAndroid Build Coastguard Worker method public int getDefaultNetwork(); 307*344a7f5eSAndroid Build Coastguard Worker method public int getMetered(); 308*344a7f5eSAndroid Build Coastguard Worker method public long getOperations(); 309*344a7f5eSAndroid Build Coastguard Worker method public int getRoaming(); 310*344a7f5eSAndroid Build Coastguard Worker method public long getRxBytes(); 311*344a7f5eSAndroid Build Coastguard Worker method public long getRxPackets(); 312*344a7f5eSAndroid Build Coastguard Worker method public int getSet(); 313*344a7f5eSAndroid Build Coastguard Worker method public int getTag(); 314*344a7f5eSAndroid Build Coastguard Worker method public long getTxBytes(); 315*344a7f5eSAndroid Build Coastguard Worker method public long getTxPackets(); 316*344a7f5eSAndroid Build Coastguard Worker method public int getUid(); 317*344a7f5eSAndroid Build Coastguard Worker } 318*344a7f5eSAndroid Build Coastguard Worker 319*344a7f5eSAndroid Build Coastguard Worker public class TrafficStats { 320*344a7f5eSAndroid Build Coastguard Worker method public static void setThreadStatsTagApp(); 321*344a7f5eSAndroid Build Coastguard Worker method public static void setThreadStatsTagBackup(); 322*344a7f5eSAndroid Build Coastguard Worker method public static void setThreadStatsTagRestore(); 323*344a7f5eSAndroid Build Coastguard Worker field public static final int TAG_NETWORK_STACK_IMPERSONATION_RANGE_END = -113; // 0xffffff8f 324*344a7f5eSAndroid Build Coastguard Worker field public static final int TAG_NETWORK_STACK_IMPERSONATION_RANGE_START = -128; // 0xffffff80 325*344a7f5eSAndroid Build Coastguard Worker field public static final int TAG_NETWORK_STACK_RANGE_END = -257; // 0xfffffeff 326*344a7f5eSAndroid Build Coastguard Worker field public static final int TAG_NETWORK_STACK_RANGE_START = -768; // 0xfffffd00 327*344a7f5eSAndroid Build Coastguard Worker field public static final int TAG_SYSTEM_IMPERSONATION_RANGE_END = -241; // 0xffffff0f 328*344a7f5eSAndroid Build Coastguard Worker field public static final int TAG_SYSTEM_IMPERSONATION_RANGE_START = -256; // 0xffffff00 329*344a7f5eSAndroid Build Coastguard Worker } 330*344a7f5eSAndroid Build Coastguard Worker 331*344a7f5eSAndroid Build Coastguard Worker} 332*344a7f5eSAndroid Build Coastguard Worker 333*344a7f5eSAndroid Build Coastguard Workerpackage android.net.netstats.provider { 334*344a7f5eSAndroid Build Coastguard Worker 335*344a7f5eSAndroid Build Coastguard Worker public abstract class NetworkStatsProvider { 336*344a7f5eSAndroid Build Coastguard Worker ctor public NetworkStatsProvider(); 337*344a7f5eSAndroid Build Coastguard Worker method public void notifyAlertReached(); 338*344a7f5eSAndroid Build Coastguard Worker method public void notifyLimitReached(); 339*344a7f5eSAndroid Build Coastguard Worker method public void notifyStatsUpdated(int, @NonNull android.net.NetworkStats, @NonNull android.net.NetworkStats); 340*344a7f5eSAndroid Build Coastguard Worker method public void notifyWarningReached(); 341*344a7f5eSAndroid Build Coastguard Worker method public abstract void onRequestStatsUpdate(int); 342*344a7f5eSAndroid Build Coastguard Worker method public abstract void onSetAlert(long); 343*344a7f5eSAndroid Build Coastguard Worker method public abstract void onSetLimit(@NonNull String, long); 344*344a7f5eSAndroid Build Coastguard Worker method public void onSetWarningAndLimit(@NonNull String, long, long); 345*344a7f5eSAndroid Build Coastguard Worker field public static final int QUOTA_UNLIMITED = -1; // 0xffffffff 346*344a7f5eSAndroid Build Coastguard Worker } 347*344a7f5eSAndroid Build Coastguard Worker 348*344a7f5eSAndroid Build Coastguard Worker} 349*344a7f5eSAndroid Build Coastguard Worker 350