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