Added in API level 1
public interface

ITelephonyConfigManager

com.ardic.android.managers.telephonyconfig.ITelephonyConfigManager

Class Overview

Provides set of API for Cellular networking related configuration adjustment.

Summary

Public Methods
abstract List<MobileApnConfig> getAllSavedMobileApnConfigsForCountry(String mcc)
Returns the list of the Mobile APN configurations for given country from carriers table of Telephony Provider in Android.
abstract MobileApnConfig getMobileApnConfig(long netId)
Returns the configuration of the Mobile APN from carriers table of Telephony Provider in Android.
abstract MobileApnConfig getPreferredApn()
Returns Preferred Cellular Mobile Network configuration.
abstract boolean isDataRoamingBlocked()
Returns whether Data Roaming is blocked or not.
abstract boolean isDataRoamingEnabled()
Returns whether Data Roaming is enabled or not.
abstract boolean isDownloadOverMobileBlocked()
Returns whether Download Over Mobile is blocked.
abstract boolean isMobileDataBlocked()
Return whether Mobile Data is blocked or unblocked.
abstract boolean isMobileDataEnabled()
Gets the value of the setting for enabling Mobile Data.
abstract boolean isMobileDataStateChangeBlocked()
Returns whether Mobile Data connection state change is blocked or not.
abstract boolean isPreferredApnChangeBlocked()
Return whether Preferred Cellular Mobile Network configuration change is blocked or not.
abstract boolean isSmsReceivingBlocked()
Returns whether receiving sms is blocked or not on system wide level.
abstract boolean isSmsSendingBlocked()
Returns whether sending sms is blocked or not on system wide level.
abstract boolean removeMobileApnConfig(long netId)
Deletes Cellular Mobile Network configuration.
abstract long saveMobileApnConfig(MobileApnConfig conf)
Saves Cellular Mobile Network configuration.
abstract boolean setDataRoamingBlocked(boolean state)
Sets/Resets Data Roaming Blocked.
abstract boolean setDataRoamingEnabled(boolean state)
Sets/Resets Data Roaming Enabled.
abstract boolean setDownloadOverMobileBlocked(boolean state)
Sets/Resets Download Over Mobile connection blocking.
abstract boolean setMobileDataBlocked(boolean state)
Sets Mobile Data availability to blocked.
abstract void setMobileDataEnabled(boolean state)
Sets the persisted value for enabling/disabling Mobile data.
abstract boolean setMobileDataStateChangeBlocked(boolean state)
Disables the ability to change Mobile Data state.
abstract boolean setPreferredApn(long netId)
Sets Preferred Cellular Mobile Network configuration.
abstract boolean setPreferredApnChangeBlocked(boolean state)
Sets Preferred Cellular Mobile Network configuration change to blocked.
abstract boolean setSmsReceivingBlocked(boolean state)
Blocks the ability to receiving kind of any sms on system wide level.
abstract boolean setSmsSendingBlocked(boolean state)
Blocks the ability to sending kind of any sms on system wide level.
abstract boolean updateMobileApnConfig(MobileApnConfig conf)
Updates Cellular Mobile Network configuration.

Public Methods

public abstract List<MobileApnConfig> getAllSavedMobileApnConfigsForCountry (String mcc)

Added in API level 1

Returns the list of the Mobile APN configurations for given country from carriers table of Telephony Provider in Android.

Parameters
mcc String: Mobile Country Code @see Mobile Country Code List
Returns
List<MobileApnConfig> List of MobileApnConfig
Throws
AfexException

See also:

public abstract MobileApnConfig getMobileApnConfig (long netId)

Added in API level 1

Returns the configuration of the Mobile APN from carriers table of Telephony Provider in Android.

Parameters
netId long: Network Id
Returns
MobileApnConfig MobileApnConfig
Throws
AfexException

See also:

public abstract MobileApnConfig getPreferredApn ()

Added in API level 1

Returns Preferred Cellular Mobile Network configuration. This is the Cellular Mobile Network configuration for Internet access for all applications on the device.

Returns
MobileApnConfig MobileApnConfig Preferred Cellular APN configuration.
Throws
AfexException

public abstract boolean isDataRoamingBlocked ()

Added in API level 2

Returns whether Data Roaming is blocked or not.

Returns
boolean true if data roaming blocked else false.
Throws
AfexException

public abstract boolean isDataRoamingEnabled ()

Added in API level 1

Returns whether Data Roaming is enabled or not. Checks Android Global Setting DATA_ROAMING.

Returns
boolean true if data roaming enabled else false.
Throws
AfexException

public abstract boolean isDownloadOverMobileBlocked ()

Added in API level 1

Returns whether Download Over Mobile is blocked.

Returns
boolean true if Download Over Mobile connection is blocked else false.
Throws
AfexException

public abstract boolean isMobileDataBlocked ()

Added in API level 1

Return whether Mobile Data is blocked or unblocked.

