FileDocCategorySizeDatePackage
INetworkManagementService.javaAPI DocAndroid 5.1 API85781Sat Mar 14 05:48:04 GMT 2015android.os

INetworkManagementService

public interface INetworkManagementService implements android.os.IInterface
hide

Fields Summary
Constructors Summary
Methods Summary
public voidaddIdleTimer(java.lang.String iface, int timeout, int type)
Sets idletimer for an interface. This either initializes a new idletimer or increases its reference-counting if an idletimer already exists for given {@code iface}. {@code type} is the type of the interface, such as TYPE_MOBILE. Every {@code addIdleTimer} should be paired with a {@link removeIdleTimer} to cleanup when the network disconnects.

public voidaddInterfaceToLocalNetwork(java.lang.String iface, java.util.List routes)

public voidaddInterfaceToNetwork(java.lang.String iface, int netId)
Add an interface to a network.

public voidaddLegacyRouteForNetId(int netId, android.net.RouteInfo routeInfo, int uid)

public voidaddRoute(int netId, android.net.RouteInfo route)
Add the specified route to the interface.

public voidaddVpnUidRanges(int netId, android.net.UidRange[] ranges)
Set all packets from users in ranges to go through VPN specified by netId.

public voidallowProtect(int uid)
Allow UID to call protect().

public voidattachPppd(java.lang.String tty, java.lang.String localAddr, java.lang.String remoteAddr, java.lang.String dns1Addr, java.lang.String dns2Addr)
Attaches a PPP server daemon to the specified TTY with the specified local/remote addresses.

public voidclearDefaultNetId()

public voidclearInterfaceAddresses(java.lang.String iface)
Clear all IP addresses on the specified interface

public voidclearPermission(int[] uids)

public voidcreatePhysicalNetwork(int netId)
Setup a new physical network.

public voidcreateVirtualNetwork(int netId, boolean hasDNS, boolean secure)
Setup a new VPN.

public voiddenyProtect(int uid)
Deny UID from calling protect().

public voiddetachPppd(java.lang.String tty)
Detaches a PPP server daemon from the specified TTY.

public voiddisableIpv6(java.lang.String iface)
Disable IPv6 on an interface

public voiddisableNat(java.lang.String internalInterface, java.lang.String externalInterface)
Disables Network Address Translation between two interfaces.

public voidenableIpv6(java.lang.String iface)
Enable IPv6 on an interface

public voidenableNat(java.lang.String internalInterface, java.lang.String externalInterface)
Enables Network Address Translation between two interfaces. The address and netmask of the external interface is used for the NAT'ed network.

public voidflushNetworkDnsCache(int netId)
Flush the DNS cache associated with the specified network.

public java.lang.String[]getDnsForwarders()
Returns the list of DNS forwarders (in order of priority)

public android.net.InterfaceConfigurationgetInterfaceConfig(java.lang.String iface)
Retrieves the specified interface config

public booleangetIpForwardingEnabled()
Returns true if IP forwarding is enabled

public android.net.NetworkStatsgetNetworkStatsDetail()
Return detailed network statistics with UID-level granularity, including interface and tag details.

public android.net.NetworkStatsgetNetworkStatsSummaryDev()
Return global network statistics summarized at an interface level, without any UID-level granularity.

public android.net.NetworkStatsgetNetworkStatsSummaryXt()

public android.net.NetworkStatsgetNetworkStatsTethering()
Return summary of network statistics all tethering interfaces.

public android.net.NetworkStatsgetNetworkStatsUidDetail(int uid)
Return detailed network statistics for the requested UID, including interface and tag details.

public android.net.RouteInfo[]getRoutes(java.lang.String iface)
Retrieves the network routes currently configured on the specified interface

public booleanisBandwidthControlEnabled()
Return status of bandwidth control module.

public booleanisClatdStarted(java.lang.String interfaceName)
Determine whether the clatd (464xlat) service has been started on the given interface.

public booleanisFirewallEnabled()

public booleanisNetworkActive()
Check whether the mobile radio is currently active.

public booleanisTetheringStarted()
Returns true if tethering services are started

public java.lang.String[]listInterfaces()
Returns a list of currently known network interfaces

public java.lang.String[]listTetheredInterfaces()
Returns a list of currently tethered interfaces

public java.lang.String[]listTtys()
Returns the list of currently known TTY devices on the system

