Since: API level 1
public class

RoamingPolicy

extends Object
java.lang.Object
   ↳ com.samsung.android.knox.restriction.RoamingPolicy

Class Overview

This class provides APIs to control the various settings related to device roaming.

Since
API level 1
MDM 1.0

Summary

Public Methods
boolean isRoamingDataEnabled()
API to check whether cellular data usage during roaming is enabled.
boolean isRoamingPushEnabled()
API to check whether processing of WAP PUSH messages during roaming is enabled.
boolean isRoamingSyncEnabled()
API to check whether automatic syncing during roaming is enabled.
boolean isRoamingVoiceCallsEnabled()
API to check whether voice calls during roaming are enabled.
void setRoamingData(boolean enable)
API to enable or disable cellular data usage during roaming.
void setRoamingPush(boolean enable)
API to enable or disable processing of WAP Push messages during roaming.
void setRoamingSync(boolean enable)
API to enable or disable automatic application sync during roaming.
void setRoamingVoiceCalls(boolean enable)
API to enable or disable voice calls during device roaming.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public boolean isRoamingDataEnabled ()

Since: API level 1

API to check whether cellular data usage during roaming is enabled.

Returns
  • true if data roaming is enabled, false if data roaming is disabled
Since
API level 1
MDM 1.0
Multiuser Environment
Global Scope

public boolean isRoamingPushEnabled ()

Since: API level 1

API to check whether processing of WAP PUSH messages during roaming is enabled.

Returns
  • true if WAP Push message processing is enabled, false if WAP Push message processing is disabled
Since
API level 1
MDM 1.0
Multiuser Environment
Global Scope

public boolean isRoamingSyncEnabled ()

Since: API level 1

API to check whether automatic syncing during roaming is enabled.

Returns
  • true if syncing is enabled, false if syncing is disabled
Since
API level 1
MDM 1.0
Multiuser Environment
Global Scope

public boolean isRoamingVoiceCallsEnabled ()

Since: API level 5

API to check whether voice calls during roaming are enabled.

An administrator can use this API to check whether voice calls during roaming are enabled. The default value is true (enabled).

Returns
  • true if voice calls during roaming are enabled, else false
Since
API level 5
MDM 3.0
Multiuser Environment
Global Scope

public void setRoamingData (boolean enable)

Since: API level 1

API to enable or disable cellular data usage during roaming.

Parameters
enable true to enable, false to disable
Throws
SecurityException If caller does not have required permissions
Usage
An administrator can use this API to enable or disable cellular data usage during roaming. Disabling prevents applications from connecting to the Internet while the device is in roaming mode. This setting is applied only when the device is in roaming mode. If set to false (disable), the user cannot change this setting because the corresponding UI is disabled. If set to true, the corresponding UI setting is enabled, and the user can change settings.


  EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);

  RoamingPolicy roamingPolicy = edm.getRoamingPolicy();

 //disable case

 try {

      boolean result = roamingPolicy.setRoamingData(false);

      if(true == result)

      {

          //roaming data is disabled. User cannot change it.

      }

  }catch(SecurityException e) {

      Log.w(TAG,"SecurityException: "+e);

  }

 //enable case

 try {

      boolean result = roamingPolicy.setRoamingData(true);

      if(true == result)

      {

          // UI blocking is removed and user can change settings.

      }

  }catch(SecurityException e) {

      Log.w(TAG,"SecurityException: "+e);

  }
Permission
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_ROAMING" permission which has a protection level of signature.
Since
API level 1
MDM 1.0
Multiuser Environment
Global Scope

public void setRoamingPush (boolean enable)

Since: API level 1

API to enable or disable processing of WAP Push messages during roaming.

Parameters
enable true to enable, false to disable
Throws
SecurityException If caller does not have required permissions
Usage
An administrator can use this API to enable or disable processing of WAP PUSH messages. Disabling prevents MMS messages from being received during device roaming. This setting is applied only when the device is in roaming mode. If set to false, the user cannot change this setting because the corresponding UI is disabled. If set to true, the corresponding UI setting is enabled, and the user can change settings.


  EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);

  RoamingPolicy roamingPolicy = edm.getRoamingPolicy();



 //disable case

 try {

      boolean result = roamingPolicy.setRoamingPush(false);

      if(true == result)

      {

          // WAP push is disabled during device roaming and user cannot receive WAP Push messages.

      }

  }catch(SecurityException e) {

      Log.w(TAG,"SecurityException: "+e);

  }

 //enable case

 try {

      boolean result = roamingPolicy.setRoamingPush(true);

      if(true == result)

      {

          // UI blocking is removed and user can change settings.

      }

  }catch(SecurityException e) {

      Log.w(TAG,"SecurityException: "+e);

  }
Permission
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_ROAMING" permission which has a protection level of signature.
Since
API level 1
MDM 1.0
Multiuser Environment
Global Scope

public void setRoamingSync (boolean enable)

Since: API level 1

API to enable or disable automatic application sync during roaming.

Parameters
enable true to enable, false to disable
Throws
SecurityException If caller does not have required permissions
Usage
An administrator can use this API to enable or disable the automatic sync of applications such as email (including Gmail), contacts, calendar, and other application that use an account. This setting is applied only when the device is in roaming mode. If set to false, the user cannot change this setting because the corresponding UI is disabled. If set to true, the corresponding UI setting is enabled, and the user can change settings.


  EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);

  RoamingPolicy roamingPolicy = edm.getRoamingPolicy();

 //disable 

 try {

      boolean result = roamingPolicy.setRoamingSync(false);

      if(true == result)

      {

          //roaming sync is disabled and user cannot change it

      }

  }catch(SecurityException e) {

      Log.w(TAG,"SecurityException: "+e);

  }

 // enable 

 try {

      boolean result = roamingPolicy.setRoamingSync(true);

      if(true == result)

      {

          // UI blocking is removed and user can change settings.

      }

  }catch(SecurityException e) {

      Log.w(TAG,"SecurityException: "+e);

  }
Permission
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_ROAMING" permission which has a protection level of signature.
Since
API level 1
MDM 1.0
Multiuser Environment
Global Scope

public void setRoamingVoiceCalls (boolean enable)

Since: API level 5

API to enable or disable voice calls during device roaming.

Parameters
enable true to enable voice calls during device roaming, false to disable voice calls during device roaming
Throws
SecurityException If caller does not have required permissions
Usage
An administrator can use this API to enable or disable voice calls during device roaming.


 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);

 RoamingPolicy roamingPolicy = edm.getRoamingPolicy();

 try {

      boolean result = roamingPolicy.setRoamingVoiceCalls(true);

      if(true == result)

      {

          // User is allowed to make voice calls during device roaming.

      }

  }catch(SecurityException e) {

      Log.w(TAG,"SecurityException: "+e);

  }
Permission
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_ROAMING" permission which has a protection level of signature.
Since
API level 5
MDM 3.0
Multiuser Environment
Global Scope