Jiyong Park | 2e6cdcc | 2019-12-20 15:30:28 +0900 | [diff] [blame] | 1 | // Signature format: 2.0 |
Anton Hansson | 7f94169 | 2020-02-08 12:15:25 +0000 | [diff] [blame] | 2 | package android.annotation { |
| 3 | |
| 4 | @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD}) public @interface NonNull { |
| 5 | } |
| 6 | |
| 7 | @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD}) public @interface Nullable { |
| 8 | } |
| 9 | |
| 10 | } |
| 11 | |
markchien | 8cf2a55 | 2020-02-14 11:55:48 +0800 | [diff] [blame] | 12 | package android.net { |
| 13 | |
| 14 | public final class TetheredClient implements android.os.Parcelable { |
| 15 | ctor public TetheredClient(@NonNull android.net.MacAddress, @NonNull java.util.Collection<android.net.TetheredClient.AddressInfo>, int); |
| 16 | method public int describeContents(); |
| 17 | method @NonNull public java.util.List<android.net.TetheredClient.AddressInfo> getAddresses(); |
| 18 | method @NonNull public android.net.MacAddress getMacAddress(); |
| 19 | method public int getTetheringType(); |
| 20 | method public void writeToParcel(@NonNull android.os.Parcel, int); |
| 21 | field @NonNull public static final android.os.Parcelable.Creator<android.net.TetheredClient> CREATOR; |
| 22 | } |
| 23 | |
| 24 | public static final class TetheredClient.AddressInfo implements android.os.Parcelable { |
| 25 | method public int describeContents(); |
| 26 | method @NonNull public android.net.LinkAddress getAddress(); |
| 27 | method @Nullable public String getHostname(); |
| 28 | method public void writeToParcel(@NonNull android.os.Parcel, int); |
| 29 | field @NonNull public static final android.os.Parcelable.Creator<android.net.TetheredClient.AddressInfo> CREATOR; |
| 30 | } |
| 31 | |
markchien | 070c260 | 2020-03-15 22:54:57 +0800 | [diff] [blame] | 32 | public final class TetheringConstants { |
markchien | 8cf2a55 | 2020-02-14 11:55:48 +0800 | [diff] [blame] | 33 | field public static final String EXTRA_ADD_TETHER_TYPE = "extraAddTetherType"; |
| 34 | field public static final String EXTRA_PROVISION_CALLBACK = "extraProvisionCallback"; |
| 35 | field public static final String EXTRA_REM_TETHER_TYPE = "extraRemTetherType"; |
| 36 | field public static final String EXTRA_RUN_PROVISION = "extraRunProvision"; |
| 37 | field public static final String EXTRA_SET_ALARM = "extraSetAlarm"; |
| 38 | } |
| 39 | |
| 40 | public class TetheringManager { |
| 41 | ctor public TetheringManager(@NonNull android.content.Context, @NonNull java.util.function.Supplier<android.os.IBinder>); |
| 42 | method public int getLastTetherError(@NonNull String); |
| 43 | method @NonNull public String[] getTetherableBluetoothRegexs(); |
| 44 | method @NonNull public String[] getTetherableIfaces(); |
| 45 | method @NonNull public String[] getTetherableUsbRegexs(); |
| 46 | method @NonNull public String[] getTetherableWifiRegexs(); |
| 47 | method @NonNull public String[] getTetheredIfaces(); |
| 48 | method @NonNull public String[] getTetheringErroredIfaces(); |
| 49 | method public boolean isTetheringSupported(); |
markchien | 6ead365 | 2020-01-21 20:38:04 +0800 | [diff] [blame] | 50 | method public boolean isTetheringSupported(@NonNull String); |
markchien | 8cf2a55 | 2020-02-14 11:55:48 +0800 | [diff] [blame] | 51 | method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public void registerTetheringEventCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.TetheringManager.TetheringEventCallback); |
| 52 | method @RequiresPermission(anyOf={"android.permission.TETHER_PRIVILEGED", android.Manifest.permission.WRITE_SETTINGS}) public void requestLatestTetheringEntitlementResult(int, boolean, @NonNull java.util.concurrent.Executor, @NonNull android.net.TetheringManager.OnTetheringEntitlementResultListener); |
| 53 | method public void requestLatestTetheringEntitlementResult(int, @NonNull android.os.ResultReceiver, boolean); |
| 54 | method @Deprecated public int setUsbTethering(boolean); |
| 55 | method @RequiresPermission(anyOf={"android.permission.TETHER_PRIVILEGED", android.Manifest.permission.WRITE_SETTINGS}) public void startTethering(@NonNull android.net.TetheringManager.TetheringRequest, @NonNull java.util.concurrent.Executor, @NonNull android.net.TetheringManager.StartTetheringCallback); |
| 56 | method @RequiresPermission(anyOf={"android.permission.TETHER_PRIVILEGED", android.Manifest.permission.WRITE_SETTINGS}) public void startTethering(int, @NonNull java.util.concurrent.Executor, @NonNull android.net.TetheringManager.StartTetheringCallback); |
| 57 | method @RequiresPermission(anyOf={"android.permission.TETHER_PRIVILEGED", android.Manifest.permission.WRITE_SETTINGS}) public void stopAllTethering(); |
| 58 | method @RequiresPermission(anyOf={"android.permission.TETHER_PRIVILEGED", android.Manifest.permission.WRITE_SETTINGS}) public void stopTethering(int); |
| 59 | method @Deprecated public int tether(@NonNull String); |
| 60 | method @RequiresPermission(anyOf={"android.permission.TETHER_PRIVILEGED", android.Manifest.permission.ACCESS_NETWORK_STATE}) public void unregisterTetheringEventCallback(@NonNull android.net.TetheringManager.TetheringEventCallback); |
| 61 | method @Deprecated public int untether(@NonNull String); |
| 62 | field public static final String ACTION_TETHER_STATE_CHANGED = "android.net.conn.TETHER_STATE_CHANGED"; |
| 63 | field public static final String EXTRA_ACTIVE_LOCAL_ONLY = "android.net.extra.ACTIVE_LOCAL_ONLY"; |
| 64 | field public static final String EXTRA_ACTIVE_TETHER = "tetherArray"; |
| 65 | field public static final String EXTRA_AVAILABLE_TETHER = "availableArray"; |
| 66 | field public static final String EXTRA_ERRORED_TETHER = "erroredArray"; |
| 67 | field public static final int TETHERING_BLUETOOTH = 2; // 0x2 |
| 68 | field public static final int TETHERING_ETHERNET = 5; // 0x5 |
| 69 | field public static final int TETHERING_INVALID = -1; // 0xffffffff |
| 70 | field public static final int TETHERING_NCM = 4; // 0x4 |
| 71 | field public static final int TETHERING_USB = 1; // 0x1 |
| 72 | field public static final int TETHERING_WIFI = 0; // 0x0 |
| 73 | field public static final int TETHERING_WIFI_P2P = 3; // 0x3 |
| 74 | field public static final int TETHER_ERROR_DHCPSERVER_ERROR = 12; // 0xc |
markchien | 7432360 | 2020-03-19 13:37:43 +0800 | [diff] [blame] | 75 | field public static final int TETHER_ERROR_DISABLE_FORWARDING_ERROR = 9; // 0x9 |
| 76 | field public static final int TETHER_ERROR_ENABLE_FORWARDING_ERROR = 8; // 0x8 |
markchien | 8cf2a55 | 2020-02-14 11:55:48 +0800 | [diff] [blame] | 77 | field public static final int TETHER_ERROR_ENTITLEMENT_UNKNOWN = 13; // 0xd |
| 78 | field public static final int TETHER_ERROR_IFACE_CFG_ERROR = 10; // 0xa |
markchien | 7432360 | 2020-03-19 13:37:43 +0800 | [diff] [blame] | 79 | field public static final int TETHER_ERROR_INTERNAL_ERROR = 5; // 0x5 |
markchien | 8cf2a55 | 2020-02-14 11:55:48 +0800 | [diff] [blame] | 80 | field public static final int TETHER_ERROR_NO_ACCESS_TETHERING_PERMISSION = 15; // 0xf |
| 81 | field public static final int TETHER_ERROR_NO_CHANGE_TETHERING_PERMISSION = 14; // 0xe |
| 82 | field public static final int TETHER_ERROR_NO_ERROR = 0; // 0x0 |
markchien | 7432360 | 2020-03-19 13:37:43 +0800 | [diff] [blame] | 83 | field public static final int TETHER_ERROR_PROVISIONING_FAILED = 11; // 0xb |
markchien | 8cf2a55 | 2020-02-14 11:55:48 +0800 | [diff] [blame] | 84 | field public static final int TETHER_ERROR_SERVICE_UNAVAIL = 2; // 0x2 |
| 85 | field public static final int TETHER_ERROR_TETHER_IFACE_ERROR = 6; // 0x6 |
| 86 | field public static final int TETHER_ERROR_UNAVAIL_IFACE = 4; // 0x4 |
| 87 | field public static final int TETHER_ERROR_UNKNOWN_IFACE = 1; // 0x1 |
markchien | 7432360 | 2020-03-19 13:37:43 +0800 | [diff] [blame] | 88 | field public static final int TETHER_ERROR_UNKNOWN_TYPE = 16; // 0x10 |
markchien | 8cf2a55 | 2020-02-14 11:55:48 +0800 | [diff] [blame] | 89 | field public static final int TETHER_ERROR_UNSUPPORTED = 3; // 0x3 |
| 90 | field public static final int TETHER_ERROR_UNTETHER_IFACE_ERROR = 7; // 0x7 |
markchien | de31d85 | 2020-03-02 23:27:48 +0800 | [diff] [blame] | 91 | field public static final int TETHER_HARDWARE_OFFLOAD_FAILED = 2; // 0x2 |
| 92 | field public static final int TETHER_HARDWARE_OFFLOAD_STARTED = 1; // 0x1 |
| 93 | field public static final int TETHER_HARDWARE_OFFLOAD_STOPPED = 0; // 0x0 |
markchien | 8cf2a55 | 2020-02-14 11:55:48 +0800 | [diff] [blame] | 94 | } |
| 95 | |
| 96 | public static interface TetheringManager.OnTetheringEntitlementResultListener { |
| 97 | method public void onTetheringEntitlementResult(int); |
| 98 | } |
| 99 | |
markchien | 7432360 | 2020-03-19 13:37:43 +0800 | [diff] [blame] | 100 | public static interface TetheringManager.StartTetheringCallback { |
| 101 | method public default void onTetheringFailed(int); |
| 102 | method public default void onTetheringStarted(); |
markchien | 8cf2a55 | 2020-02-14 11:55:48 +0800 | [diff] [blame] | 103 | } |
| 104 | |
markchien | 7432360 | 2020-03-19 13:37:43 +0800 | [diff] [blame] | 105 | public static interface TetheringManager.TetheringEventCallback { |
| 106 | method public default void onClientsChanged(@NonNull java.util.Collection<android.net.TetheredClient>); |
| 107 | method public default void onError(@NonNull String, int); |
| 108 | method public default void onOffloadStatusChanged(int); |
| 109 | method public default void onTetherableInterfaceRegexpsChanged(@NonNull android.net.TetheringManager.TetheringInterfaceRegexps); |
| 110 | method public default void onTetherableInterfacesChanged(@NonNull java.util.List<java.lang.String>); |
| 111 | method public default void onTetheredInterfacesChanged(@NonNull java.util.List<java.lang.String>); |
| 112 | method public default void onTetheringSupported(boolean); |
| 113 | method public default void onUpstreamChanged(@Nullable android.net.Network); |
markchien | 8cf2a55 | 2020-02-14 11:55:48 +0800 | [diff] [blame] | 114 | } |
| 115 | |
markchien | 7432360 | 2020-03-19 13:37:43 +0800 | [diff] [blame] | 116 | public static class TetheringManager.TetheringInterfaceRegexps { |
| 117 | method @NonNull public java.util.List<java.lang.String> getTetherableBluetoothRegexs(); |
| 118 | method @NonNull public java.util.List<java.lang.String> getTetherableUsbRegexs(); |
| 119 | method @NonNull public java.util.List<java.lang.String> getTetherableWifiRegexs(); |
markchien | 8cf2a55 | 2020-02-14 11:55:48 +0800 | [diff] [blame] | 120 | } |
| 121 | |
| 122 | public static class TetheringManager.TetheringRequest { |
| 123 | } |
| 124 | |
| 125 | public static class TetheringManager.TetheringRequest.Builder { |
| 126 | ctor public TetheringManager.TetheringRequest.Builder(int); |
| 127 | method @NonNull public android.net.TetheringManager.TetheringRequest build(); |
markchien | b69c39a | 2020-03-16 21:49:48 +0800 | [diff] [blame] | 128 | method @Nullable public android.net.LinkAddress getClientStaticIpv4Address(); |
| 129 | method @Nullable public android.net.LinkAddress getLocalIpv4Address(); |
markchien | 7432360 | 2020-03-19 13:37:43 +0800 | [diff] [blame] | 130 | method public boolean getShouldShowEntitlementUi(); |
| 131 | method public int getTetheringType(); |
| 132 | method public boolean isExemptFromEntitlementCheck(); |
markchien | 8cf2a55 | 2020-02-14 11:55:48 +0800 | [diff] [blame] | 133 | method @NonNull @RequiresPermission("android.permission.TETHER_PRIVILEGED") public android.net.TetheringManager.TetheringRequest.Builder setExemptFromEntitlementCheck(boolean); |
markchien | 7432360 | 2020-03-19 13:37:43 +0800 | [diff] [blame] | 134 | method @NonNull @RequiresPermission("android.permission.TETHER_PRIVILEGED") public android.net.TetheringManager.TetheringRequest.Builder setShouldShowEntitlementUi(boolean); |
markchien | b69c39a | 2020-03-16 21:49:48 +0800 | [diff] [blame] | 135 | method @NonNull @RequiresPermission("android.permission.TETHER_PRIVILEGED") public android.net.TetheringManager.TetheringRequest.Builder setStaticIpv4Addresses(@NonNull android.net.LinkAddress, @NonNull android.net.LinkAddress); |
markchien | 8cf2a55 | 2020-02-14 11:55:48 +0800 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | } |
| 139 | |