public voidregisterNetworkActivityListener(android.os.INetworkActivityListener listener)
Start listening for mobile activity state changes.

public voidregisterObserver(android.net.INetworkManagementEventObserver obs)
Register an observer to receive events

public voidremoveIdleTimer(java.lang.String iface)
Removes idletimer for an interface.

public voidremoveInterfaceAlert(java.lang.String iface)
Remove alert for an interface.

public voidremoveInterfaceFromLocalNetwork(java.lang.String iface)

public voidremoveInterfaceFromNetwork(java.lang.String iface, int netId)
Remove an Interface from a network.

public voidremoveInterfaceQuota(java.lang.String iface)
Remove quota for an interface.

public voidremoveNetwork(int netId)
Remove a network.

public voidremoveRoute(int netId, android.net.RouteInfo route)
Remove the specified route from the interface.

public voidremoveVpnUidRanges(int netId, android.net.UidRange[] ranges)
Clears the special VPN rules for users in ranges and VPN specified by netId.

public voidsetAccessPoint(android.net.wifi.WifiConfiguration wifiConfig, java.lang.String iface)
Set Access Point config

public voidsetDefaultNetId(int netId)

public voidsetDnsForwarders(android.net.Network network, java.lang.String[] dns)
Sets the list of DNS forwarders (in order of priority)

public voidsetDnsServersForNetwork(int netId, java.lang.String[] servers, java.lang.String domains)
Bind name servers to a network in the DNS resolver.

public voidsetFirewallEgressDestRule(java.lang.String addr, int port, boolean allow)

public voidsetFirewallEgressSourceRule(java.lang.String addr, boolean allow)

public voidsetFirewallEnabled(boolean enabled)

public voidsetFirewallInterfaceRule(java.lang.String iface, boolean allow)

public voidsetFirewallUidRule(int uid, boolean allow)

public voidsetGlobalAlert(long alertBytes)
Set alert across all interfaces.

public voidsetInterfaceAlert(java.lang.String iface, long alertBytes)
Set alert for an interface; requires that iface already has quota.

public voidsetInterfaceConfig(java.lang.String iface, android.net.InterfaceConfiguration cfg)
Sets the configuration of the specified interface

public voidsetInterfaceDown(java.lang.String iface)
Set interface down

public voidsetInterfaceIpv6NdOffload(java.lang.String iface, boolean enable)
Enables or enables IPv6 ND offload.

public voidsetInterfaceIpv6PrivacyExtensions(java.lang.String iface, boolean enable)
Set interface IPv6 privacy extensions

public voidsetInterfaceQuota(java.lang.String iface, long quotaBytes)
Set quota for an interface.

public voidsetInterfaceUp(java.lang.String iface)
Set interface up

public voidsetIpForwardingEnabled(boolean enabled)
Enables/Disables IP Forwarding

public voidsetMtu(java.lang.String iface, int mtu)
Set the specified MTU size

public voidsetPermission(java.lang.String permission, int[] uids)

public voidsetUidNetworkRules(int uid, boolean rejectOnQuotaInterfaces)
Control network activity of a UID over interfaces with a quota limit.

public voidshutdown()
Shuts down the service

public voidstartAccessPoint(android.net.wifi.WifiConfiguration wifiConfig, java.lang.String iface)
Start Wifi Access Point

public voidstartClatd(java.lang.String interfaceName)
Start the clatd (464xlat) service on the given interface.

public voidstartTethering(java.lang.String[] dhcpRanges)
Start tethering services with the specified dhcp server range arg is a set of start end pairs defining the ranges.

public voidstopAccessPoint(java.lang.String iface)
Stop Wifi Access Point

public voidstopClatd(java.lang.String interfaceName)
Stop the clatd (464xlat) service on the given interface.

public voidstopTethering()
Stop currently running tethering services

public voidtetherInterface(java.lang.String iface)
Tethers the specified interface

public voidunregisterNetworkActivityListener(android.os.INetworkActivityListener listener)
Stop listening for mobile activity state changes.

public voidunregisterObserver(android.net.INetworkManagementEventObserver obs)
Unregister an observer from receiving events.

public voiduntetherInterface(java.lang.String iface)
Untethers the specified interface

public voidwifiFirmwareReload(java.lang.String wlanIface, java.lang.String mode)
Load firmware for operation in the given mode. Currently the three modes supported are "AP", "STA" and "P2P".