Added in API level 1
public interface

INetworkConfigManager

com.ardic.android.managers.networkconfig.INetworkConfigManager

Class Overview

Provides set of API for network related configuration adjustment.

Summary

Public Methods
abstract boolean addDnsToBlacklist(String dns)
Adds new dns to the blacklist.
abstract boolean clearDnsBlacklist()
Clears the dns blacklist.
abstract void connectToVpnProfile(String name)
Connects to VPN server according to the VPN Profile with the given VPN profile name.
abstract boolean disconnectVpn()
This method disconnects VPN connection of the device.
abstract List<VpnProfileConfig> getAllConfiguredVpnProfiles()
Returns list of all configured VPN Profiles on a device.
abstract List<String> getDnsBlacklist()
Returns all dns blacklist.
abstract ProxyProperties getGlobalProxy()
This method was deprecated in API level 5. in Android Lollipop
abstract ProxyInfo getGlobalProxyInfo()
Returns configured global proxy infos.
abstract WifiConfigBasic getHotspotConfig()
Returns Hotspot Configuration
abstract VpnProfileConfig getVpnProfile(String name)
Gets VPN Profile Configuration of the given VPN Profile name.
abstract boolean hasHotspotConfigChanged(WifiConfiguration wc)
Compares the given WifiConfiguration to hotspot configuration
abstract boolean isBluetoothTetheringBlocked()
Returns whether Bluetooth Tethering is blocked or not.
abstract boolean isDnsInBlacklist(String dns)
Queries if the specified dns is exist in dns blacklist or not.
abstract boolean isHotspotConfigChangeBlocked()
Returns whether Hotspot configuration changing is blocked or not.
abstract boolean isHotspotEnabled()
Returns whether Wi-Fi hotspot is ON or not.
abstract boolean isHotspotSupported()
Returns whether the device supports WiFi hotspot or not.
abstract boolean isTetheringBlocked()
Return whether Tethering is blocked or unblocked.
abstract boolean isUsbTetheringBlocked()
Returns whether USB Tethering is blocked or not.
abstract boolean isVpnBlocked()
Returns whether VPN connections are blocked or not.
abstract boolean isVpnConnected()
Checks whether VPN connection is established or not.
abstract boolean isWifiTetheringBlocked()
Returns whether Wi-Fi Tethering is blocked or not
abstract boolean removeDnsFromBlacklist(String dns)
Removes the dns from blacklist.
abstract boolean removeVpnProfile(String name)
Deletes a previously configured VPN Profile on the device.
abstract boolean saveVpnProfileConfig(VpnProfileConfig conf)
Saves a given VPN Profile configuration.
abstract boolean setBluetoothTetheringBlocked(boolean state)
Sets/Resets block for Bluetooth Tethering.
abstract void setGlobalProxy(ProxyProperties pp)
This method was deprecated in API level 5. in Android Lollipop
abstract void setGlobalProxyInfo(ProxyInfo pi)
Sets global proxy's host, port and pac configurations.
abstract boolean setHotspotConfig(WifiConfigBasic wc)
Sets Hotspot configuration
abstract boolean setHotspotConfigChangeBlocked(boolean state)
Sets/Resets hotspot configuration change blocking.
abstract boolean setHotspotEnabled(WifiConfiguration wc, boolean state)
Turns ON/OFF Wi-Fi hotspot with given Wifi Configuration of the device.
abstract boolean setTetheringBlocked(boolean state)
Sets Tethering availability to blocked.
abstract boolean setUsbTetheringBlocked(boolean state)
Sets/Resets block for USB Tethering.
abstract boolean setVpnBlocked(boolean state)
Sets/Resets VPN blocking.
abstract boolean setWifiTetheringBlocked(boolean state)
Sets/Resets Wi-Fi Tethering blocking.

Public Methods

public abstract boolean addDnsToBlacklist (String dns)

Added in API level 2

Adds new dns to the blacklist.

Parameters
dns String: Definition of the dns
Returns
boolean true if the operation succeeds else false.
Throws
AfexException

public abstract boolean clearDnsBlacklist ()

Added in API level 2

Clears the dns blacklist.

Returns
boolean true if the operation succeeds else false.
Throws
AfexException

public abstract void connectToVpnProfile (String name)

Added in API level 1

Connects to VPN server according to the VPN Profile with the given VPN profile name.

Parameters
name String: VPN Profile name
Throws
AfexException

public abstract boolean disconnectVpn ()

Added in API level 1

This method disconnects VPN connection of the device.

Returns
boolean true if the operation succeeds else false.
Throws
AfexException

public abstract List<VpnProfileConfig> getAllConfiguredVpnProfiles ()

Added in API level 1

Returns list of all configured VPN Profiles on a device.

Returns
List<VpnProfileConfig> list of VpnProfileConfig objects for VPN Profile configurations or Empty list if there is no configured VPN Profiles.
Throws
AfexException

public abstract List<String> getDnsBlacklist ()

Added in API level 2

Returns all dns blacklist.

Returns
List<String> Dns blacklist or empty list.
Throws
AfexException

public abstract ProxyProperties getGlobalProxy ()

Added in API level 2

This method was deprecated in API level 5.
in Android Lollipop

Returns configured global proxy infos.

Returns
ProxyProperties ProxyProperties Returns ProxyProperties object if set, else null
Throws
AfexException
AfexException

public abstract ProxyInfo getGlobalProxyInfo ()

Added in API level 5

Returns configured global proxy infos. In Android Lollipop; After API level 21, This API throws ERROR(/AfexExceptionType.NA)

Returns
ProxyInfo ProxyInfo Returns ProxyInfo object if set, else null
Throws
AfexException

public abstract WifiConfigBasic getHotspotConfig ()

Added in API level 1

Returns Hotspot Configuration

Returns
WifiConfigBasic WifiConfigBasic for the hotspot
Throws
AfexException

public abstract VpnProfileConfig getVpnProfile (String name)

Added in API level 1

Gets VPN Profile Configuration of the given VPN Profile name.

Parameters
name String: VPN Profile name
Returns
VpnProfileConfig VPN Profile Configuration or null if there is no profile with the given name.
Throws
AfexException

public abstract boolean hasHotspotConfigChanged (WifiConfiguration wc)

Added in API level 1

Compares the given WifiConfiguration to hotspot configuration

Parameters
wc WifiConfiguration: WifiConfiguration to be compared
Returns
boolean true if the configuration is equal false otherwise
Throws
AfexException

public abstract boolean isBluetoothTetheringBlocked ()

Added in API level 1

Returns whether Bluetooth Tethering is blocked or not.

Returns
boolean true if Bluetooth Tethering is blocked else false.
Throws
AfexException

public abstract boolean isDnsInBlacklist (String dns)

Added in API level 2

Queries if the specified dns is exist in dns blacklist or not.

Parameters
dns String: Defition of the dns
Returns
boolean true if the specified dns exists else false.
Throws
AfexException

public abstract boolean isHotspotConfigChangeBlocked ()

Added in API level 1

Returns whether Hotspot configuration changing is blocked or not. If hotspot configuration change is blocked user can not change SSID, Security Type and password defined for the mobile device.

Returns
boolean true if Hotspot configuration change is blocked else false.
Throws
AfexException

public abstract boolean isHotspotEnabled ()

Added in API level 5

Returns whether Wi-Fi hotspot is ON or not.

Returns
boolean true if Wi-Fi hotspot is ON else false
Throws
AfexException

public abstract boolean isHotspotSupported ()

Added in API level 5

Returns whether the device supports WiFi hotspot or not.

Returns
boolean true if Wi-Fi hotspot is supported on the device else false
Throws
AfexException

public abstract boolean isTetheringBlocked ()

Added in API level 1

Return whether Tethering is blocked or unblocked.

Returns
boolean true if Tethering is blocked, false otherwise
Throws
AfexException

public abstract boolean isUsbTetheringBlocked ()

Added in API level 1

Returns whether USB Tethering is blocked or not.

Returns
boolean true if USB Tethering is blocked else false.
Throws
AfexException

public abstract boolean isVpnBlocked ()

Added in API level 1

Returns whether VPN connections are blocked or not.

Returns
boolean true if VPN access is blocked else false.
Throws
AfexException

public abstract boolean isVpnConnected ()

Added in API level 1

Checks whether VPN connection is established or not.

Returns
boolean true if VPN connection is established else false.
Throws
AfexException

public abstract boolean isWifiTetheringBlocked ()

Added in API level 1

Returns whether Wi-Fi Tethering is blocked or not

Returns
boolean true if Wi-Fi Tethering is blocked else false.
Throws
AfexException

public abstract boolean removeDnsFromBlacklist (String dns)