Returns
boolean true if Mobile Data is blocked, false otherwise
Throws
AfexException

public abstract boolean isMobileDataEnabled ()

Added in API level 1

Gets the value of the setting for enabling Mobile Data.

Returns
boolean true to enable Mobile Data else false.
Throws
AfexException

public abstract boolean isMobileDataStateChangeBlocked ()

Added in API level 1

Returns whether Mobile Data connection state change is blocked or not. If state change is blocked Mobile Data remains its current state(No state changes occur).

Returns
boolean true if Mobile Data state change is blocked, false otherwise.
Throws
AfexException

public abstract boolean isPreferredApnChangeBlocked ()

Added in API level 1

Return whether Preferred Cellular Mobile Network configuration change is blocked or not.

Returns
boolean true if Mobile Data is blocked, false otherwise
Throws
AfexException

public abstract boolean isSmsReceivingBlocked ()

Added in API level 1

Returns whether receiving sms is blocked or not on system wide level.

Returns
boolean true if receiving sms is blocked, false otherwise.
Throws
AfexException

public abstract boolean isSmsSendingBlocked ()

Added in API level 1

Returns whether sending sms is blocked or not on system wide level.

Returns
boolean true if sending sms is blocked, false otherwise.
Throws
AfexException

public abstract boolean removeMobileApnConfig (long netId)

Added in API level 1

Deletes Cellular Mobile Network configuration. Removes the entry of the Mobile APN from carriers table of Telephony Provider in Android.

Parameters
netId long: Network Id
Returns
boolean true if the operation succeeds else false.
Throws
AfexException

See also:

public abstract long saveMobileApnConfig (MobileApnConfig conf)

Added in API level 1

Saves Cellular Mobile Network configuration.

Parameters
conf MobileApnConfig: MobileApnConfig
Returns
long long network Id.
Throws
AfexException

See also:

public abstract boolean setDataRoamingBlocked (boolean state)

Added in API level 2

Sets/Resets Data Roaming Blocked.

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

public abstract boolean setDataRoamingEnabled (boolean state)

Added in API level 1

Sets/Resets Data Roaming Enabled. Changes Android Global Setting DATA_ROAMING.

Parameters
state boolean: true to enable, false to disable
Returns
boolean true if the operation succeeds else false.
Throws
AfexException

public abstract boolean setDownloadOverMobileBlocked (boolean state)

Added in API level 1

Sets/Resets Download Over Mobile connection blocking.

Parameters
state boolean: true to enable, false to disable
Returns
boolean true if the operation succeeds else false.
Throws
AfexException

public abstract boolean setMobileDataBlocked (boolean state)

Added in API level 1

Sets Mobile Data availability to blocked.

In Blocking case; Mobile Data is turned OFF and it is blocked.

The Mobile Data can not be turned ON until it is unblocked.

In Unblocking case; Mobile Data is unblocked and it is turned ON

Parameters
state boolean: true to block Mobile Data, 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 void setMobileDataEnabled (boolean state)

Added in API level 1

Sets the persisted value for enabling/disabling Mobile data.

Parameters
state boolean: true to enable false to disable.
Throws
AfexException

public abstract boolean setMobileDataStateChangeBlocked (boolean state)

Added in API level 1

Disables the ability to change Mobile Data state.

In Blocking case; If Mobile Data state is ON it remains ON and can not be turned OFF by App UID. If Mobile Data state is OFF it remains OFF and can not be turned ON by App UID.

The Mobile Data state can not be changed until it is unblocked.

In Unblocking case; Mobile Data can be disabled(Turned OFF) or enabled(Turn ON) by App UID.

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

public abstract boolean setPreferredApn (long netId)

Added in API level 1

Sets Preferred Cellular Mobile Network configuration. All the applications on the device will use the specific APN.

Parameters
netId long: Network Id
Returns
boolean true if the operation succeeds else false.
Throws
AfexException

public abstract boolean setPreferredApnChangeBlocked (boolean state)

Added in API level 1

Sets Preferred Cellular Mobile Network configuration change to blocked. When APN change is blocked, currently preferred APN is stored as preferred APN and can not be changed by the user. If there is no preferred APN on the device API returns failure.

In Blocking case; Preferred Cellular Mobile Network configuration can not be changed.

In Unblocking case; Preferred Cellular Mobile Network configuration can be changed.

Parameters
state boolean: true to block Cellular Mobile Network configuration change, 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 setSmsReceivingBlocked (boolean state)

Added in API level 1

Blocks the ability to receiving kind of any sms on system wide level.

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

public abstract boolean setSmsSendingBlocked (boolean state)

Added in API level 1

Blocks the ability to sending kind of any sms on system wide level.

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

public abstract boolean updateMobileApnConfig (MobileApnConfig conf)

Added in API level 1

Updates Cellular Mobile Network configuration.

Parameters
conf MobileApnConfig: MobileApnConfig
Returns
boolean true if the operation succeeds else false.
Throws
AfexException

See also: