blob: 01bd98363be7da38f0778f4a71456260916fc582 [file] [log] [blame]
Anton Hansson65d1e302020-01-17 19:03:34 +00001// Signature format: 2.0
2package android.net {
3
Anton Hansson65d1e302020-01-17 19:03:34 +00004 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 Hansson65d1e302020-01-17 19:03:34 +000023 method public void requestLatestTetheringEntitlementResult(int, @NonNull android.os.ResultReceiver, boolean);
24 method @Deprecated public int setUsbTethering(boolean);
Anton Hansson65d1e302020-01-17 19:03:34 +000025 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 Hansson65d1e302020-01-17 19:03:34 +000026 method @Deprecated public int tether(@NonNull String);
Anton Hansson65d1e302020-01-17 19:03:34 +000027 method @Deprecated public int untether(@NonNull String);
Anton Hansson65d1e302020-01-17 19:03:34 +000028 }
29
markchien48e271b2021-10-28 22:56:49 +080030 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 Hansson4168cea2020-03-20 13:24:30 +000039 public static interface TetheringManager.TetheringEventCallback {
markchien35ad54b2021-05-17 20:43:41 +080040 method @Deprecated public default void onTetherableInterfaceRegexpsChanged(@NonNull android.net.TetheringManager.TetheringInterfaceRegexps);
Anton Hansson65d1e302020-01-17 19:03:34 +000041 }
42
markchien35ad54b2021-05-17 20:43:41 +080043 @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 Hansson65d1e302020-01-17 19:03:34 +000047 }
48
Oscar Shu46722ad2024-11-05 01:01:54 +000049 public static final class TetheringManager.TetheringRequest implements android.os.Parcelable {
Seungjae Yooeab1de42024-09-10 12:11:34 +090050 method @FlaggedApi("com.android.net.flags.tethering_with_soft_ap_config") @Nullable public String getInterfaceName();
Lorenzo Colitti172fe792024-11-13 17:16:50 +000051 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 Shu46722ad2024-11-05 01:01:54 +000053 }
54
Seungjae Yooeab1de42024-09-10 12:11:34 +090055 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 Hansson65d1e302020-01-17 19:03:34 +000059}
60