1// Signature format: 2.0 2package android.net { 3 4 public final class TetheredClient implements android.os.Parcelable { 5 ctor public TetheredClient(@NonNull android.net.MacAddress, @NonNull java.util.Collection<android.net.TetheredClient.AddressInfo>, int); 6 method public int describeContents(); 7 method @NonNull public java.util.List<android.net.TetheredClient.AddressInfo> getAddresses(); 8 method @NonNull public android.net.MacAddress getMacAddress(); 9 method public int getTetheringType(); 10 method public void writeToParcel(@NonNull android.os.Parcel, int); 11 field @NonNull public static final android.os.Parcelable.Creator<android.net.TetheredClient> CREATOR; 12 } 13 14 public static final class TetheredClient.AddressInfo implements android.os.Parcelable { 15 method public int describeContents(); 16 method @NonNull public android.net.LinkAddress getAddress(); 17 method @Nullable public String getHostname(); 18 method public void writeToParcel(@NonNull android.os.Parcel, int); 19 field @NonNull public static final android.os.Parcelable.Creator<android.net.TetheredClient.AddressInfo> CREATOR; 20 } 21 22 public final class TetheringInterface implements android.os.Parcelable { 23 ctor public TetheringInterface(int, @NonNull String); 24 method public int describeContents(); 25 method @NonNull public String getInterface(); 26 method public int getType(); 27 method public void writeToParcel(@NonNull android.os.Parcel, int); 28 field @NonNull public static final android.os.Parcelable.Creator<android.net.TetheringInterface> CREATOR; 29 } 30 31 public class TetheringManager { 32 method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public void registerTetheringEventCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.TetheringManager.TetheringEventCallback); 33 method @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.WRITE_SETTINGS}) public void requestLatestTetheringEntitlementResult(int, boolean, @NonNull java.util.concurrent.Executor, @NonNull android.net.TetheringManager.OnTetheringEntitlementResultListener); 34 method @RequiresPermission(anyOf={android.Manifest.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); 35 method @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.WRITE_SETTINGS}) public void stopAllTethering(); 36 method @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.WRITE_SETTINGS}) public void stopTethering(int); 37 method @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.ACCESS_NETWORK_STATE}) public void unregisterTetheringEventCallback(@NonNull android.net.TetheringManager.TetheringEventCallback); 38 field @Deprecated public static final String ACTION_TETHER_STATE_CHANGED = "android.net.conn.TETHER_STATE_CHANGED"; 39 field public static final int CONNECTIVITY_SCOPE_GLOBAL = 1; // 0x1 40 field public static final int CONNECTIVITY_SCOPE_LOCAL = 2; // 0x2 41 field public static final String EXTRA_ACTIVE_LOCAL_ONLY = "android.net.extra.ACTIVE_LOCAL_ONLY"; 42 field public static final String EXTRA_ACTIVE_TETHER = "tetherArray"; 43 field public static final String EXTRA_AVAILABLE_TETHER = "availableArray"; 44 field public static final String EXTRA_ERRORED_TETHER = "erroredArray"; 45 field public static final int TETHERING_BLUETOOTH = 2; // 0x2 46 field public static final int TETHERING_ETHERNET = 5; // 0x5 47 field public static final int TETHERING_INVALID = -1; // 0xffffffff 48 field public static final int TETHERING_NCM = 4; // 0x4 49 field public static final int TETHERING_USB = 1; // 0x1 50 field public static final int TETHERING_WIFI = 0; // 0x0 51 field public static final int TETHERING_WIFI_P2P = 3; // 0x3 52 field public static final int TETHER_ERROR_DHCPSERVER_ERROR = 12; // 0xc 53 field public static final int TETHER_ERROR_DISABLE_FORWARDING_ERROR = 9; // 0x9 54 field public static final int TETHER_ERROR_ENABLE_FORWARDING_ERROR = 8; // 0x8 55 field public static final int TETHER_ERROR_ENTITLEMENT_UNKNOWN = 13; // 0xd 56 field public static final int TETHER_ERROR_IFACE_CFG_ERROR = 10; // 0xa 57 field public static final int TETHER_ERROR_INTERNAL_ERROR = 5; // 0x5 58 field public static final int TETHER_ERROR_NO_ACCESS_TETHERING_PERMISSION = 15; // 0xf 59 field public static final int TETHER_ERROR_NO_CHANGE_TETHERING_PERMISSION = 14; // 0xe 60 field public static final int TETHER_ERROR_NO_ERROR = 0; // 0x0 61 field public static final int TETHER_ERROR_PROVISIONING_FAILED = 11; // 0xb 62 field public static final int TETHER_ERROR_SERVICE_UNAVAIL = 2; // 0x2 63 field public static final int TETHER_ERROR_TETHER_IFACE_ERROR = 6; // 0x6 64 field public static final int TETHER_ERROR_UNAVAIL_IFACE = 4; // 0x4 65 field public static final int TETHER_ERROR_UNKNOWN_IFACE = 1; // 0x1 66 field public static final int TETHER_ERROR_UNKNOWN_TYPE = 16; // 0x10 67 field public static final int TETHER_ERROR_UNSUPPORTED = 3; // 0x3 68 field public static final int TETHER_ERROR_UNTETHER_IFACE_ERROR = 7; // 0x7 69 field public static final int TETHER_HARDWARE_OFFLOAD_FAILED = 2; // 0x2 70 field public static final int TETHER_HARDWARE_OFFLOAD_STARTED = 1; // 0x1 71 field public static final int TETHER_HARDWARE_OFFLOAD_STOPPED = 0; // 0x0 72 } 73 74 public static interface TetheringManager.OnTetheringEntitlementResultListener { 75 method public void onTetheringEntitlementResult(int); 76 } 77 78 public static interface TetheringManager.StartTetheringCallback { 79 method public default void onTetheringFailed(int); 80 method public default void onTetheringStarted(); 81 } 82 83 public static interface TetheringManager.TetheringEventCallback { 84 method public default void onClientsChanged(@NonNull java.util.Collection<android.net.TetheredClient>); 85 method public default void onError(@NonNull String, int); 86 method public default void onError(@NonNull android.net.TetheringInterface, int); 87 method public default void onLocalOnlyInterfacesChanged(@NonNull java.util.List<java.lang.String>); 88 method public default void onLocalOnlyInterfacesChanged(@NonNull java.util.Set<android.net.TetheringInterface>); 89 method public default void onOffloadStatusChanged(int); 90 method public default void onTetherableInterfacesChanged(@NonNull java.util.List<java.lang.String>); 91 method public default void onTetherableInterfacesChanged(@NonNull java.util.Set<android.net.TetheringInterface>); 92 method public default void onTetheredInterfacesChanged(@NonNull java.util.List<java.lang.String>); 93 method public default void onTetheredInterfacesChanged(@NonNull java.util.Set<android.net.TetheringInterface>); 94 method public default void onTetheringSupported(boolean); 95 method public default void onUpstreamChanged(@Nullable android.net.Network); 96 } 97 98 public static class TetheringManager.TetheringRequest { 99 method @Nullable public android.net.LinkAddress getClientStaticIpv4Address(); 100 method public int getConnectivityScope(); 101 method @Nullable public android.net.LinkAddress getLocalIpv4Address(); 102 method public boolean getShouldShowEntitlementUi(); 103 method public int getTetheringType(); 104 method public boolean isExemptFromEntitlementCheck(); 105 } 106 107 public static class TetheringManager.TetheringRequest.Builder { 108 ctor public TetheringManager.TetheringRequest.Builder(int); 109 method @NonNull public android.net.TetheringManager.TetheringRequest build(); 110 method @NonNull @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public android.net.TetheringManager.TetheringRequest.Builder setConnectivityScope(int); 111 method @NonNull @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public android.net.TetheringManager.TetheringRequest.Builder setExemptFromEntitlementCheck(boolean); 112 method @NonNull @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public android.net.TetheringManager.TetheringRequest.Builder setShouldShowEntitlementUi(boolean); 113 method @NonNull @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public android.net.TetheringManager.TetheringRequest.Builder setStaticIpv4Addresses(@NonNull android.net.LinkAddress, @NonNull android.net.LinkAddress); 114 } 115 116} 117 118