public class Tethering extends BaseNetworkObserver implements IControlsTethering
STATE_AVAILABLE, STATE_TETHERED, STATE_UNAVAILABLE
Constructor and Description |
---|
Tethering(Context context,
INetworkManagementService nmService,
INetworkStatsService statsService,
INetworkPolicyManager policyManager) |
Modifier and Type | Method and Description |
---|---|
void |
dump(FileDescriptor fd,
PrintWriter writer,
String[] args) |
String[] |
getErroredIfaces() |
int |
getLastTetherError(String iface) |
String[] |
getTetherableBluetoothRegexs() |
String[] |
getTetherableIfaces() |
String[] |
getTetherableUsbRegexs() |
String[] |
getTetherableWifiRegexs() |
String[] |
getTetheredDhcpRanges() |
String[] |
getTetheredIfaces() |
int[] |
getUpstreamIfaceTypes() |
void |
interfaceAdded(String iface) |
void |
interfaceLinkStateChanged(String iface,
boolean up) |
void |
interfaceRemoved(String iface) |
void |
interfaceStatusChanged(String iface,
boolean up) |
void |
notifyInterfaceStateChange(String iface,
TetherInterfaceStateMachine who,
int state,
int error)
Notify that |who| has changed its tethering state.
|
int |
setUsbTethering(boolean enable) |
void |
startTethering(int type,
ResultReceiver receiver,
boolean showProvisioningUi) |
void |
stopTethering(int type) |
int |
tether(String iface) |
int |
untether(String iface) |
void |
untetherAll() |
addressRemoved, addressUpdated, interfaceClassDataActivityChanged, interfaceDnsServerInfo, limitReached, routeRemoved, routeUpdated
public Tethering(Context context, INetworkManagementService nmService, INetworkStatsService statsService, INetworkPolicyManager policyManager)
public void interfaceStatusChanged(String iface, boolean up)
interfaceStatusChanged
in class BaseNetworkObserver
public void interfaceLinkStateChanged(String iface, boolean up)
interfaceLinkStateChanged
in class BaseNetworkObserver
public void interfaceAdded(String iface)
interfaceAdded
in class BaseNetworkObserver
public void interfaceRemoved(String iface)
interfaceRemoved
in class BaseNetworkObserver
public void startTethering(int type, ResultReceiver receiver, boolean showProvisioningUi)
public void stopTethering(int type)
public int tether(String iface)
public int untether(String iface)
public void untetherAll()
public int getLastTetherError(String iface)
public String[] getTetherableUsbRegexs()
public String[] getTetherableWifiRegexs()
public String[] getTetherableBluetoothRegexs()
public int setUsbTethering(boolean enable)
public int[] getUpstreamIfaceTypes()
public String[] getTetheredIfaces()
public String[] getTetherableIfaces()
public String[] getTetheredDhcpRanges()
public String[] getErroredIfaces()
public void dump(FileDescriptor fd, PrintWriter writer, String[] args)
public void notifyInterfaceStateChange(String iface, TetherInterfaceStateMachine who, int state, int error)
IControlsTethering
notifyInterfaceStateChange
in interface IControlsTethering
iface
- a network interface (e.g. "wlan0")who
- corresponding instance of a TetherInterfaceStateMachinestate
- one of IControlsTethering.STATE_*error
- one of ConnectivityManager.TETHER_ERROR_*