Added in API level 2

Removes the dns from blacklist.

Parameters
dns String: Definition of the dns
Returns
boolean true if the operation succeeds else false.
Throws
AfexException

public abstract boolean removeVpnProfile (String name)

Added in API level 1

Deletes a previously configured VPN Profile on the device.

Parameters
name String: VPN Profile name
Returns
boolean true if the operation succeeds else false.
Throws
AfexException

public abstract boolean saveVpnProfileConfig (VpnProfileConfig conf)

Added in API level 1

Saves a given VPN Profile configuration. Since VPN configurations are stored in Android Keystore, Keystore state have to be UNLOCKED.

Parameters
conf VpnProfileConfig: VpnProfileConfig VPN Profile configuration
Returns
boolean true if the operation succeeds else false.
Throws
AfexException

public abstract boolean setBluetoothTetheringBlocked (boolean state)

Added in API level 1

Sets/Resets block for Bluetooth Tethering. If Bluetooth Tethering blocked mobile device can not be used by paired device for Internet connection. If all tethering is blocked, unblocking Bluetooth Tethering fails.

Parameters
state boolean: true to block Bluetooth Tethering, false otherwise
Returns
boolean true if the operation succeeds else false.
Throws
AfexException

public abstract void setGlobalProxy (ProxyProperties pp)

Added in API level 2

This method was deprecated in API level 5.
in Android Lollipop

Sets global proxy's host, port and pac configurations.

Parameters
pp ProxyProperties: ProxyProperties Pass ProxyProperties object to set, null to reset
Throws
AfexException

public abstract void setGlobalProxyInfo (ProxyInfo pi)

Added in API level 5

Sets global proxy's host, port and pac configurations. In Android Lollipop; After API level 21, This API throws ERROR(/AfexExceptionType.NA)

Parameters
pi ProxyInfo
Throws
AfexException

public abstract boolean setHotspotConfig (WifiConfigBasic wc)

Added in API level 1

Sets Hotspot configuration

Parameters
wc WifiConfigBasic: Hotspot Configuration
Returns
boolean true if the operation succeeds else false.
Throws
AfexException

public abstract boolean setHotspotConfigChangeBlocked (boolean state)

Added in API level 1

Sets/Resets hotspot configuration change blocking. If hotspot configuration change is blocked user can not change SSID, Security Type and password defined for the mobile device.

Parameters
state boolean: true to block false to unblock.
Returns
boolean true if the operation succeeds else false.
Throws
AfexException

public abstract boolean setHotspotEnabled (WifiConfiguration wc, boolean state)

Added in API level 5

Turns ON/OFF Wi-Fi hotspot with given Wifi Configuration of the device.

Parameters
wc WifiConfiguration
state boolean
Returns
boolean true if the operation succeeds else false
Throws
AfexException

public abstract boolean setTetheringBlocked (boolean state)

Added in API level 1

Sets Tethering availability to blocked.

In Blocking case; Tethering is turned OFF and it is blocked.

The Tethering can not be turned ON until it is unblocked.

In Unblocking case; Tethering is unblocked and it is turned ON

Parameters
state boolean: true to block Tethering, false to unblock.
Returns
boolean true if the operation succeeds (or if the existing state is the same as the requested state) else false
Throws
AfexException

public abstract boolean setUsbTetheringBlocked (boolean state)

Added in API level 1

Sets/Resets block for USB Tethering. If USB Tethering blocked mobile device can not be used by host device for Internet connection. If all tethering is blocked, unblocking USB Tethering fails.

Parameters
state boolean: true to block USB Tethering, false otherwise
Returns
boolean true if the operation succeeds else false.
Throws
AfexException

public abstract boolean setVpnBlocked (boolean state)

Added in API level 1

Sets/Resets VPN blocking. If VPN is blocked device can not connect to any VPN.

Parameters
state boolean: true to block VPN, false otherwise
Returns
boolean true if the operation succeeds else false.
Throws
AfexException

public abstract boolean setWifiTetheringBlocked (boolean state)

Added in API level 1

Sets/Resets Wi-Fi Tethering blocking. If Wi-Fi Tethering is blocked mobile device can not be used as Wi-Fi AP by other devices. If all tethering is blocked, unblocking Wi-Fi Tethering fails.

Parameters
state boolean: true to block Wifi Tethering, false otherwise
Returns
boolean true if the operation succeeds else false.
Throws
AfexException