Anton Hansson | 65d1e30 | 2020-01-17 19:03:34 +0000 | [diff] [blame] | 1 | // Signature format: 2.0 |
| 2 | package android.net { |
| 3 | |
Anton Hansson | 65d1e30 | 2020-01-17 19:03:34 +0000 | [diff] [blame] | 4 | public final class TetheringConstants { |
| 5 | field public static final String EXTRA_ADD_TETHER_TYPE = "extraAddTetherType"; |
| 6 | field public static final String EXTRA_PROVISION_CALLBACK = "extraProvisionCallback"; |
| 7 | field public static final String EXTRA_REM_TETHER_TYPE = "extraRemTetherType"; |
| 8 | field public static final String EXTRA_RUN_PROVISION = "extraRunProvision"; |
| 9 | field public static final String EXTRA_SET_ALARM = "extraSetAlarm"; |
| 10 | } |
| 11 | |
| 12 | public class TetheringManager { |
| 13 | ctor public TetheringManager(@NonNull android.content.Context, @NonNull java.util.function.Supplier<android.os.IBinder>); |
| 14 | method public int getLastTetherError(@NonNull String); |
| 15 | method @NonNull public String[] getTetherableBluetoothRegexs(); |
| 16 | method @NonNull public String[] getTetherableIfaces(); |
| 17 | method @NonNull public String[] getTetherableUsbRegexs(); |
| 18 | method @NonNull public String[] getTetherableWifiRegexs(); |
| 19 | method @NonNull public String[] getTetheredIfaces(); |
| 20 | method @NonNull public String[] getTetheringErroredIfaces(); |
| 21 | method public boolean isTetheringSupported(); |
| 22 | method public boolean isTetheringSupported(@NonNull String); |
Anton Hansson | 65d1e30 | 2020-01-17 19:03:34 +0000 | [diff] [blame] | 23 | method public void requestLatestTetheringEntitlementResult(int, @NonNull android.os.ResultReceiver, boolean); |
| 24 | method @Deprecated public int setUsbTethering(boolean); |
Anton Hansson | 65d1e30 | 2020-01-17 19:03:34 +0000 | [diff] [blame] | 25 | method @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.WRITE_SETTINGS}) public void startTethering(int, @NonNull java.util.concurrent.Executor, @NonNull android.net.TetheringManager.StartTetheringCallback); |
Anton Hansson | 65d1e30 | 2020-01-17 19:03:34 +0000 | [diff] [blame] | 26 | method @Deprecated public int tether(@NonNull String); |
Anton Hansson | 65d1e30 | 2020-01-17 19:03:34 +0000 | [diff] [blame] | 27 | method @Deprecated public int untether(@NonNull String); |
Anton Hansson | 65d1e30 | 2020-01-17 19:03:34 +0000 | [diff] [blame] | 28 | } |
| 29 | |
markchien | 48e271b | 2021-10-28 22:56:49 +0800 | [diff] [blame] | 30 | public static interface TetheringManager.TetheredInterfaceCallback { |
| 31 | method public void onAvailable(@NonNull String); |
| 32 | method public void onUnavailable(); |
| 33 | } |
| 34 | |
| 35 | public static interface TetheringManager.TetheredInterfaceRequest { |
| 36 | method public void release(); |
| 37 | } |
| 38 | |
Anton Hansson | 4168cea | 2020-03-20 13:24:30 +0000 | [diff] [blame] | 39 | public static interface TetheringManager.TetheringEventCallback { |
markchien | 35ad54b | 2021-05-17 20:43:41 +0800 | [diff] [blame] | 40 | method @Deprecated public default void onTetherableInterfaceRegexpsChanged(@NonNull android.net.TetheringManager.TetheringInterfaceRegexps); |
Anton Hansson | 65d1e30 | 2020-01-17 19:03:34 +0000 | [diff] [blame] | 41 | } |
| 42 | |
markchien | 35ad54b | 2021-05-17 20:43:41 +0800 | [diff] [blame] | 43 | @Deprecated public static class TetheringManager.TetheringInterfaceRegexps { |
| 44 | method @Deprecated @NonNull public java.util.List<java.lang.String> getTetherableBluetoothRegexs(); |
| 45 | method @Deprecated @NonNull public java.util.List<java.lang.String> getTetherableUsbRegexs(); |
| 46 | method @Deprecated @NonNull public java.util.List<java.lang.String> getTetherableWifiRegexs(); |
Anton Hansson | 65d1e30 | 2020-01-17 19:03:34 +0000 | [diff] [blame] | 47 | } |
| 48 | |
Oscar Shu | 46722ad | 2024-11-05 01:01:54 +0000 | [diff] [blame] | 49 | public static final class TetheringManager.TetheringRequest implements android.os.Parcelable { |
Seungjae Yoo | eab1de4 | 2024-09-10 12:11:34 +0900 | [diff] [blame] | 50 | method @FlaggedApi("com.android.net.flags.tethering_with_soft_ap_config") @Nullable public String getInterfaceName(); |
Lorenzo Colitti | 172fe79 | 2024-11-13 17:16:50 +0000 | [diff] [blame] | 51 | method @FlaggedApi("com.android.net.flags.tethering_with_soft_ap_config") @Nullable public String getPackageName(); |
| 52 | method @FlaggedApi("com.android.net.flags.tethering_with_soft_ap_config") public int getUid(); |
Oscar Shu | 46722ad | 2024-11-05 01:01:54 +0000 | [diff] [blame] | 53 | } |
| 54 | |
Seungjae Yoo | eab1de4 | 2024-09-10 12:11:34 +0900 | [diff] [blame] | 55 | public static class TetheringManager.TetheringRequest.Builder { |
| 56 | method @FlaggedApi("com.android.net.flags.tethering_with_soft_ap_config") @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public android.net.TetheringManager.TetheringRequest.Builder setInterfaceName(@Nullable String); |
| 57 | } |
| 58 | |
Anton Hansson | 65d1e30 | 2020-01-17 19:03:34 +0000 | [diff] [blame] | 59 | } |
| 60 | |