| 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 { | 
| Yahav Nussbaum | c712a57 | 2024-01-29 12:23:28 +0000 | [diff] [blame] | 62 | method @FlaggedApi("com.android.nearby.flags.powered_off_finding") @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getPoweredOffFindingMode(); | 
| Xinyi Zhou | e73c76f | 2023-01-27 16:47:00 -0800 | [diff] [blame] | 63 | method public void queryOffloadCapability(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.nearby.OffloadCapability>); | 
| Yahav Nussbaum | c712a57 | 2024-01-29 12:23:28 +0000 | [diff] [blame] | 64 | method @FlaggedApi("com.android.nearby.flags.powered_off_finding") @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void setPoweredOffFindingEphemeralIds(@NonNull java.util.List<byte[]>); | 
|  | 65 | method @FlaggedApi("com.android.nearby.flags.powered_off_finding") @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void setPoweredOffFindingMode(int); | 
| Xinyi Zhou | b4efda8 | 2022-03-15 18:22:35 -0700 | [diff] [blame] | 66 | 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); | 
|  | 67 | 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); | 
|  | 68 | method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_ADVERTISE, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void stopBroadcast(@NonNull android.nearby.BroadcastCallback); | 
|  | 69 | method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void stopScan(@NonNull android.nearby.ScanCallback); | 
| Yahav Nussbaum | c712a57 | 2024-01-29 12:23:28 +0000 | [diff] [blame] | 70 | field @FlaggedApi("com.android.nearby.flags.powered_off_finding") public static final int POWERED_OFF_FINDING_MODE_DISABLED = 1; // 0x1 | 
|  | 71 | field @FlaggedApi("com.android.nearby.flags.powered_off_finding") public static final int POWERED_OFF_FINDING_MODE_ENABLED = 2; // 0x2 | 
|  | 72 | field @FlaggedApi("com.android.nearby.flags.powered_off_finding") public static final int POWERED_OFF_FINDING_MODE_UNSUPPORTED = 0; // 0x0 | 
| Remi NGUYEN VAN | 51935fc | 2022-01-07 13:18:54 +0900 | [diff] [blame] | 73 | } | 
|  | 74 |  | 
| Xinyi Zhou | e73c76f | 2023-01-27 16:47:00 -0800 | [diff] [blame] | 75 | public final class OffloadCapability implements android.os.Parcelable { | 
|  | 76 | method public int describeContents(); | 
|  | 77 | method public long getVersion(); | 
|  | 78 | method public boolean isFastPairSupported(); | 
|  | 79 | method public boolean isNearbyShareSupported(); | 
|  | 80 | method public void writeToParcel(@NonNull android.os.Parcel, int); | 
|  | 81 | field @NonNull public static final android.os.Parcelable.Creator<android.nearby.OffloadCapability> CREATOR; | 
|  | 82 | } | 
|  | 83 |  | 
|  | 84 | public static final class OffloadCapability.Builder { | 
|  | 85 | ctor public OffloadCapability.Builder(); | 
|  | 86 | method @NonNull public android.nearby.OffloadCapability build(); | 
|  | 87 | method @NonNull public android.nearby.OffloadCapability.Builder setFastPairSupported(boolean); | 
|  | 88 | method @NonNull public android.nearby.OffloadCapability.Builder setNearbyShareSupported(boolean); | 
|  | 89 | method @NonNull public android.nearby.OffloadCapability.Builder setVersion(long); | 
|  | 90 | } | 
|  | 91 |  | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 92 | public final class PresenceBroadcastRequest extends android.nearby.BroadcastRequest implements android.os.Parcelable { | 
| Wei Wang | 24e2cb2 | 2022-03-12 12:15:34 -0800 | [diff] [blame] | 93 | method public int describeContents(); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 94 | method @NonNull public java.util.List<java.lang.Integer> getActions(); | 
|  | 95 | method @NonNull public android.nearby.PrivateCredential getCredential(); | 
|  | 96 | method @NonNull public java.util.List<android.nearby.DataElement> getExtendedProperties(); | 
|  | 97 | method @NonNull public byte[] getSalt(); | 
| Wei Wang | 24e2cb2 | 2022-03-12 12:15:34 -0800 | [diff] [blame] | 98 | method public void writeToParcel(@NonNull android.os.Parcel, int); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 99 | field @NonNull public static final android.os.Parcelable.Creator<android.nearby.PresenceBroadcastRequest> CREATOR; | 
|  | 100 | } | 
|  | 101 |  | 
|  | 102 | public static final class PresenceBroadcastRequest.Builder { | 
| Wei Wang | 88c4844 | 2022-03-05 12:14:12 -0800 | [diff] [blame] | 103 | 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] | 104 | method @NonNull public android.nearby.PresenceBroadcastRequest.Builder addAction(@IntRange(from=1, to=255) int); | 
|  | 105 | method @NonNull public android.nearby.PresenceBroadcastRequest.Builder addExtendedProperty(@NonNull android.nearby.DataElement); | 
|  | 106 | method @NonNull public android.nearby.PresenceBroadcastRequest build(); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 107 | method @NonNull public android.nearby.PresenceBroadcastRequest.Builder setTxPower(@IntRange(from=0xffffff81, to=126) int); | 
|  | 108 | method @NonNull public android.nearby.PresenceBroadcastRequest.Builder setVersion(int); | 
|  | 109 | } | 
|  | 110 |  | 
| Wei Wang | 24e2cb2 | 2022-03-12 12:15:34 -0800 | [diff] [blame] | 111 | public abstract class PresenceCredential { | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 112 | method @NonNull public byte[] getAuthenticityKey(); | 
|  | 113 | method @NonNull public java.util.List<android.nearby.CredentialElement> getCredentialElements(); | 
|  | 114 | method public int getIdentityType(); | 
|  | 115 | method @NonNull public byte[] getSecretId(); | 
|  | 116 | method public int getType(); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 117 | field public static final int CREDENTIAL_TYPE_PRIVATE = 0; // 0x0 | 
|  | 118 | field public static final int CREDENTIAL_TYPE_PUBLIC = 1; // 0x1 | 
|  | 119 | field public static final int IDENTITY_TYPE_PRIVATE = 1; // 0x1 | 
|  | 120 | field public static final int IDENTITY_TYPE_PROVISIONED = 2; // 0x2 | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 121 | field public static final int IDENTITY_TYPE_TRUSTED = 3; // 0x3 | 
|  | 122 | field public static final int IDENTITY_TYPE_UNKNOWN = 0; // 0x0 | 
|  | 123 | } | 
|  | 124 |  | 
|  | 125 | public final class PresenceDevice extends android.nearby.NearbyDevice implements android.os.Parcelable { | 
|  | 126 | method public int describeContents(); | 
|  | 127 | method @NonNull public String getDeviceId(); | 
|  | 128 | method @Nullable public String getDeviceImageUrl(); | 
|  | 129 | method public int getDeviceType(); | 
|  | 130 | method public long getDiscoveryTimestampMillis(); | 
|  | 131 | method @NonNull public byte[] getEncryptedIdentity(); | 
|  | 132 | method @NonNull public java.util.List<android.nearby.DataElement> getExtendedProperties(); | 
|  | 133 | method @NonNull public byte[] getSalt(); | 
|  | 134 | method @NonNull public byte[] getSecretId(); | 
|  | 135 | method public void writeToParcel(@NonNull android.os.Parcel, int); | 
|  | 136 | field @NonNull public static final android.os.Parcelable.Creator<android.nearby.PresenceDevice> CREATOR; | 
|  | 137 | } | 
|  | 138 |  | 
|  | 139 | public static final class PresenceDevice.Builder { | 
| Wei Wang | 88c4844 | 2022-03-05 12:14:12 -0800 | [diff] [blame] | 140 | ctor public PresenceDevice.Builder(@NonNull String, @NonNull byte[], @NonNull byte[], @NonNull byte[]); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 141 | method @NonNull public android.nearby.PresenceDevice.Builder addExtendedProperty(@NonNull android.nearby.DataElement); | 
|  | 142 | method @NonNull public android.nearby.PresenceDevice.Builder addMedium(int); | 
|  | 143 | method @NonNull public android.nearby.PresenceDevice build(); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 144 | method @NonNull public android.nearby.PresenceDevice.Builder setDeviceImageUrl(@Nullable String); | 
|  | 145 | method @NonNull public android.nearby.PresenceDevice.Builder setDeviceType(int); | 
|  | 146 | method @NonNull public android.nearby.PresenceDevice.Builder setDiscoveryTimestampMillis(long); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 147 | method @NonNull public android.nearby.PresenceDevice.Builder setName(@Nullable String); | 
|  | 148 | method @NonNull public android.nearby.PresenceDevice.Builder setRssi(int); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 149 | } | 
|  | 150 |  | 
|  | 151 | public final class PresenceScanFilter extends android.nearby.ScanFilter implements android.os.Parcelable { | 
| Wei Wang | 24e2cb2 | 2022-03-12 12:15:34 -0800 | [diff] [blame] | 152 | method public int describeContents(); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 153 | method @NonNull public java.util.List<android.nearby.PublicCredential> getCredentials(); | 
|  | 154 | method @NonNull public java.util.List<android.nearby.DataElement> getExtendedProperties(); | 
|  | 155 | method @NonNull public java.util.List<java.lang.Integer> getPresenceActions(); | 
| Wei Wang | 24e2cb2 | 2022-03-12 12:15:34 -0800 | [diff] [blame] | 156 | method public void writeToParcel(@NonNull android.os.Parcel, int); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 157 | field @NonNull public static final android.os.Parcelable.Creator<android.nearby.PresenceScanFilter> CREATOR; | 
|  | 158 | } | 
|  | 159 |  | 
|  | 160 | public static final class PresenceScanFilter.Builder { | 
|  | 161 | ctor public PresenceScanFilter.Builder(); | 
|  | 162 | method @NonNull public android.nearby.PresenceScanFilter.Builder addCredential(@NonNull android.nearby.PublicCredential); | 
|  | 163 | method @NonNull public android.nearby.PresenceScanFilter.Builder addExtendedProperty(@NonNull android.nearby.DataElement); | 
|  | 164 | method @NonNull public android.nearby.PresenceScanFilter.Builder addPresenceAction(@IntRange(from=1, to=255) int); | 
|  | 165 | method @NonNull public android.nearby.PresenceScanFilter build(); | 
|  | 166 | method @NonNull public android.nearby.PresenceScanFilter.Builder setMaxPathLoss(@IntRange(from=0, to=127) int); | 
|  | 167 | } | 
|  | 168 |  | 
|  | 169 | public final class PrivateCredential extends android.nearby.PresenceCredential implements android.os.Parcelable { | 
| Wei Wang | 24e2cb2 | 2022-03-12 12:15:34 -0800 | [diff] [blame] | 170 | method public int describeContents(); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 171 | method @NonNull public String getDeviceName(); | 
|  | 172 | method @NonNull public byte[] getMetadataEncryptionKey(); | 
| Wei Wang | 24e2cb2 | 2022-03-12 12:15:34 -0800 | [diff] [blame] | 173 | method public void writeToParcel(@NonNull android.os.Parcel, int); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 174 | field @NonNull public static final android.os.Parcelable.Creator<android.nearby.PrivateCredential> CREATOR; | 
|  | 175 | } | 
|  | 176 |  | 
|  | 177 | public static final class PrivateCredential.Builder { | 
| Wei Wang | 24e2cb2 | 2022-03-12 12:15:34 -0800 | [diff] [blame] | 178 | ctor public PrivateCredential.Builder(@NonNull byte[], @NonNull byte[], @NonNull byte[], @NonNull String); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 179 | method @NonNull public android.nearby.PrivateCredential.Builder addCredentialElement(@NonNull android.nearby.CredentialElement); | 
|  | 180 | method @NonNull public android.nearby.PrivateCredential build(); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 181 | method @NonNull public android.nearby.PrivateCredential.Builder setIdentityType(int); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 182 | } | 
|  | 183 |  | 
|  | 184 | public final class PublicCredential extends android.nearby.PresenceCredential implements android.os.Parcelable { | 
| Wei Wang | 24e2cb2 | 2022-03-12 12:15:34 -0800 | [diff] [blame] | 185 | method public int describeContents(); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 186 | method @NonNull public byte[] getEncryptedMetadata(); | 
|  | 187 | method @NonNull public byte[] getEncryptedMetadataKeyTag(); | 
|  | 188 | method @NonNull public byte[] getPublicKey(); | 
| Wei Wang | 24e2cb2 | 2022-03-12 12:15:34 -0800 | [diff] [blame] | 189 | method public void writeToParcel(@NonNull android.os.Parcel, int); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 190 | field @NonNull public static final android.os.Parcelable.Creator<android.nearby.PublicCredential> CREATOR; | 
|  | 191 | } | 
|  | 192 |  | 
|  | 193 | public static final class PublicCredential.Builder { | 
| Wei Wang | 24e2cb2 | 2022-03-12 12:15:34 -0800 | [diff] [blame] | 194 | 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] | 195 | method @NonNull public android.nearby.PublicCredential.Builder addCredentialElement(@NonNull android.nearby.CredentialElement); | 
|  | 196 | method @NonNull public android.nearby.PublicCredential build(); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 197 | method @NonNull public android.nearby.PublicCredential.Builder setIdentityType(int); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 198 | } | 
|  | 199 |  | 
| Remi NGUYEN VAN | 51935fc | 2022-01-07 13:18:54 +0900 | [diff] [blame] | 200 | public interface ScanCallback { | 
|  | 201 | method public void onDiscovered(@NonNull android.nearby.NearbyDevice); | 
| Xinyi Zhou | 9afce39 | 2023-01-10 18:28:56 -0800 | [diff] [blame] | 202 | method public default void onError(int); | 
| Remi NGUYEN VAN | 51935fc | 2022-01-07 13:18:54 +0900 | [diff] [blame] | 203 | method public void onLost(@NonNull android.nearby.NearbyDevice); | 
|  | 204 | method public void onUpdated(@NonNull android.nearby.NearbyDevice); | 
| Xinyi Zhou | 75200b1 | 2023-02-10 23:13:52 -0800 | [diff] [blame] | 205 | field public static final int ERROR_INVALID_ARGUMENT = 2; // 0x2 | 
|  | 206 | field public static final int ERROR_PERMISSION_DENIED = 3; // 0x3 | 
|  | 207 | field public static final int ERROR_RESOURCE_EXHAUSTED = 4; // 0x4 | 
| Xinyi Zhou | 9afce39 | 2023-01-10 18:28:56 -0800 | [diff] [blame] | 208 | field public static final int ERROR_UNKNOWN = 0; // 0x0 | 
|  | 209 | field public static final int ERROR_UNSUPPORTED = 1; // 0x1 | 
| Remi NGUYEN VAN | 51935fc | 2022-01-07 13:18:54 +0900 | [diff] [blame] | 210 | } | 
|  | 211 |  | 
| Wei Wang | 24e2cb2 | 2022-03-12 12:15:34 -0800 | [diff] [blame] | 212 | public abstract class ScanFilter { | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 213 | method @IntRange(from=0, to=127) public int getMaxPathLoss(); | 
|  | 214 | method public int getType(); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 215 | } | 
|  | 216 |  | 
| Remi NGUYEN VAN | 51935fc | 2022-01-07 13:18:54 +0900 | [diff] [blame] | 217 | public final class ScanRequest implements android.os.Parcelable { | 
|  | 218 | method public int describeContents(); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 219 | method @NonNull public java.util.List<android.nearby.ScanFilter> getScanFilters(); | 
| Remi NGUYEN VAN | 51935fc | 2022-01-07 13:18:54 +0900 | [diff] [blame] | 220 | method public int getScanMode(); | 
|  | 221 | method public int getScanType(); | 
|  | 222 | method @NonNull public android.os.WorkSource getWorkSource(); | 
| Xinyi Zhou | ff98750 | 2022-03-09 17:38:41 -0800 | [diff] [blame] | 223 | method public boolean isBleEnabled(); | 
| Xinyi Zhou | 8fe4541 | 2023-01-20 16:21:14 -0800 | [diff] [blame] | 224 | method public boolean isOffloadOnly(); | 
| Remi NGUYEN VAN | 51935fc | 2022-01-07 13:18:54 +0900 | [diff] [blame] | 225 | method public static boolean isValidScanMode(int); | 
|  | 226 | method public static boolean isValidScanType(int); | 
|  | 227 | method @NonNull public static String scanModeToString(int); | 
|  | 228 | method public void writeToParcel(@NonNull android.os.Parcel, int); | 
|  | 229 | field @NonNull public static final android.os.Parcelable.Creator<android.nearby.ScanRequest> CREATOR; | 
|  | 230 | field public static final int SCAN_MODE_BALANCED = 1; // 0x1 | 
|  | 231 | field public static final int SCAN_MODE_LOW_LATENCY = 2; // 0x2 | 
|  | 232 | field public static final int SCAN_MODE_LOW_POWER = 0; // 0x0 | 
|  | 233 | field public static final int SCAN_MODE_NO_POWER = -1; // 0xffffffff | 
| Remi NGUYEN VAN | 51935fc | 2022-01-07 13:18:54 +0900 | [diff] [blame] | 234 | field public static final int SCAN_TYPE_FAST_PAIR = 1; // 0x1 | 
| Chun Zhang | e4440de | 2022-03-24 22:40:56 -0700 | [diff] [blame] | 235 | field public static final int SCAN_TYPE_NEARBY_PRESENCE = 2; // 0x2 | 
| Remi NGUYEN VAN | 51935fc | 2022-01-07 13:18:54 +0900 | [diff] [blame] | 236 | } | 
|  | 237 |  | 
|  | 238 | public static final class ScanRequest.Builder { | 
|  | 239 | ctor public ScanRequest.Builder(); | 
| Wei Wang | b15b5a8 | 2022-02-01 17:08:08 -0800 | [diff] [blame] | 240 | 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] | 241 | method @NonNull public android.nearby.ScanRequest build(); | 
| Xinyi Zhou | ff98750 | 2022-03-09 17:38:41 -0800 | [diff] [blame] | 242 | method @NonNull public android.nearby.ScanRequest.Builder setBleEnabled(boolean); | 
| Xinyi Zhou | 8fe4541 | 2023-01-20 16:21:14 -0800 | [diff] [blame] | 243 | method @NonNull public android.nearby.ScanRequest.Builder setOffloadOnly(boolean); | 
| Remi NGUYEN VAN | 51935fc | 2022-01-07 13:18:54 +0900 | [diff] [blame] | 244 | method @NonNull public android.nearby.ScanRequest.Builder setScanMode(int); | 
|  | 245 | method @NonNull public android.nearby.ScanRequest.Builder setScanType(int); | 
|  | 246 | method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public android.nearby.ScanRequest.Builder setWorkSource(@Nullable android.os.WorkSource); | 
|  | 247 | } | 
|  | 248 |  | 
|  | 249 | } | 
|  | 250 |  | 
| Aaron Huang | 68ca373 | 2022-01-06 19:30:43 +0800 | [diff] [blame] | 251 | package android.net { | 
|  | 252 |  | 
| Xiao Ma | eaaf7d3 | 2022-01-23 16:14:51 +0000 | [diff] [blame] | 253 | public class EthernetManager { | 
| Patrick Rohr | fa376a5 | 2022-03-16 20:16:09 +0100 | [diff] [blame] | 254 | 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>); | 
|  | 255 | 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] | 256 | 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] | 257 | 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] | 258 | } | 
|  | 259 |  | 
|  | 260 | public static interface EthernetManager.TetheredInterfaceCallback { | 
|  | 261 | method public void onAvailable(@NonNull String); | 
|  | 262 | method public void onUnavailable(); | 
|  | 263 | } | 
|  | 264 |  | 
|  | 265 | public static class EthernetManager.TetheredInterfaceRequest { | 
|  | 266 | method public void release(); | 
|  | 267 | } | 
|  | 268 |  | 
|  | 269 | public final class EthernetNetworkManagementException extends java.lang.RuntimeException implements android.os.Parcelable { | 
|  | 270 | ctor public EthernetNetworkManagementException(@NonNull String); | 
|  | 271 | method public int describeContents(); | 
|  | 272 | method public void writeToParcel(@NonNull android.os.Parcel, int); | 
|  | 273 | field @NonNull public static final android.os.Parcelable.Creator<android.net.EthernetNetworkManagementException> CREATOR; | 
|  | 274 | } | 
|  | 275 |  | 
|  | 276 | public final class EthernetNetworkUpdateRequest implements android.os.Parcelable { | 
|  | 277 | method public int describeContents(); | 
| Patrick Rohr | 8a910f4 | 2022-03-16 20:07:23 +0100 | [diff] [blame] | 278 | method @Nullable public android.net.IpConfiguration getIpConfiguration(); | 
| Xiao Ma | eaaf7d3 | 2022-01-23 16:14:51 +0000 | [diff] [blame] | 279 | method @Nullable public android.net.NetworkCapabilities getNetworkCapabilities(); | 
|  | 280 | method public void writeToParcel(@NonNull android.os.Parcel, int); | 
|  | 281 | field @NonNull public static final android.os.Parcelable.Creator<android.net.EthernetNetworkUpdateRequest> CREATOR; | 
|  | 282 | } | 
|  | 283 |  | 
|  | 284 | public static final class EthernetNetworkUpdateRequest.Builder { | 
|  | 285 | ctor public EthernetNetworkUpdateRequest.Builder(); | 
|  | 286 | ctor public EthernetNetworkUpdateRequest.Builder(@NonNull android.net.EthernetNetworkUpdateRequest); | 
|  | 287 | method @NonNull public android.net.EthernetNetworkUpdateRequest build(); | 
| Patrick Rohr | 8a910f4 | 2022-03-16 20:07:23 +0100 | [diff] [blame] | 288 | method @NonNull public android.net.EthernetNetworkUpdateRequest.Builder setIpConfiguration(@Nullable android.net.IpConfiguration); | 
| Xiao Ma | eaaf7d3 | 2022-01-23 16:14:51 +0000 | [diff] [blame] | 289 | method @NonNull public android.net.EthernetNetworkUpdateRequest.Builder setNetworkCapabilities(@Nullable android.net.NetworkCapabilities); | 
|  | 290 | } | 
|  | 291 |  | 
| Yan Yan | f8063e3 | 2022-02-08 19:26:29 -0800 | [diff] [blame] | 292 | public class IpSecManager { | 
| Aaron Huang | 68ca373 | 2022-01-06 19:30:43 +0800 | [diff] [blame] | 293 | 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; | 
|  | 294 | 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; | 
| Yan Yan | 81c2160 | 2022-10-20 22:23:15 +0000 | [diff] [blame] | 295 | method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void startTunnelModeTransformMigration(@NonNull android.net.IpSecTransform, @NonNull java.net.InetAddress, @NonNull java.net.InetAddress); | 
| Aaron Huang | 68ca373 | 2022-01-06 19:30:43 +0800 | [diff] [blame] | 296 | } | 
|  | 297 |  | 
|  | 298 | public static final class IpSecManager.IpSecTunnelInterface implements java.lang.AutoCloseable { | 
|  | 299 | method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void addAddress(@NonNull java.net.InetAddress, int) throws java.io.IOException; | 
|  | 300 | method public void close(); | 
|  | 301 | method @NonNull public String getInterfaceName(); | 
|  | 302 | method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void removeAddress(@NonNull java.net.InetAddress, int) throws java.io.IOException; | 
|  | 303 | method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void setUnderlyingNetwork(@NonNull android.net.Network) throws java.io.IOException; | 
|  | 304 | } | 
|  | 305 |  | 
|  | 306 | public static class IpSecTransform.Builder { | 
|  | 307 | 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; | 
|  | 308 | } | 
|  | 309 |  | 
| Junyu Lai | 2ef865e | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 310 | public final class NetworkStats implements java.lang.Iterable<android.net.NetworkStats.Entry> android.os.Parcelable { | 
|  | 311 | ctor public NetworkStats(long, int); | 
|  | 312 | method @NonNull public android.net.NetworkStats add(@NonNull android.net.NetworkStats); | 
|  | 313 | method @NonNull public android.net.NetworkStats addEntry(@NonNull android.net.NetworkStats.Entry); | 
| Paul Duffin | b3c3f2e | 2023-10-12 18:48:37 +0100 | [diff] [blame] | 314 | method public android.net.NetworkStats clone(); | 
| Junyu Lai | 2ef865e | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 315 | method public int describeContents(); | 
| junyulai | 6801690 | 2022-03-28 15:39:12 +0800 | [diff] [blame] | 316 | method @NonNull public java.util.Iterator<android.net.NetworkStats.Entry> iterator(); | 
| Junyu Lai | 2ef865e | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 317 | method @NonNull public android.net.NetworkStats subtract(@NonNull android.net.NetworkStats); | 
|  | 318 | method public void writeToParcel(@NonNull android.os.Parcel, int); | 
|  | 319 | field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkStats> CREATOR; | 
|  | 320 | field public static final int DEFAULT_NETWORK_ALL = -1; // 0xffffffff | 
|  | 321 | field public static final int DEFAULT_NETWORK_NO = 0; // 0x0 | 
|  | 322 | field public static final int DEFAULT_NETWORK_YES = 1; // 0x1 | 
|  | 323 | field public static final String IFACE_VT = "vt_data0"; | 
|  | 324 | field public static final int METERED_ALL = -1; // 0xffffffff | 
|  | 325 | field public static final int METERED_NO = 0; // 0x0 | 
|  | 326 | field public static final int METERED_YES = 1; // 0x1 | 
|  | 327 | field public static final int ROAMING_ALL = -1; // 0xffffffff | 
|  | 328 | field public static final int ROAMING_NO = 0; // 0x0 | 
|  | 329 | field public static final int ROAMING_YES = 1; // 0x1 | 
|  | 330 | field public static final int SET_ALL = -1; // 0xffffffff | 
|  | 331 | field public static final int SET_DEFAULT = 0; // 0x0 | 
|  | 332 | field public static final int SET_FOREGROUND = 1; // 0x1 | 
|  | 333 | field public static final int TAG_NONE = 0; // 0x0 | 
|  | 334 | field public static final int UID_ALL = -1; // 0xffffffff | 
|  | 335 | field public static final int UID_TETHERING = -5; // 0xfffffffb | 
|  | 336 | } | 
|  | 337 |  | 
|  | 338 | public static class NetworkStats.Entry { | 
|  | 339 | 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] | 340 | method public int getDefaultNetwork(); | 
|  | 341 | method public int getMetered(); | 
|  | 342 | method public long getOperations(); | 
|  | 343 | method public int getRoaming(); | 
|  | 344 | method public long getRxBytes(); | 
|  | 345 | method public long getRxPackets(); | 
|  | 346 | method public int getSet(); | 
|  | 347 | method public int getTag(); | 
|  | 348 | method public long getTxBytes(); | 
|  | 349 | method public long getTxPackets(); | 
|  | 350 | method public int getUid(); | 
| Junyu Lai | 2ef865e | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 351 | } | 
|  | 352 |  | 
|  | 353 | public class TrafficStats { | 
|  | 354 | method public static void setThreadStatsTagApp(); | 
|  | 355 | method public static void setThreadStatsTagBackup(); | 
| Junyu Lai | 2ef865e | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 356 | method public static void setThreadStatsTagRestore(); | 
|  | 357 | field public static final int TAG_NETWORK_STACK_IMPERSONATION_RANGE_END = -113; // 0xffffff8f | 
|  | 358 | field public static final int TAG_NETWORK_STACK_IMPERSONATION_RANGE_START = -128; // 0xffffff80 | 
|  | 359 | field public static final int TAG_NETWORK_STACK_RANGE_END = -257; // 0xfffffeff | 
|  | 360 | field public static final int TAG_NETWORK_STACK_RANGE_START = -768; // 0xfffffd00 | 
|  | 361 | field public static final int TAG_SYSTEM_IMPERSONATION_RANGE_END = -241; // 0xffffff0f | 
|  | 362 | field public static final int TAG_SYSTEM_IMPERSONATION_RANGE_START = -256; // 0xffffff00 | 
|  | 363 | } | 
|  | 364 |  | 
|  | 365 | } | 
|  | 366 |  | 
|  | 367 | package android.net.netstats.provider { | 
|  | 368 |  | 
|  | 369 | public abstract class NetworkStatsProvider { | 
|  | 370 | ctor public NetworkStatsProvider(); | 
|  | 371 | method public void notifyAlertReached(); | 
|  | 372 | method public void notifyLimitReached(); | 
|  | 373 | method public void notifyStatsUpdated(int, @NonNull android.net.NetworkStats, @NonNull android.net.NetworkStats); | 
|  | 374 | method public void notifyWarningReached(); | 
|  | 375 | method public abstract void onRequestStatsUpdate(int); | 
|  | 376 | method public abstract void onSetAlert(long); | 
|  | 377 | method public abstract void onSetLimit(@NonNull String, long); | 
|  | 378 | method public void onSetWarningAndLimit(@NonNull String, long, long); | 
|  | 379 | field public static final int QUOTA_UNLIMITED = -1; // 0xffffffff | 
|  | 380 | } | 
|  | 381 |  | 
| Aaron Huang | 68ca373 | 2022-01-06 19:30:43 +0800 | [diff] [blame] | 382 | } | 
|  | 383 |  | 
| Yuyang Huang | 00cf7ed | 2023-05-15 10:54:07 +0900 | [diff] [blame] | 384 | package android.net.nsd { | 
|  | 385 |  | 
|  | 386 | public final class NsdManager { | 
| Motomu Utsumi | ce23d84 | 2023-11-28 16:18:00 +0900 | [diff] [blame] | 387 | method @FlaggedApi("com.android.net.flags.register_nsd_offload_engine_api") @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void registerOffloadEngine(@NonNull String, long, long, @NonNull java.util.concurrent.Executor, @NonNull android.net.nsd.OffloadEngine); | 
|  | 388 | method @FlaggedApi("com.android.net.flags.register_nsd_offload_engine_api") @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void unregisterOffloadEngine(@NonNull android.net.nsd.OffloadEngine); | 
| Yuyang Huang | 00cf7ed | 2023-05-15 10:54:07 +0900 | [diff] [blame] | 389 | } | 
|  | 390 |  | 
| Motomu Utsumi | ce23d84 | 2023-11-28 16:18:00 +0900 | [diff] [blame] | 391 | @FlaggedApi("com.android.net.flags.register_nsd_offload_engine_api") public interface OffloadEngine { | 
| Yuyang Huang | 00cf7ed | 2023-05-15 10:54:07 +0900 | [diff] [blame] | 392 | method public void onOffloadServiceRemoved(@NonNull android.net.nsd.OffloadServiceInfo); | 
|  | 393 | method public void onOffloadServiceUpdated(@NonNull android.net.nsd.OffloadServiceInfo); | 
|  | 394 | field public static final int OFFLOAD_CAPABILITY_BYPASS_MULTICAST_LOCK = 1; // 0x1 | 
|  | 395 | field public static final int OFFLOAD_TYPE_FILTER_QUERIES = 2; // 0x2 | 
|  | 396 | field public static final int OFFLOAD_TYPE_FILTER_REPLIES = 4; // 0x4 | 
|  | 397 | field public static final int OFFLOAD_TYPE_REPLY = 1; // 0x1 | 
|  | 398 | } | 
|  | 399 |  | 
| Motomu Utsumi | ce23d84 | 2023-11-28 16:18:00 +0900 | [diff] [blame] | 400 | @FlaggedApi("com.android.net.flags.register_nsd_offload_engine_api") public final class OffloadServiceInfo implements android.os.Parcelable { | 
| Yuyang Huang | 00cf7ed | 2023-05-15 10:54:07 +0900 | [diff] [blame] | 401 | ctor public OffloadServiceInfo(@NonNull android.net.nsd.OffloadServiceInfo.Key, @NonNull java.util.List<java.lang.String>, @NonNull String, @Nullable byte[], @IntRange(from=0, to=java.lang.Integer.MAX_VALUE) int, long); | 
|  | 402 | method public int describeContents(); | 
|  | 403 | method @NonNull public String getHostname(); | 
|  | 404 | method @NonNull public android.net.nsd.OffloadServiceInfo.Key getKey(); | 
|  | 405 | method @Nullable public byte[] getOffloadPayload(); | 
|  | 406 | method public long getOffloadType(); | 
|  | 407 | method public int getPriority(); | 
|  | 408 | method @NonNull public java.util.List<java.lang.String> getSubtypes(); | 
|  | 409 | method public void writeToParcel(@NonNull android.os.Parcel, int); | 
|  | 410 | field @NonNull public static final android.os.Parcelable.Creator<android.net.nsd.OffloadServiceInfo> CREATOR; | 
|  | 411 | } | 
|  | 412 |  | 
|  | 413 | public static final class OffloadServiceInfo.Key implements android.os.Parcelable { | 
|  | 414 | ctor public OffloadServiceInfo.Key(@NonNull String, @NonNull String); | 
|  | 415 | method public int describeContents(); | 
|  | 416 | method @NonNull public String getServiceName(); | 
|  | 417 | method @NonNull public String getServiceType(); | 
|  | 418 | method public void writeToParcel(@NonNull android.os.Parcel, int); | 
|  | 419 | field @NonNull public static final android.os.Parcelable.Creator<android.net.nsd.OffloadServiceInfo.Key> CREATOR; | 
|  | 420 | } | 
|  | 421 |  | 
|  | 422 | } | 
|  | 423 |  | 
| Kangping Dong | 1cec48f | 2023-08-21 18:48:14 +0800 | [diff] [blame] | 424 | package android.net.thread { | 
|  | 425 |  | 
| Kangping Dong | 7fea5fa | 2023-08-30 17:25:34 +0800 | [diff] [blame] | 426 | @FlaggedApi("com.android.net.thread.flags.thread_enabled") public final class ActiveOperationalDataset implements android.os.Parcelable { | 
| Kangping Dong | 7fea5fa | 2023-08-30 17:25:34 +0800 | [diff] [blame] | 427 | method public int describeContents(); | 
|  | 428 | method @NonNull public static android.net.thread.ActiveOperationalDataset fromThreadTlvs(@NonNull byte[]); | 
|  | 429 | method @NonNull public android.net.thread.OperationalDatasetTimestamp getActiveTimestamp(); | 
|  | 430 | method @IntRange(from=0, to=65535) public int getChannel(); | 
|  | 431 | method @NonNull @Size(min=1) public android.util.SparseArray<byte[]> getChannelMask(); | 
|  | 432 | method @IntRange(from=0, to=255) public int getChannelPage(); | 
|  | 433 | method @NonNull @Size(android.net.thread.ActiveOperationalDataset.LENGTH_EXTENDED_PAN_ID) public byte[] getExtendedPanId(); | 
|  | 434 | method @NonNull public android.net.IpPrefix getMeshLocalPrefix(); | 
|  | 435 | method @NonNull @Size(android.net.thread.ActiveOperationalDataset.LENGTH_NETWORK_KEY) public byte[] getNetworkKey(); | 
|  | 436 | method @NonNull @Size(min=android.net.thread.ActiveOperationalDataset.LENGTH_MIN_NETWORK_NAME_BYTES, max=android.net.thread.ActiveOperationalDataset.LENGTH_MAX_NETWORK_NAME_BYTES) public String getNetworkName(); | 
|  | 437 | method @IntRange(from=0, to=65534) public int getPanId(); | 
|  | 438 | method @NonNull @Size(android.net.thread.ActiveOperationalDataset.LENGTH_PSKC) public byte[] getPskc(); | 
|  | 439 | method @NonNull public android.net.thread.ActiveOperationalDataset.SecurityPolicy getSecurityPolicy(); | 
|  | 440 | method @NonNull public byte[] toThreadTlvs(); | 
|  | 441 | method public void writeToParcel(@NonNull android.os.Parcel, int); | 
|  | 442 | field public static final int CHANNEL_MAX_24_GHZ = 26; // 0x1a | 
|  | 443 | field public static final int CHANNEL_MIN_24_GHZ = 11; // 0xb | 
|  | 444 | field public static final int CHANNEL_PAGE_24_GHZ = 0; // 0x0 | 
|  | 445 | field @NonNull public static final android.os.Parcelable.Creator<android.net.thread.ActiveOperationalDataset> CREATOR; | 
|  | 446 | field public static final int LENGTH_EXTENDED_PAN_ID = 8; // 0x8 | 
|  | 447 | field public static final int LENGTH_MAX_DATASET_TLVS = 254; // 0xfe | 
|  | 448 | field public static final int LENGTH_MAX_NETWORK_NAME_BYTES = 16; // 0x10 | 
|  | 449 | field public static final int LENGTH_MESH_LOCAL_PREFIX_BITS = 64; // 0x40 | 
|  | 450 | field public static final int LENGTH_MIN_NETWORK_NAME_BYTES = 1; // 0x1 | 
|  | 451 | field public static final int LENGTH_NETWORK_KEY = 16; // 0x10 | 
|  | 452 | field public static final int LENGTH_PSKC = 16; // 0x10 | 
|  | 453 | } | 
|  | 454 |  | 
|  | 455 | public static final class ActiveOperationalDataset.Builder { | 
|  | 456 | ctor public ActiveOperationalDataset.Builder(@NonNull android.net.thread.ActiveOperationalDataset); | 
|  | 457 | ctor public ActiveOperationalDataset.Builder(); | 
|  | 458 | method @NonNull public android.net.thread.ActiveOperationalDataset build(); | 
|  | 459 | method @NonNull public android.net.thread.ActiveOperationalDataset.Builder setActiveTimestamp(@NonNull android.net.thread.OperationalDatasetTimestamp); | 
|  | 460 | method @NonNull public android.net.thread.ActiveOperationalDataset.Builder setChannel(@IntRange(from=0, to=255) int, @IntRange(from=0, to=65535) int); | 
|  | 461 | method @NonNull public android.net.thread.ActiveOperationalDataset.Builder setChannelMask(@NonNull @Size(min=1) android.util.SparseArray<byte[]>); | 
|  | 462 | method @NonNull public android.net.thread.ActiveOperationalDataset.Builder setExtendedPanId(@NonNull @Size(android.net.thread.ActiveOperationalDataset.LENGTH_EXTENDED_PAN_ID) byte[]); | 
|  | 463 | method @NonNull public android.net.thread.ActiveOperationalDataset.Builder setMeshLocalPrefix(@NonNull android.net.IpPrefix); | 
|  | 464 | method @NonNull public android.net.thread.ActiveOperationalDataset.Builder setNetworkKey(@NonNull @Size(android.net.thread.ActiveOperationalDataset.LENGTH_NETWORK_KEY) byte[]); | 
|  | 465 | method @NonNull public android.net.thread.ActiveOperationalDataset.Builder setNetworkName(@NonNull @Size(min=android.net.thread.ActiveOperationalDataset.LENGTH_MIN_NETWORK_NAME_BYTES, max=android.net.thread.ActiveOperationalDataset.LENGTH_MAX_NETWORK_NAME_BYTES) String); | 
|  | 466 | method @NonNull public android.net.thread.ActiveOperationalDataset.Builder setPanId(@IntRange(from=0, to=65534) int); | 
|  | 467 | method @NonNull public android.net.thread.ActiveOperationalDataset.Builder setPskc(@NonNull @Size(android.net.thread.ActiveOperationalDataset.LENGTH_PSKC) byte[]); | 
|  | 468 | method @NonNull public android.net.thread.ActiveOperationalDataset.Builder setSecurityPolicy(@NonNull android.net.thread.ActiveOperationalDataset.SecurityPolicy); | 
|  | 469 | } | 
|  | 470 |  | 
|  | 471 | public static final class ActiveOperationalDataset.SecurityPolicy { | 
|  | 472 | ctor public ActiveOperationalDataset.SecurityPolicy(@IntRange(from=1, to=65535) int, @NonNull @Size(min=android.net.thread.ActiveOperationalDataset.SecurityPolicy.LENGTH_MIN_SECURITY_POLICY_FLAGS) byte[]); | 
|  | 473 | method @NonNull @Size(min=android.net.thread.ActiveOperationalDataset.SecurityPolicy.LENGTH_MIN_SECURITY_POLICY_FLAGS) public byte[] getFlags(); | 
|  | 474 | method @IntRange(from=1, to=65535) public int getRotationTimeHours(); | 
|  | 475 | field public static final int DEFAULT_ROTATION_TIME_HOURS = 672; // 0x2a0 | 
|  | 476 | field public static final int LENGTH_MIN_SECURITY_POLICY_FLAGS = 1; // 0x1 | 
|  | 477 | } | 
|  | 478 |  | 
|  | 479 | @FlaggedApi("com.android.net.thread.flags.thread_enabled") public final class OperationalDatasetTimestamp { | 
|  | 480 | ctor public OperationalDatasetTimestamp(@IntRange(from=0, to=281474976710655L) long, @IntRange(from=0, to=32767) int, boolean); | 
|  | 481 | method @NonNull public static android.net.thread.OperationalDatasetTimestamp fromInstant(@NonNull java.time.Instant); | 
|  | 482 | method @IntRange(from=0, to=281474976710655L) public long getSeconds(); | 
|  | 483 | method @IntRange(from=0, to=32767) public int getTicks(); | 
|  | 484 | method public boolean isAuthoritativeSource(); | 
|  | 485 | method @NonNull public java.time.Instant toInstant(); | 
|  | 486 | } | 
|  | 487 |  | 
|  | 488 | @FlaggedApi("com.android.net.thread.flags.thread_enabled") public final class PendingOperationalDataset implements android.os.Parcelable { | 
|  | 489 | ctor public PendingOperationalDataset(@NonNull android.net.thread.ActiveOperationalDataset, @NonNull android.net.thread.OperationalDatasetTimestamp, @NonNull java.time.Duration); | 
|  | 490 | method public int describeContents(); | 
|  | 491 | method @NonNull public static android.net.thread.PendingOperationalDataset fromThreadTlvs(@NonNull byte[]); | 
|  | 492 | method @NonNull public android.net.thread.ActiveOperationalDataset getActiveOperationalDataset(); | 
|  | 493 | method @NonNull public java.time.Duration getDelayTimer(); | 
|  | 494 | method @NonNull public android.net.thread.OperationalDatasetTimestamp getPendingTimestamp(); | 
|  | 495 | method @NonNull public byte[] toThreadTlvs(); | 
|  | 496 | method public void writeToParcel(@NonNull android.os.Parcel, int); | 
|  | 497 | field @NonNull public static final android.os.Parcelable.Creator<android.net.thread.PendingOperationalDataset> CREATOR; | 
|  | 498 | } | 
|  | 499 |  | 
| Kangping Dong | 5e1d430 | 2023-10-17 21:55:19 +0800 | [diff] [blame] | 500 | @FlaggedApi("com.android.net.thread.flags.thread_enabled") public final class ThreadNetworkController { | 
| Kangping Dong | af4f1f5 | 2023-10-27 19:32:10 +0800 | [diff] [blame] | 501 | method public void createRandomizedDataset(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.net.thread.ActiveOperationalDataset,android.net.thread.ThreadNetworkException>); | 
| Kangping Dong | 1cec48f | 2023-08-21 18:48:14 +0800 | [diff] [blame] | 502 | method public int getThreadVersion(); | 
| Kangping Dong | b1c75db | 2023-08-30 19:15:04 +0800 | [diff] [blame] | 503 | method public static boolean isAttached(int); | 
|  | 504 | method @RequiresPermission("android.permission.THREAD_NETWORK_PRIVILEGED") public void join(@NonNull android.net.thread.ActiveOperationalDataset, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Void,android.net.thread.ThreadNetworkException>); | 
|  | 505 | method @RequiresPermission("android.permission.THREAD_NETWORK_PRIVILEGED") public void leave(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Void,android.net.thread.ThreadNetworkException>); | 
|  | 506 | method @RequiresPermission(allOf={android.Manifest.permission.ACCESS_NETWORK_STATE, "android.permission.THREAD_NETWORK_PRIVILEGED"}) public void registerOperationalDatasetCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.thread.ThreadNetworkController.OperationalDatasetCallback); | 
|  | 507 | method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public void registerStateCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.thread.ThreadNetworkController.StateCallback); | 
|  | 508 | method @RequiresPermission("android.permission.THREAD_NETWORK_PRIVILEGED") public void scheduleMigration(@NonNull android.net.thread.PendingOperationalDataset, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Void,android.net.thread.ThreadNetworkException>); | 
| Yang Sun | 0797d9d | 2024-01-06 17:41:46 +0800 | [diff] [blame] | 509 | method @RequiresPermission("android.permission.THREAD_NETWORK_PRIVILEGED") public void setEnabled(boolean, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Void,android.net.thread.ThreadNetworkException>); | 
| Kangping Dong | 8e44412 | 2023-11-13 17:29:07 +0800 | [diff] [blame] | 510 | method @RequiresPermission(allOf={android.Manifest.permission.ACCESS_NETWORK_STATE, "android.permission.THREAD_NETWORK_PRIVILEGED"}) public void unregisterOperationalDatasetCallback(@NonNull android.net.thread.ThreadNetworkController.OperationalDatasetCallback); | 
|  | 511 | method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public void unregisterStateCallback(@NonNull android.net.thread.ThreadNetworkController.StateCallback); | 
| Kangping Dong | b1c75db | 2023-08-30 19:15:04 +0800 | [diff] [blame] | 512 | field public static final int DEVICE_ROLE_CHILD = 2; // 0x2 | 
|  | 513 | field public static final int DEVICE_ROLE_DETACHED = 1; // 0x1 | 
|  | 514 | field public static final int DEVICE_ROLE_LEADER = 4; // 0x4 | 
|  | 515 | field public static final int DEVICE_ROLE_ROUTER = 3; // 0x3 | 
|  | 516 | field public static final int DEVICE_ROLE_STOPPED = 0; // 0x0 | 
| Yang Sun | 0797d9d | 2024-01-06 17:41:46 +0800 | [diff] [blame] | 517 | field public static final int STATE_DISABLED = 0; // 0x0 | 
|  | 518 | field public static final int STATE_DISABLING = 2; // 0x2 | 
|  | 519 | field public static final int STATE_ENABLED = 1; // 0x1 | 
| Kangping Dong | 1cec48f | 2023-08-21 18:48:14 +0800 | [diff] [blame] | 520 | field public static final int THREAD_VERSION_1_3 = 4; // 0x4 | 
|  | 521 | } | 
|  | 522 |  | 
| Kangping Dong | b1c75db | 2023-08-30 19:15:04 +0800 | [diff] [blame] | 523 | public static interface ThreadNetworkController.OperationalDatasetCallback { | 
|  | 524 | method public void onActiveOperationalDatasetChanged(@Nullable android.net.thread.ActiveOperationalDataset); | 
|  | 525 | method public default void onPendingOperationalDatasetChanged(@Nullable android.net.thread.PendingOperationalDataset); | 
|  | 526 | } | 
|  | 527 |  | 
|  | 528 | public static interface ThreadNetworkController.StateCallback { | 
|  | 529 | method public void onDeviceRoleChanged(int); | 
|  | 530 | method public default void onPartitionIdChanged(long); | 
| Yang Sun | 0797d9d | 2024-01-06 17:41:46 +0800 | [diff] [blame] | 531 | method public default void onThreadEnableStateChanged(int); | 
| Kangping Dong | b1c75db | 2023-08-30 19:15:04 +0800 | [diff] [blame] | 532 | } | 
|  | 533 |  | 
|  | 534 | @FlaggedApi("com.android.net.thread.flags.thread_enabled") public class ThreadNetworkException extends java.lang.Exception { | 
|  | 535 | ctor public ThreadNetworkException(int, @NonNull String); | 
|  | 536 | method public int getErrorCode(); | 
|  | 537 | field public static final int ERROR_ABORTED = 2; // 0x2 | 
|  | 538 | field public static final int ERROR_BUSY = 5; // 0x5 | 
|  | 539 | field public static final int ERROR_FAILED_PRECONDITION = 6; // 0x6 | 
|  | 540 | field public static final int ERROR_INTERNAL_ERROR = 1; // 0x1 | 
|  | 541 | field public static final int ERROR_REJECTED_BY_PEER = 8; // 0x8 | 
|  | 542 | field public static final int ERROR_RESOURCE_EXHAUSTED = 10; // 0xa | 
|  | 543 | field public static final int ERROR_RESPONSE_BAD_FORMAT = 9; // 0x9 | 
| Yang Sun | 0797d9d | 2024-01-06 17:41:46 +0800 | [diff] [blame] | 544 | field public static final int ERROR_THREAD_DISABLED = 12; // 0xc | 
| Kangping Dong | b1c75db | 2023-08-30 19:15:04 +0800 | [diff] [blame] | 545 | field public static final int ERROR_TIMEOUT = 3; // 0x3 | 
|  | 546 | field public static final int ERROR_UNAVAILABLE = 4; // 0x4 | 
| Kangping Dong | 2c83e2f | 2024-01-16 15:43:45 +0800 | [diff] [blame] | 547 | field public static final int ERROR_UNKNOWN = 11; // 0xb | 
| Kangping Dong | b1c75db | 2023-08-30 19:15:04 +0800 | [diff] [blame] | 548 | field public static final int ERROR_UNSUPPORTED_CHANNEL = 7; // 0x7 | 
|  | 549 | } | 
|  | 550 |  | 
| Kangping Dong | 5e1d430 | 2023-10-17 21:55:19 +0800 | [diff] [blame] | 551 | @FlaggedApi("com.android.net.thread.flags.thread_enabled") public final class ThreadNetworkManager { | 
| Kangping Dong | 1cec48f | 2023-08-21 18:48:14 +0800 | [diff] [blame] | 552 | method @NonNull public java.util.List<android.net.thread.ThreadNetworkController> getAllThreadNetworkControllers(); | 
|  | 553 | } | 
|  | 554 |  | 
|  | 555 | } | 
|  | 556 |  |