| java.lang.Object | |
| ↳ | com.samsung.android.knox.restriction.PhoneRestrictionPolicy | 
This class provides APIs to control telephony functionality settings.
| API level 2 | 
| MDM 2.0 | 
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| String | ACTION_RCS_MSG_FILE_RECEIVED | Broadcast Action: Intent to notify a new RCS file is received. | |||||||||
| String | ACTION_RCS_MSG_FILE_SENT | Broadcast Action: Intent to notify a new RCS file is sent. | |||||||||
| String | ACTION_RCS_MSG_FILE_THUMBNAIL_RECEIVED | Broadcast Action: Intent to notify a new RCS thumbnail is received. | |||||||||
| String | ACTION_RCS_MSG_TEXT_RECEIVED | Broadcast Action: Intent to notify a new RCS message is received. | |||||||||
| String | ACTION_RCS_MSG_TEXT_SENT | Broadcast Action: Intent to notify a new RCS message is sent. | |||||||||
| String | BODY | This constant is a key to fetch RCS message's body from Bundle returned by getRCSMessage(long). | |||||||||
| String | CONTENT_TYPE | This constant is a key to fetch RCS message's content type from Bundle returned by getRCSMessage(long). | |||||||||
| int | ERROR_INVALID_INPUT | Flag to indicate that API failed because of invalid input | |||||||||
| int | ERROR_NONE | Flag to indicate that API applied policy successfully | |||||||||
| int | ERROR_NOT_SUPPORTED | Flag to indicate that API failed because of not supported. | |||||||||
| int | ERROR_SIM_NOT_INSERTED | Flag to indicate that the specified SIM card is not inserted on the current device | |||||||||
| int | ERROR_SIM_PIN_ALREADY_LOCKED | Flag to indicate that SIM PIN lock is already enabled but not by the administrator. | |||||||||
| int | ERROR_SIM_PIN_ALREADY_LOCKED_BY_ADMIN | Flag to indicate that SIM PIN lock is already enabled by the current administrator. | |||||||||
| int | ERROR_SIM_PIN_ALREADY_UNLOCKED | Flag to indicate that SIM PIN lock is already disabled. | |||||||||
| int | ERROR_SIM_PIN_BLOCKED_BY_PUK | Flag to indicate that SIM card is locked by a PIN unlock key (PUK). | |||||||||
| int | ERROR_SIM_PIN_DATABASE | Flag to indicate a database error occurred. | |||||||||
| int | ERROR_SIM_PIN_FAILED | Flag to indicate that a SIM PIN operation failed with a generic error. | |||||||||
| int | ERROR_SIM_PIN_ID_NOT_READY | Flag to indicate that the SIM card is not ready yet. | |||||||||
| int | ERROR_SIM_PIN_INCORRECT_CODE | Flag to indicate that a wrong SIM PIN value was supplied. | |||||||||
| int | ERROR_SIM_PIN_INVALID_CODE | Flag to indicate that an invalid SIM PIN value was supplied. | |||||||||
| int | ERROR_SIM_PIN_MAX_RETRIES_EXCEEDED | Flag to indicate that the maximum number of SIM PIN operations attempts with the wrong PIN code has been reached. | |||||||||
| int | ERROR_SIM_PIN_NONE | Flag to indicate that a subscriber identiy module (SIM) personal identification number (PIN) operation completed successfully. | |||||||||
| int | ERROR_SIM_PIN_OWNED_BY_OTHER_ADMIN | Flag to indicate that another administrator has already locked the SIM card on the current device. | |||||||||
| int | ERROR_SIM_PIN_UNKNOWN | Flag to indicate that an unknown error occurred. | |||||||||
| int | ERROR_UNKNOWN | Flag to indicate that API failed for an unknown reason | |||||||||
| String | EXTRA_MSG_ID | Used as an longextra field withACTION_RCS_MSG_TEXT_RECEIVED,ACTION_RCS_MSG_TEXT_SENT,ACTION_RCS_MSG_FILE_THUMBNAIL_RECEIVED,ACTION_RCS_MSG_FILE_RECEIVEDandACTION_RCS_MSG_FILE_SENT. | |||||||||
| String | FILE_PATH | This constant is a key to fetch file path of RCS message from Bundle returned by getRCSMessage(long). | |||||||||
| int | LIMIT_NUMBER_OF_CALLS_BY_DAY | Flag to be used to retrieve the number of incoming or outgoing calls allowed by day. | |||||||||
| int | LIMIT_NUMBER_OF_CALLS_BY_MONTH | Flag to be used to retrieve the number of incoming or outgoing calls allowed by month. | |||||||||
| int | LIMIT_NUMBER_OF_CALLS_BY_WEEK | Flag to be used to retrieve the number of incoming or outgoing calls allowed by week. | |||||||||
| int | LIMIT_NUMBER_OF_DATA_CALLS_BY_DAY | Flag to be used to retrieve the amount of data packets sent or received allowed by day. | |||||||||
| int | LIMIT_NUMBER_OF_DATA_CALLS_BY_MONTH | Flag to be used to retrieve the amount of data packets sent or received allowed by month. | |||||||||
| int | LIMIT_NUMBER_OF_DATA_CALLS_BY_WEEK | Flag to be used to retrieve the amount of data packets sent or received allowed by week. | |||||||||
| int | LIMIT_NUMBER_OF_SMS_BY_DAY | Flag to be used to retrieve the number of sent or received Short Message Service (SMS) text messages allowed by day. | |||||||||
| int | LIMIT_NUMBER_OF_SMS_BY_MONTH | Flag to be used to retrieve the number of sent or received Short Message Service (SMS) text messages allowed by month. | |||||||||
| int | LIMIT_NUMBER_OF_SMS_BY_WEEK | Flag to be used to retrieve the number of sent or received Short Message Service (SMS) text messages allowed by week. | |||||||||
| int | RCS_FEATURE_ALL | Flag to indicate that all RCS feature which contains call and message. | |||||||||
| String | REMOTE_URI | Used as an Stringextra field with the return value ofgetRCSMessage(long). | |||||||||
| String | SENDER_ALIAS | This constant is a key to fetch sender's alias of RCS message from Bundle returned by getRCSMessage(long). | |||||||||
| String | THUMBNAIL_PATH | This constant is a key to fetch thumbnail path of RCS message from Bundle returned by getRCSMessage(long). | |||||||||
| String | TIMESTAMP | This constant is a key to fetch RCS message's received or sent timestamp from Bundle returned by getRCSMessage(long). | |||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| API to add an exception pattern to the administrator's exception pattern
 set for incoming calls. | |||||||||||
| API to add a restriction pattern to the administrator's restriction
 pattern set for incoming calls. | |||||||||||
| API to add an exception pattern to the administrator's exception pattern
 set for incoming SMSs. | |||||||||||
| API to add a restriction pattern to the administrator restriction pattern
 set for incoming Short Message Service (SMS) text messages. | |||||||||||
| API to add an exception pattern to the administrator's exception pattern
 set for outgoing calls. | |||||||||||
| API to add a restriction pattern to the administrator's restriction
 pattern set for
 outgoing calls. | |||||||||||
| API to add an exception pattern to the administrator's exception pattern set for outgoing
 SMSs. | |||||||||||
| API to add a restriction pattern to the administrator restriction pattern
 set for outgoing Short Message Service (SMS) text messages. | |||||||||||
| API to allow or disallow caller Id display during an incoming call. | |||||||||||
| API to enable / disable Copy contact from device to SIM Card. | |||||||||||
| 
      
  Deprecated
      in API level 35
 
 | |||||||||||
| 
      
  Deprecated
      in API level 35
 
 | |||||||||||
| 
      
  Deprecated
      in API level 35
 
 | |||||||||||
| 
      
  Deprecated
      in API level 35
 
 | |||||||||||
| 
      
  Deprecated
      in API level 33 
 | |||||||||||
| API to allow or disallow storage of blocked incoming Multimedia Message Service (MMS) messages. | |||||||||||
| API to allow or disallow storage of blocked incoming Short Message Service (SMS) text messages. | |||||||||||
| API to check if a given dial number for incoming call matches the
 incoming call restriction pattern. | |||||||||||
| API to check whether an incoming Short Message Service (SMS) text message from a given number is allowed. | |||||||||||
| API to check if a given dial number for an outgoing call matches the
 outgoing call restriction pattern. | |||||||||||
| API to check whether an outgoing Short Message Service (SMS) text message to a given number is allowed. | |||||||||||
| API to change SIM card's PIN code. | |||||||||||
| API that clears all stored, blocked Multimedia Message Service (MMS) messages. | |||||||||||
| API that clears all stored, blocked Short Message Service (SMS) text messages. | |||||||||||
| API to disable SIM card's PIN lock. | |||||||||||
| API to enable or disable limiting the number of calls. | |||||||||||
| API to enable or disable limiting the number of Short Message Service (SMS) text messages. | |||||||||||
| API to enable SIM card's PIN lock. | |||||||||||
| API to check whether a limit on carrier data network usage is enabled. | |||||||||||
| 
      
  Deprecated
      in API level 35
 
 | |||||||||||
| API to check whether emergency calls only are allowed on the device. | |||||||||||
| API to get the exception pattern for incoming calls. | |||||||||||
| API to get the restriction pattern for incoming calls. | |||||||||||
| API to get the exception pattern for incoming SMSs. | |||||||||||
| API to get the restriction pattern for incoming Short Message Service
 (SMS) text messages. | |||||||||||
| API to get the limits on data packet usage per day, week, or month. | |||||||||||
| API to get the limit of incoming calls for a day, week, or month. | |||||||||||
| API to get the limit on incoming Short Message Service (SMS) text
 messages for a day, week, or month. | |||||||||||
| API to get the limit on the number of outgoing calls for a day, week, and
 month. | |||||||||||
| API to get the limit on outgoing Short Message Service (SMS) text
 messages for a day, week, or month. | |||||||||||
| API to get the exception pattern for outgoing calls. | |||||||||||
| API to get the restriction pattern for outgoing calls. | |||||||||||
| API to get the exception pattern for outgoing SMSs. | |||||||||||
| API to get the restriction pattern for outgoing Short Message Service
 (SMS) text messages. | |||||||||||
| 
      
  Deprecated
      in API level 35
 | |||||||||||
| API to check whether storage of blocked incoming Multimedia Message
 Service (MMS) messages is enabled. | |||||||||||
| API to check whether storage of blocked incoming Short Message Service (SMS) text messages is enabled. | |||||||||||
| API to get the display status of caller Id during an incoming call. | |||||||||||
| API to check whether the copy. | |||||||||||
| API to determine whether incoming Multimedia Messaging Service (MMS) messages are allowed. | |||||||||||
| API to determine whether incoming Short Message Service (SMS) text messages are allowed. | |||||||||||
| API to check whether the number of calls is limited. | |||||||||||
| API to check whether the number of Short Message Service (SMS) text messages is limited. | |||||||||||
| API to determine whether outgoing Multimedia Messaging Service (MMS) messages are allowed. | |||||||||||
| API to determine whether outgoing Short Message Service (SMS) text messages are allowed. | |||||||||||
| API to check whether Rich Communication Services (RCS) feature is enabled or not. | |||||||||||
| 
      
  Deprecated
      in API level 33
 | |||||||||||
| API to remove the exception pattern (concatenated or not) for incoming
 calls set by the device administrators. | |||||||||||
| API to remove the restriction pattern for incoming calls set by the
 calling administrator. | |||||||||||
| API to remove the exception pattern (concatenated or not) for incoming
 SMSs set by the device administrators. | |||||||||||
| API to remove the restriction pattern for incoming Short Message Service (SMS) text messages set
 by the calling administrator. | |||||||||||
| API to remove the exception pattern (concatenated or not) for outgoing
 calls set by the device administrators. | |||||||||||
| API to remove the restriction pattern for outgoing calls set by the
 calling administrator. | |||||||||||
| API to remove the exception pattern (concatenated or not) for incoming
 SMSs set by the device administrators. | |||||||||||
| API to remove the restriction pattern for outgoing Short Message Service (SMS) text messages set
 by the calling administrator. | |||||||||||
| API to reset the counters for incoming and outgoing calls. | |||||||||||
| API to reset the counters for data usage limits sent and received on
 device. | |||||||||||
| API to reset the counters for incoming or outgoing Short Message Service (SMS) text messages. | |||||||||||
| API to enable a limit on data carrier network usage on the device. | |||||||||||
| 
      
  Deprecated
      in API level 35
 
 | |||||||||||
| API to enable or disable emergency calls only on device. | |||||||||||
| API to set an exception pattern to be matched by incoming call numbers. | |||||||||||
| API to set a restriction pattern to be matched by incoming call numbers. | |||||||||||
| API to set an exception pattern to be matched by incoming SMS numbers. | |||||||||||
| API to set incoming Short Message Service (SMS) text message restriction
 pattern for the calling administrator. | |||||||||||
| API to set the limit on data packet usage per day, week, and month. | |||||||||||
| API to set the limit for the number of incoming calls per day, week, and month. | |||||||||||
| API to set a limit on the number of incoming Short Message Service (SMS)
 text messages per day, week, and month. | |||||||||||
| API to set the limit for the number of outgoing calls per day, week, and month. | |||||||||||
| API to set a limit of number of outgoing Short Message Service (SMS)
 text messages per day, week, and month. | |||||||||||
| API to set an exception pattern to be matched by outgoing call numbers. | |||||||||||
| API to set a restriction pattern to be matched by outgoing call numbers. | |||||||||||
| API to set an exception pattern to be matched by outgoing SMS numbers. | |||||||||||
| API to set the outgoing Short Message Service (SMS) text message
 restriction pattern for the calling administrator. | |||||||||||
| API to enable or disable Rich Communication Services (RCS) features on device native message apps(e.g. | |||||||||||
| [Expand] Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|  From class
  java.lang.Object | |||||||||||
Broadcast Action: Intent to notify a new RCS file is received. The intent will have the following extra value:
 EXTRA_MSG_ID 
| Receiver must hold "com.samsung.android.knox.permission.KNOX_ADVANCED_RESTRICTION" permission which has a protection level of signature. | 
| API level 26 | 
| KNOX 3.2 | 
Broadcast Action: Intent to notify a new RCS file is sent. The intent will have the following extra value:
 EXTRA_MSG_ID 
| Receiver must hold "com.samsung.android.knox.permission.KNOX_ADVANCED_RESTRICTION" permission which has a protection level of signature. | 
| API level 26 | 
| KNOX 3.2 | 
Broadcast Action: Intent to notify a new RCS thumbnail is received. The intent will have the following extra value:
 EXTRA_MSG_ID 
| Receiver must hold "com.samsung.android.knox.permission.KNOX_ADVANCED_RESTRICTION" permission which has a protection level of signature. | 
| API level 26 | 
| KNOX 3.2 | 
Broadcast Action: Intent to notify a new RCS message is received. The intent will have the following extra value:
 EXTRA_MSG_ID 
| Receiver must hold "com.samsung.android.knox.permission.KNOX_ADVANCED_RESTRICTION" permission which has a protection level of signature. | 
| API level 26 | 
| KNOX 3.2 | 
Broadcast Action: Intent to notify a new RCS message is sent. The intent will have the following extra value:
 EXTRA_MSG_ID 
| Receiver must hold "com.samsung.android.knox.permission.KNOX_ADVANCED_RESTRICTION" permission which has a protection level of signature. | 
| API level 26 | 
| KNOX 3.2 | 
This constant is a key to fetch RCS message's body from Bundle returned by getRCSMessage(long).
| API level 26 | 
| KNOX 3.2 | 
This constant is a key to fetch RCS message's content type from Bundle returned by getRCSMessage(long).
| API level 26 | 
| KNOX 3.2 | 
Flag to indicate that API failed because of invalid input
| API level 24 | 
Flag to indicate that API applied policy successfully
| API level 24 | 
Flag to indicate that API failed because of not supported.
| API level 24 | 
Flag to indicate that the specified SIM card is not inserted on the current device
| API level 22 | 
| MDM 5.8 | 
Flag to indicate that SIM PIN lock is already enabled but not by the administrator.
| API level 6 | 
| MDM 4.0 | 
Flag to indicate that SIM PIN lock is already enabled by the current administrator.
| API level 6 | 
| MDM 4.0 | 
Flag to indicate that SIM PIN lock is already disabled.
| API level 6 | 
| MDM 4.0 | 
Flag to indicate that SIM card is locked by a PIN unlock key (PUK). In this situation no SIM PIN operation can be executed. The SIM card must be unlocked with the PUK to allow SIM PIN operations.
| API level 6 | 
| MDM 4.0 | 
Flag to indicate a database error occurred.
| API level 6 | 
| MDM 4.0 | 
Flag to indicate that a SIM PIN operation failed with a generic error.
| API level 6 | 
| MDM 4.0 | 
Flag to indicate that the SIM card is not ready yet. For example, SIM card operations cannot be executed when airplane mode is on.
| API level 6 | 
| MDM 4.0 | 
Flag to indicate that a wrong SIM PIN value was supplied.
| API level 6 | 
| MDM 4.0 | 
Flag to indicate that an invalid SIM PIN value was supplied. A PIN code is a numeric value containing 4 to 8 digits.
| API level 6 | 
| MDM 4.0 | 
Flag to indicate that the maximum number of SIM PIN operations attempts with the wrong PIN code has been reached. A SIM card usually allows three attempts before blocking itself by PUK. However, to avoid PUK blocking, no SIM PIN operation is executed while the number of remaining attempts is 1 or less.
| API level 6 | 
| MDM 4.0 | 
Flag to indicate that a subscriber identiy module (SIM) personal identification number (PIN) operation completed successfully.
| API level 6 | 
| MDM 4.0 | 
Flag to indicate that another administrator has already locked the SIM card on the current device.
| API level 6 | 
| MDM 4.0 | 
Flag to indicate that an unknown error occurred.
| API level 6 | 
| MDM 4.0 | 
Flag to indicate that API failed for an unknown reason
| API level 24 | 
Used as an long extra field with ACTION_RCS_MSG_TEXT_RECEIVED, ACTION_RCS_MSG_TEXT_SENT, 
 ACTION_RCS_MSG_FILE_THUMBNAIL_RECEIVED, ACTION_RCS_MSG_FILE_RECEIVED and ACTION_RCS_MSG_FILE_SENT.
| API level 26 | 
| KNOX 3.2 | 
This constant is a key to fetch file path of RCS message from Bundle returned by getRCSMessage(long).
 Applicable only in RCS message of type file.
| API level 26 | 
| KNOX 3.2 | 
Flag to be used to retrieve the number of incoming or outgoing calls allowed by day.
| API level 2 | 
| MDM 2.0 | 
Flag to be used to retrieve the number of incoming or outgoing calls allowed by month.
| API level 2 | 
| MDM 2.0 | 
Flag to be used to retrieve the number of incoming or outgoing calls allowed by week.
| API level 2 | 
| MDM 2.0 | 
Flag to be used to retrieve the amount of data packets sent or received allowed by day.
| API level 2 | 
| MDM 2.0 | 
Flag to be used to retrieve the amount of data packets sent or received allowed by month.
| API level 2 | 
| MDM 2.0 | 
Flag to be used to retrieve the amount of data packets sent or received allowed by week.
| API level 2 | 
| MDM 2.0 | 
Flag to be used to retrieve the number of sent or received Short Message Service (SMS) text messages allowed by day.
| API level 2 | 
| MDM 2.0 | 
Flag to be used to retrieve the number of sent or received Short Message Service (SMS) text messages allowed by month.
| API level 2 | 
| MDM 2.0 | 
Flag to be used to retrieve the number of sent or received Short Message Service (SMS) text messages allowed by week.
| API level 2 | 
| MDM 2.0 | 
Flag to indicate that all RCS feature which contains call and message.
| API level 24 | 
Used as an String extra field with the return value of getRCSMessage(long).
 Contains the sender's address.
| API level 26 | 
| KNOX 3.2 | 
This constant is a key to fetch sender's alias of RCS message from Bundle returned by getRCSMessage(long).
| API level 26 | 
| KNOX 3.2 | 
This constant is a key to fetch thumbnail path of RCS message from Bundle returned by getRCSMessage(long).
 Applicable only in RCS message of type file.
| API level 26 | 
| KNOX 3.2 | 
This constant is a key to fetch RCS message's received or sent timestamp from Bundle returned by getRCSMessage(long).
| API level 26 | 
| KNOX 3.2 | 
API to add an exception pattern to the administrator's exception pattern set for incoming calls.
| pattern | The exception pattern to be added to administrator's exception pattern set. | 
|---|
true if adding incoming call exception pattern is
         successful, else false.| SecurityException | If caller does not have required permissions | 
|---|
| This API adds (concatenates) the provided exception pattern to the
        exception pattern set of the administrator for incoming calls.
        The exception pattern works as a whitelist against the restriction
        pattern for the same administrator who set it, but has not priority
        over restriction pattern set by other administrator. Previous
        patterns remain and the new pattern is added. The API returns falseif the device has no voice call capability (e.g., tablets).
        See  
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // previous patterns remain and the new pattern is added
     // to allow incoming calls
     if (phoneRestrictionPolicy.addIncomingCallExceptionPattern(".*")) {
         Log.d(TAG, "success adding incoming call exception pattern");
     } else {
         Log.w(TAG, "failed adding incoming call exception pattern");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 11 | 
| MDM 5.0 | 
| Global Scope | 
API to add a restriction pattern to the administrator's restriction pattern set for incoming calls.
| pattern | The restriction pattern to be added to administrator's restriction pattern set. | 
|---|
true if adding incoming call restriction is
         successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| This API adds (concatenates) the provided restriction pattern to
        the restriction pattern set of the administrator for incoming
        calls. The API returns falseif the device has no
        voice call capability (e.g., a tablet).
        See  
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // previous patterns remain and the new pattern is added
     // to block incoming calls
     if (phoneRestrictionPolicy.addIncomingCallRestriction(".*")) {
         Log.d(TAG, "success adding incoming call restriction");
     } else {
         Log.w(TAG, "failed adding incoming call restriction");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to add an exception pattern to the administrator's exception pattern set for incoming SMSs.
| pattern | The exception pattern to be added to the administrator's exception pattern set. | 
|---|
true if adding incoming sms exception pattern is
         successful, else false.| SecurityException | If caller does not have required permissions | 
|---|
| This API adds (concatenates) the provided exception pattern to the
        exception pattern set of the administrator for incoming SMSs.
        The exception pattern works as a whitelist against the restriction
        pattern for the same administrator who set it, but has not priority
        over restriction pattern set by other administrator. Previous patterns
        remain and the new pattern is added. The API returns falseif the device has no voice call capability (e.g., tablets).
        See  
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // previous patterns remain and the new pattern is added
     // to allow incoming SMSs
     if (phoneRestrictionPolicy.addIncomingSmsExceptionPattern(".*")) {
         Log.d(TAG, "success adding incoming sms exception pattern");
     } else {
         Log.w(TAG, "failed adding incoming sms exception pattern");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 11 | 
| MDM 5.0 | 
| Global Scope | 
API to add a restriction pattern to the administrator restriction pattern set for incoming Short Message Service (SMS) text messages.
| pattern | The restriction pattern. | 
|---|
true if adding incoming SMS restriction is successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| This method adds the provided pattern to the pattern set from the
        calling administrator if it exists or sets the pattern if none exist. 
        See  
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // previous patterns remain and the new pattern is added
     // to block incoming SMS
     if (phoneRestrictionPolicy.addIncomingSmsRestriction(".*")) {
         Log.d(TAG, "success adding incoming SMS restriction");
     } else {
         Log.w(TAG, "failed adding incoming SMS restriction");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to add an exception pattern to the administrator's exception pattern set for outgoing calls.
| pattern | The exception pattern to be added to the administrator's exception pattern set. | 
|---|
true if adding outgoing call exception pattern was
         successful, else false.| SecurityException | If caller does not have required permissions | 
|---|
| This API adds (concatenates) the provided exception pattern to the
        exception pattern set of the administrator for outgoing calls. The
        exception pattern works as a whitelist against the restriction
        pattern for the same administrator who set it, but has not priority
        over restriction pattern set by other administrator. Previous patterns
        remain and the new pattern is added. The API returns falseif the device has no voice call capability (e.g., tablets).
        See  
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // previous patterns remain and the new pattern is added
     // to allow outgoing calls
     if (phoneRestrictionPolicy.addOutgoingCallExceptionPattern(".*")) {
         Log.d(TAG, "success adding outgoing call exception pattern");
     } else {
         Log.w(TAG, "failed adding outgoing call exception pattern");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 11 | 
| MDM 5.0 | 
| Global Scope | 
API to add a restriction pattern to the administrator's restriction pattern set for outgoing calls.
| pattern | The restriction pattern to be added to the administrator's restriction pattern set. | 
|---|
true if adding outgoing call restriction was
         successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| This API adds (concatenates) the provided restriction pattern to
        the restriction pattern set of the administrator for outgoing calls.
        Previous patterns remain and the new pattern is added.
        The API returns falseif the device has no voice
        call capability (e.g., a tablet).
        See  
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // previous patterns remain and the new pattern is added
     // to block outgoing calls
     if (phoneRestrictionPolicy.addOutgoingCallRestriction(".*")) {
         Log.d(TAG, "success adding outgoing call restriction");
     } else {
         Log.w(TAG, "failed adding outgoing call restriction");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to add an exception pattern to the administrator's exception pattern set for outgoing SMSs.
| pattern | The exception pattern to be added to the administrator's exception pattern set. | 
|---|
true if adding outgoing sms exception pattern is
         successful, else false.| SecurityException | If caller does not have required permissions | 
|---|
| This API adds (concatenates) the provided exception pattern to the
        exception pattern set of the administrator for outgoing SMSs. The
        exception pattern works as a whitelist against the restriction
        pattern for the same administrator who set it, but has not priority
        over restriction pattern set by other administrator. Previous patterns
        remain and the new pattern is added. The API returns falseif the device has no voice call capability (e.g., tablets).
        See  
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // previous patterns remain and the new pattern is added
     // to allow outgoing SMSs
     if (phoneRestrictionPolicy.addOutgoingSmsExceptionPattern(".*")) {
         Log.d(TAG, "success adding outgoing sms exception pattern");
     } else {
         Log.w(TAG, "failed adding outgoing sms exception pattern");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 11 | 
| MDM 5.0 | 
| Global Scope | 
API to add a restriction pattern to the administrator restriction pattern set for outgoing Short Message Service (SMS) text messages.
| pattern | The restriction pattern. | 
|---|
true if adding outgoing SMS restriction is successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| This method adds the provided pattern to the pattern set from the
        calling administrator (if it exists) or sets the pattern if none
        exist. Previous patterns remain and the new pattern is added. 
        See  
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // previous patterns remain and the new pattern is added
     // blocking all outgoing SMS
     if (phoneRestrictionPolicy.addOutgoingSmsRestriction(".*")) {
         Log.d(TAG, "success adding outgoing SMS restriction");
     } else {
         Log.w(TAG, "failed adding outgoing SMS restriction");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to allow or disallow caller Id display during an incoming call.
| allow | trueto allow caller Id display,falseto prevent displaying caller Id. | 
|---|
true when successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this API to allow or disallow caller Id
        information on the device during an incoming call. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.allowCallerIDDisplay(false)) {
         Log.d(TAG, "Caller Id display blocked successfully");
     } else {
         Log.d(TAG, "Failed to block caller Id display");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 6 | 
| MDM 4.0 | 
| Global Scope | 
API to enable / disable Copy contact from device to SIM Card.
| allow | trueto enable, elsefalse | 
|---|
true if successful, else false| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| Administrator can use this API to disable copy from a contact stored at
 device to SIM card phonebook. If this is disallowed, user will not be
 able to copy, edit or add contacts to SIM Card phonebook. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     boolean enableCopyContactToSim = true;
     phoneRestrictionPolicy.allowCopyContactToSim(enableCopyContactToSim);
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }  | 
| The use of this API requires the caller to add the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission with a protection level of signature. | 
| API level 11 | 
| MDM 5.0 | 
| Global Scope | 
Deprecated in API level 35
API to allow or disallow incoming Multimedia Messaging Service (MMS) messages.
| allow | trueto allow incoming MMS messages,falseto disallow incoming MMS messages. | 
|---|
true if setting allow/disallow incoming MMS was
         successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this API to allow or disallow incoming MMS messages. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.allowIncomingMms(false)) {
         Log.d(TAG, "Incoming MMS blocked successfully");
     } else {
         Log.d(TAG, "Failed to block incoming MMS");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
 
 NOTE: This API is strongly coupled to the native MMS client application.
 So, if user defines a third-party application as default for messaging,
 this policy may not apply. It's recommended to prevent the user from
 installing other messaging applications by using ApplicationPolicy
 APIs (like  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 5 | 
| MDM 3.0 | 
| Global Scope | 
Deprecated in API level 35
API to allow or disallow incoming Short Message Service (SMS) text messages.
| allow | trueto allow incoming SMS messages,falseto disallow incoming SMS messages. | 
|---|
true if allowing/disallowing incoming SMS messages
         was successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this API to allow or disallow incoming SMS messages. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.allowIncomingSms(false)) {
         Log.d(TAG, "Incoming SMS blocked successfully");
     } else {
         Log.d(TAG, "Failed to block incoming SMS");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
 NOTE: This policy will not apply in case native telephony stack is not used to receive SMS. | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 5 | 
| MDM 3.0 | 
| Global Scope | 
Deprecated in API level 35
API to allow or disallow outgoing Multimedia Messaging Service (MMS) messages.
| allow | trueto allow outgoing MMS messages,falseto disallow outgoing MMS messages. | 
|---|
true if setting allow/disallow outgoing MMS was
         successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this API to allow or disallow outgoing MMS messages. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.allowOutgoingMms(false)) {
         Log.d(TAG, "Outgoing MMS blocked successfuly");
     } else {
         Log.d(TAG, "Failed to block outgoing MMS");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
 
 NOTE: This API is strongly coupled to the native MMS client application.
 So, if user defines a third-party application as default for messaging,
 this policy may not apply. It's recommended to prevent the user from
 installing other messaging applications by using ApplicationPolicy
 APIs (like  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 5 | 
| MDM 3.0 | 
| Global Scope | 
Deprecated in API level 35
API to allow or disallow outgoing Short Message Service (SMS) text messages.
| allow | trueto allow outgoing SMS messages,falseto disallow outgoing SMS messages. | 
|---|
true if allowing/disallowing outgoing SMS messages
         was successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this API to allow or disallow outgoing SMS messages. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.allowOutgoingSms(false)) {
         Log.d(TAG, "Outgoing SMS blocked successfully");
     } else {
         Log.d(TAG, "Failed to block outgoing SMS");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
 NOTE: This policy will not apply in case native telephony stack is not used to send SMS. | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 5 | 
| MDM 3.0 | 
| Global Scope | 
Deprecated in API level 33
API to enable or disable processing of WAP Push messages.
true if allowing or disallowing WAP Push message
         processing was successful, else false.| SecurityException | If caller does not have required permissions | 
|---|
| An administrator can use this API to enable or disable processing
        of WAP Push messages. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.allowWapPush(false)) {
         Log.d(TAG, "WAP push messages are disallowed.");
     } else {
         Log.d(TAG, "Failed to block WAP push");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 6 | 
| MDM 4.0 | 
| Global Scope | 
API to allow or disallow storage of blocked incoming Multimedia Message Service (MMS) messages.
| block | trueto block incoming MMS messages and store
             them for late delivery,falseto disable the
             blocking and deliver the MMS messages that were stored. | 
|---|
true if blocking/unblocking incoming MMS messages for late
         delivery was successful, false otherwise.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this API to block the user from
        receiving MMS messages. In addition, the
        messages are stored. When the administrator disable blocking,
        the MMS messages are delivered to the user. The
        following policies may restrict the usage of this policy: allowIncomingMms(boolean),setEmergencyCallOnly(boolean),allowWapPush(boolean)orsetRoamingPush(boolean). If any of these
        policies block MMS messages, they are neither stored nor
        delivered to the user. The MMS messages are stored when this
        policy is the only reason to block the MMS messages.
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.blockMmsWithStorage(true)) {
         Log.d(TAG, "MMS are blocked and stored for late delivery.");
     } else {
         Log.d(TAG, "Failed to enable blocking of MMS with storage for late delivery");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 6 | 
| MDM 4.0 | 
| Global Scope | 
API to allow or disallow storage of blocked incoming Short Message Service (SMS) text messages.
| block | trueto block incoming SMS messages and store
             them for late delivery,falseto disable blocking
             and deliver the SMS messages that were stored. | 
|---|
true if blocking/unblocking incoming SMS messages
         for late delivery was successful, false otherwise.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this API to block the user from
        receiving SMS messages but store the
        messages. When the administrator disables blocking,
        the SMS messages are delivered to the user. The
        following policies may restrict the usage of this policy: allowIncomingSms(boolean),setEmergencyCallOnly(boolean),setLimitOfIncomingSms(int, int, int)orsetIncomingSmsRestriction(String). If any of these
        policies block SMS messages, they are neither stored nor
        delivered to the user. The SMS messages are stored when this
        policy is the only reason to block the SMS messages.
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.blockSmsWithStorage(true)) {
         Log.d(TAG, "SMS will be blocked and stored for late delivery.");
     } else {
         Log.d(TAG, "Failed to enable blocking of SMS, with storage for late delivery");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 6 | 
| MDM 4.0 | 
| Global Scope | 
API to check if a given dial number for incoming call matches the incoming call restriction pattern.
| dialNumber | The dial number of the incoming call. | 
|---|
true if the dial number matches the pattern, false
         if the dial number does not match.| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to check whether an incoming Short Message Service (SMS) text message from a given number is allowed.
| phoneNumber | The phone number to be checked. | 
|---|
true if the phone number for the incoming SMS is allowed, false if
         the phone number for the incoming SMS is not allowed.| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to check if a given dial number for an outgoing call matches the outgoing call restriction pattern.
| dialNumber | The dial number of the outgoing call. | 
|---|
true if the dial number matches the pattern, false
         if the dial number does not match.| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to check whether an outgoing Short Message Service (SMS) text message to a given number is allowed.
| phoneNumber | The phone number to be checked. | 
|---|
true if the phone number for the outgoing SMS is allowed, false if
         the phone number for the outgoing SMS is not allowed.| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to change SIM card's PIN code.
| currentPinCode | current SIM card's PIN code value | 
|---|---|
| newPinCode | new PIN code value to be set | 
ERROR_SIM_PIN_NONE: If PIN lock was successfully changed;
           ERROR_SIM_PIN_ALREADY_UNLOCKED: If PIN code could not be changed because PIN lock was disabled;ERROR_SIM_PIN_BLOCKED_BY_PUK: In case SIM card is blocked by PIN unlock key (PUK); ERROR_SIM_PIN_DATABASE: If a database error occurred; ERROR_SIM_PIN_UNKNOWN: If an unknown error occurred; ERROR_SIM_PIN_FAILED: If a generic error occurred;ERROR_SIM_PIN_ID_NOT_READY: In case SIM card was not ready; ERROR_SIM_PIN_INCORRECT_CODE: When supplied PIN code is wrong; ERROR_SIM_PIN_INVALID_CODE: When supplied PIN code is malformed; ERROR_SIM_PIN_MAX_RETRIES_EXCEEDED: If there is only one or less remaining attempt; ERROR_SIM_PIN_OWNED_BY_OTHER_ADMIN: If SIM card has been locked by another administrator on the same device.ERROR_SIM_NOT_INSERTED: If SIM specified at
               getPhoneRestrictionPolicy(String) is not inserted on the device.| SecurityException | If caller does not have required permissions | 
|---|
| An administrator can use this API to change a SIM card's PIN code. As a requirement,
        PIN lock must be enabled, otherwise ERROR_SIM_PIN_ALREADY_UNLOCKEDis returned.The administrator must provide the current PIN code and the new desired value. Both are numeric codes with 4 to 8 digits. If any of provided PIN codes is in an unexpected format, ERROR_SIM_PIN_INVALID_CODEis returned. If the current PIN
        code is incorrect,ERROR_SIM_PIN_INCORRECT_CODEis returned
        and one attempt is wasted. If there is one or less remaining attempt,ERROR_SIM_PIN_MAX_RETRIES_EXCEEDEDis returned.The administrator can change the PIN code of any SIM card unless it is locked by another administrator on the same device; in this case, ERROR_SIM_PIN_OWNED_BY_OTHER_ADMINis returned. When a SIM
        card's PIN code is changed, the current administrator becomes the owner
        on that device.The SIM card does not operate when the device is in Offline (airplane) Mode. In this case, ERROR_SIM_PIN_ID_NOT_READYis returned, which indicated that the SIM card is not ready for operations.
         
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 // This will get the phoneRestrictionPolicy for the default SIM.
 PhoneRestrictionPolicy phoneRestrictionPolicyForDefault = edm.getPhoneRestrictionPolicy();
 String oldPinCodeForDefaultSIM = "1234"
 String newPinCodeForDefaultSIM = "8888"
 // Subscription Manager to get SIM information
 SubscriptionManager subManager = (SubscriptionManager) getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
 // Get the iccId for the device inserted on Slot 0
 String iccId = subManager.getActiveSubscriptionInfoForSimSlotIndex(0).getIccId();
 // This will get the phoneRestrictionPolicy for a specific SIM Card with the given ICCID.
 PhoneRestrictionPolicy phoneRestrictionPolicyForSpecificSIM = edm.getPhoneRestrictionPolicy(iccId);
 String oldPinCodeForSpecificSIM = "5678"
 String newPinCodeForSpecificSIM = "9999"
 try {
     // Change SIM Pin for Default SIM
     int resultForDefaultSim = phoneRestrictionPolicyForDefault.changeSimPinCode(oldPinCodeForDefaultSIM,newPinCodeForDefaultSIM);
     checkResult(resultForDefaultSim);
     // Change the SIM Pin for a specific SIM
     int resultForSpecificSIm = phoneRestrictionPolicyForSpecificSIM.changeSimPinCode(oldPinCodeForSpecificSIM,newPinCodeForSpecificSIM);
     checkResult(resultForSpecificSIm);
 } catch (SecurityException securityException) {
     Log.w(TAG, "SecurityException: " + securityException);
 }
 private void checkResult(int result) {
      switch (result) {
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_NONE:
              Log.d(TAG, "SIM PIN code successfully changed");
              break;
          case PhoneRestrictionPolicy.ERROR_SIM_PIN_ALREADY_LOCKED:
             Log.d(TAG, "Failed: Already locked but not by administrator");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_ALREADY_UNLOCKED:
         Log.d(TAG, "Failed: Cannot change PIN code when
                 PIN lock is disabled");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_BLOCKED_BY_PUK:
         Log.d(TAG, "Failed: SIM card is blocked by PIN unlock key (PUK)");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_DATABASE:
         Log.d(TAG, "Failed to enable SIM PIN lock: a database error
                 occurred");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_UNKNOWN:
         Log.d(TAG, "Failed: Unknown error occurred");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_FAILED:
         Log.d(TAG, "Failed: Generic error occurred");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_ID_NOT_READY:
         Log.d(TAG, "Failed: SIM card is not ready yet");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_INCORRECT_CODE:
         Log.d(TAG, "Failed: Supplied PIN code is wrong");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_INVALID_CODE:
         Log.d(TAG, "Failed: Supplied PIN code is in wrong format");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_MAX_RETRIES_EXCEEDED:
         Log.d(TAG, "Failed: Maximum number of retries reached");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_OWNED_BY_OTHER_ADMIN:
              Log.d(TAG,
              "Failed: Operation denied. Another administrator has already locked this SIM card on this device");
              break;
          case PhoneRestrictionPolicy.ERROR_SIM_NOT_INSERTED:
              Log.d(TAG,
              "Failed: The specified Sim Card is not present");
         break;
     }
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 6 | 
| MDM 4.0 | 
| Global Scope | 
API that clears all stored, blocked Multimedia Message Service (MMS) messages.
true if stored MMS messages were cleared successfully, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this API to clear blocked MMS
        messages that were stored. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.clearStoredBlockedMms()) {
         Log.d(TAG, "Stored MMS were cleared.");
     } else {
         Log.d(TAG, "Failed to clear stored MMS");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 6 | 
| MDM 4.0 | 
| Global Scope | 
API that clears all stored, blocked Short Message Service (SMS) text messages.
true if stored SMS messages were cleared successfully,
         else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this API to clear blocked SMS
        messages that were stored. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.clearStoredBlockedSms()) {
         Log.d(TAG, "Stored SMS were cleared.");
     } else {
         Log.d(TAG, "Failed to clear stored SMS");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 6 | 
| MDM 4.0 | 
| Global Scope | 
API to disable SIM card's PIN lock. User is able to use SIM card on other devices and no PIN code is required.
| pinCode | current SIM card's PIN code value | 
|---|
ERROR_SIM_PIN_NONE: If PIN lock was successfully disabled;
         ERROR_SIM_PIN_ALREADY_UNLOCKED: If PIN lock was already disabled; ERROR_SIM_PIN_BLOCKED_BY_PUK: In case SIM card is blocked by PIN unlock key (PUK); ERROR_SIM_PIN_DATABASE: If a database error occurred; ERROR_SIM_PIN_UNKNOWN: If an unknown error happened; ERROR_SIM_PIN_FAILED: If a generic error occurred; ERROR_SIM_PIN_ID_NOT_READY: In case SIM card was not ready; ERROR_SIM_PIN_INCORRECT_CODE: When supplied PIN code is wrong; ERROR_SIM_PIN_INVALID_CODE: When supplied PIN code is malformed; ERROR_SIM_PIN_MAX_RETRIES_EXCEEDED: If there is only one or less remaining attempt; ERROR_SIM_PIN_OWNED_BY_OTHER_ADMIN: If SIM card has been locked by another administrator on the same device. ERROR_SIM_NOT_INSERTED: If SIM specified at
             getPhoneRestrictionPolicy(String) is not inserted on the device. | SecurityException | If caller does not have required permissions | 
|---|
| An administrator can use this API to disable the SIM card's PIN lock. The
        user can use the SIM card on any device without requiring a PIN code. To disable the SIM PIN lock, the administrator must provide the current PIN code, which is a numeric code of 4 to 8 digits. If the PIN code is provided in an unexpected format, ERROR_SIM_PIN_INVALID_CODEis returned.
        If the PIN code is incorrect,ERROR_SIM_PIN_INCORRECT_CODEis returned
        and one attempt is wasted. If one or less attempt remains,ERROR_SIM_PIN_MAX_RETRIES_EXCEEDEDis returned.The administrator can disable the PIN lock on any SIM card unless it is locked by other administrator on the same device; in this case, ERROR_SIM_PIN_OWNED_BY_OTHER_ADMINis returned. When a SIM
        card's PIN lock is disabled, the SIM card no longer owned by any
        administrator until its PIN lock is enabled again on that device.It is not possible to run SIM card operations when device is offline (airplane) Mode. In this case, ERROR_SIM_PIN_ID_NOT_READYis returned, which indicates that the SIM card is not ready for operations.
         
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 // This will get the phoneRestrictionPolicy for the default SIM.
 PhoneRestrictionPolicy phoneRestrictionPolicyForDefault = edm.getPhoneRestrictionPolicy();
 String pinCodeForDefault = "1234"
 // Subscription Manager to get SIM information
 SubscriptionManager subManager = (SubscriptionManager) getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
 // Get the iccId for the device inserted on Slot 0
 String iccId = subManager.getActiveSubscriptionInfoForSimSlotIndex(0).getIccId();
 // This will get the phoneRestrictionPolicy for a specific SIM Card with the given ICCID.
 PhoneRestrictionPolicy phoneRestrictionPolicyForSpecificSIM = edm.getPhoneRestrictionPolicy(iccId);
 String pinCodeForSpecificSIM = "5678"
 try {
     // Disable the SIM Pin Lock for Default SIM
     int resultForDefaultSim = phoneRestrictionPolicyForDefault.disableSimPinLock(pinCodeForDefault);
     checkResult(resultForDefaultSim);
     // Disable the SIM Pin Lock for a specific SIM
     int resultForSpecificSIm = phoneRestrictionPolicyForSpecificSIM.disableSimPinLock(pinCodeForSpecificSIM);
     checkResult(resultForSpecificSIm);
 } catch (SecurityException securityException) {
     Log.w(TAG, "SecurityException: " + securityException);
 }
 private void checkResult(int result) {
      switch (result) {
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_NONE:
         Log.d(TAG, "SIM PIN lock successfully disabled");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_ALREADY_UNLOCKED:
         Log.d(TAG, "Failed: Already unlocked");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_BLOCKED_BY_PUK:
         Log.d(TAG, "Failed: SIM card is blocked by PIN unlock key (PUK)");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_DATABASE:
         Log.d(TAG, "Failed to enable SIM PIN lock: a database error
                 occurred");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_UNKNOWN:
         Log.d(TAG, "Failed: Unknown error occurred");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_FAILED:
         Log.d(TAG, "F boolean isCopyContactToSimAllowed(ailed: Generic error occurred");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_ID_NOT_READY:
         Log.d(TAG, "Failed: SIM card is not ready yet");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_INCORRECT_CODE:
         Log.d(TAG, "Failed: Supplied PIN code is wrong");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_INVALID_CODE:
         Log.d(TAG, "Failed: Supplied PIN code is in wrong format");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_MAX_RETRIES_EXCEEDED:
         Log.d(TAG, "Failed: Maximum number of retries reached");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_OWNED_BY_OTHER_ADMIN:
         Log.d(TAG, "Failed: Operation denied. Another administrator has locked
                 this SIM card on this device");
         break;
          case PhoneRestrictionPolicy.ERROR_SIM_NOT_INSERTED:
              Log.d(TAG,
              "Failed: The specified Sim Card is not present");
         break;
     }
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 6 | 
| MDM 4.0 | 
| Global Scope | 
API to enable or disable limiting the number of calls.
| status | trueto enable limiting the number of calls ,falseto disable
            limiting the number of calls. | 
|---|
true if enabling limits to number of calls is successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this policy to enable or disable limiting
        the number of calls allowed on the device. This policy is
        complemented by setLimitOfIncomingCalls(int, int, int)andsetLimitOfOutgoingCalls(int, int, int).
        The API returns  
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.enableLimitNumberOfCalls(true)) {
         // Set the incoming call limit to 5 by day, no limit by week, 100 by
         // month
         if (phoneRestrictionPolicy.setLimitOfIncomingCalls(5, 0, 100)) {
             Log.d(TAG, "success setting incoming call limits");
         } else {
             Log.w(TAG, "failure setting incoming call limits");
         }
         // Set the outgoing call limit to 10 by day, no limit by week, no limit
         // by month
         if (phoneRestrictionPolicy.setLimitOfOutgoingCalls(10, 0, 0)) {
             Log.d(TAG, "success setting outgoing call limits");
         } else {
             Log.w(TAG, "failure setting outgoing call limits");
         }
     } else {
         Log.w(TAG, "failure enabling call limits");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to enable or disable limiting the number of Short Message Service (SMS) text messages.
| status | trueto enable,falseto disable. | 
|---|
true if enabling limits on the number of SMS
         messages was successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this API to enable or disable limiting the number
        of SMS messages allowed on the device. This policy is complemented by setLimitOfIncomingSms(int, int, int)andsetLimitOfOutgoingSms(int, int, int).For a device managed by multiple administrators, the last limit values set apply. This measure also applies to usage counters. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.enableLimitNumberOfSms(true)) {
         // Set the incoming SMS limit to 10 by day, no limit by week, no limit
         // by month
         if (phoneRestrictionPolicy.setLimitOfIncomingSms(10, 0, 0)) {
             Log.d(TAG, "success setting incoming SMS limits");
         } else {
             Log.w(TAG, "failure setting incoming SMS limits");
         }
         // Set the outgoing SMS limit to 5 by day, 20 by week, 100 by month
         if (phoneRestrictionPolicy.setLimitOfOutgoingSms(5, 20, 100)) {
             Log.d(TAG, "success setting outgoing SMS limits");
         } else {
             Log.w(TAG, "failure setting outgoing SMS limits");
         }
     } else {
         Log.w(TAG, "failure enabling SMS limits");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to enable SIM card's PIN lock. The user is prevented from using the SIM card in other devices since a PIN code is required to use the SIM.
| pinCode | current SIM card's PIN code value | 
|---|
ERROR_SIM_PIN_NONE: If PIN lock was successfully enabled;
           ERROR_SIM_PIN_ALREADY_LOCKED: If PIN lock was already enabled but not by any administrator;ERROR_SIM_PIN_ALREADY_LOCKED_BY_ADMIN: If PIN lock was already enabled by current administrator;ERROR_SIM_PIN_BLOCKED_BY_PUK: In case SIM card is blocked by PIN unlock key (PUK); ERROR_SIM_PIN_DATABASE: If a database error occurred; ERROR_SIM_PIN_UNKNOWN: If an unknown error occurred; ERROR_SIM_PIN_FAILED: If a generic error occurred;ERROR_SIM_PIN_ID_NOT_READY: In case SIM card was not ready; ERROR_SIM_PIN_INCORRECT_CODE: When supplied PIN code is wrong; ERROR_SIM_PIN_INVALID_CODE: When supplied PIN code is malformed; ERROR_SIM_PIN_MAX_RETRIES_EXCEEDED: If there is only one or less remaining attempt; ERROR_SIM_PIN_OWNED_BY_OTHER_ADMIN: If SIM card has been locked by another administrator on the same device.ERROR_SIM_NOT_INSERTED: If SIM specified at
               getPhoneRestrictionPolicy(String) is not inserted on the device.| SecurityException | If caller does not have required permissions | 
|---|
| An administrator can use this API to enable the SIM card's PIN lock. The lock is
        transparent to the user: Whenever the device is powered on, it
        automatically unlocks the SIM card for that session. However, if the
        SIM card is moved to another device, it remains locked. To enable the SIM card PIN lock, an administrator must provide the current PIN code, which is a numeric code of 4 to 8 digits. If the provided PIN code is not in the expected format, ERROR_SIM_PIN_INVALID_CODEis returned.
        Also, if the code is incorrect,ERROR_SIM_PIN_INCORRECT_CODEis returned
        and one attempt is wasted. If one (or less) potential attempt remains,ERROR_SIM_PIN_MAX_RETRIES_EXCEEDEDis returned.The administrator is allowed to enable PIN lock on any SIM card unless it is already enabled. When a SIM card's PIN lock is enabled successfully, the current administrator becomes the owner on that device. It is not possible to run SIM card operations when device is offline (airplane mode). In this case, ERROR_SIM_PIN_ID_NOT_READYis returned, indicating that the SIM card is not ready for operations.NOTE: Since MDM 5.8 administrator can specify the iccId of the SIM card that will be affected by this policy using getPhoneRestrictionPolicy(String)
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 // This will get the phoneRestrictionPolicy for the default SIM.
 PhoneRestrictionPolicy phoneRestrictionPolicyForDefault = edm.getPhoneRestrictionPolicy();
 String pinCodeForDefault = "1234"
 // Subscription Manager to get SIM information
 SubscriptionManager subManager = (SubscriptionManager) getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
 // Get the iccId for the device inserted on Slot 0
 String iccId = subManager.getActiveSubscriptionInfoForSimSlotIndex(0).getIccId();
 // This will get the phoneRestrictionPolicy for a specific SIM Card with the given ICCID.
 PhoneRestrictionPolicy phoneRestrictionPolicyForSpecificSIM = edm.getPhoneRestrictionPolicy(iccId);
 String pinCodeForSpecificSIM = "5678"
 try {
     // Enable the SIM Pin for Default SIM
     int resultForDefaultSim = phoneRestrictionPolicyForDefault.enableSimPinLock(pinCodeForDefault);
     checkResult(resultForDefaultSim);
     // Enable the SIM Pin for a specific SIM
     int resultForSpecificSIm = phoneRestrictionPolicyForSpecificSIM.enableSimPinLock(pinCodeForSpecificSIM);
     checkResult(resultForSpecificSIm);
 } catch (SecurityException securityException) {
     Log.w(TAG, "SecurityException: " + securityException);
 }
 private void checkResult(int result) {
      switch (result) {
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_NONE:
         Log.d(TAG, "SIM PIN lock successfully enabled");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_ALREADY_LOCKED:
         Log.d(TAG, "Failed: Already locked but not by administrator");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_ALREADY_LOCKED_BY_ADMIN:
         Log.d(TAG, "Failed: Already locked by current administrator");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_BLOCKED_BY_PUK:
         Log.d(TAG, "Failed: SIM card is blocked by PIN unlock key (PUK)");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_DATABASE:
         Log.d(TAG, "Failed to enable SIM PIN lock: a database error
                 occurred");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_UNKNOWN:
         Log.d(TAG, "Failed: Unknown error occurred");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_FAILED:
         Log.d(TAG, "Failed: Generic error occurred");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_ID_NOT_READY:
         Log.d(TAG, "Failed: SIM card is not ready yet");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_INCORRECT_CODE:
         Log.d(TAG, "Failed: Supplied PIN code is wrong");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_INVALID_CODE:
         Log.d(TAG, "Failed: Supplied PIN code is in wrong format");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_MAX_RETRIES_EXCEEDED:
         Log.d(TAG, "Failed: Maximum number of retries reached");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_PIN_OWNED_BY_OTHER_ADMIN:
         Log.d(TAG, "Failed: Operation denied. Another administrator has already
                 locked this SIM card on this device");
         break;
     case PhoneRestrictionPolicy.ERROR_SIM_NOT_INSERTED:
         Log.d(TAG, "Failed: The specified Sim Card is not present");
         break;
     }
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 6 | 
| MDM 4.0 | 
| Global Scope | 
API to check whether a limit on carrier data network usage is enabled.
true if the device is currently limiting the amount
         of bytes to be sent and received through the carrier's data
         network. false if the device is not currently
         limiting the amount of bytes to be sent and received through
         carrier's data network.| An administrator can use this interface to verify if a limit on
        data carrier network usage is currently enabled on the device. For a device managed by multiple administrators, this method returns the more restricted value rather than the value set by the calling administrator. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 if (phoneRestrictionPolicy.getDataCallLimitEnabled()) {
     Log.d(TAG, "Data call limit enabled");
 } else {
     Log.w(TAG, "Data call limit disabled");
 }
  | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
Deprecated in API level 35
API to get a disclaimer text for outgoing sms and mms.
@hide_knox
| This API will return a disclaimer text set by administrator for outgoing sms and mms 
 
 EnterpriseDeviceManager edm = (EnterpriseDeviceManager)
      getSystemService(EnterpriseDeviceManager.ENTERPRISE_POLICY_SERVICE);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 
 try {
     // get a new disclaimer text
     String result = phoneRestrictionPolicy.getDisclaimerText() {
     if (result == null) {
         // this policy not set by any admin
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| API level 21 | 
| MDM 5.7.1 | 
| Global Scope | 
API to check whether emergency calls only are allowed on the device.
| allAdmins | trueto get restricted value from all
            administrators,falseto get restricted value
            only from the calling administrator. | 
|---|
true if only emergency calls are allowed, false otherwise.| An administrator can use this API to check emergency calls only
        are enabled on the device. If enabled, all other calls are blocked.
        The API returns falseif the device has no voice call
        capability (e.g., a tablet).
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.getEmergencyCallOnly(true)) { // true to get
                                                              // restricted value
                                                              // from all administrators
         Log.d(TAG, "blocking all calls except emergency");
     } else {
         Log.d(TAG, "not blocking all calls");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to get the exception pattern for incoming calls.
null.| SecurityException | If caller does not have required permissions | 
|---|
| An administrator can use this API to retrieve the current pattern
        used as exception/whitelist for incoming calls. The exception
        pattern works as a whitelist against the restriction pattern for
        the same administrator who set it, but has no priority over
        restriction pattern set by other administrator. The API returns nullif the device has no voice call capability (e.g., tablets).
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // get the concatenated exception pattern from the all administrators
     String incomingCallsPattern = phoneRestrictionPolicy.getIncomingCallExceptionPatterns();
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 11 | 
| MDM 5.0 | 
| Global Scope | 
API to get the restriction pattern for incoming calls.
| allAdmins | If true, get a composition of all restrictions
                  from all administrators. Iffalse, get a
                  restriction pattern from the calling administrator only. | 
|---|
null.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this API to retrieve the current pattern
        used to restrict incoming calls. The API returns nullif the device has no voice call capability (e.g., a tablet).
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // get the restriction pattern from the calling administrator (using parameter
     // false)
     String incomingCallsPattern = phoneRestrictionPolicy.getIncomingCallRestriction(false);
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to get the exception pattern for incoming SMSs.
null.| SecurityException | If caller does not have required permissions | 
|---|
| An administrator can use this API to retrieve the current pattern
        used as exception/whitelist for incoming SMSs. The exception
        pattern works as a whitelist against the restriction pattern for
        the same administrator who set it, but has no priority over
        restriction pattern set by other administrator. The API returns nullif the device has no voice call capability (e.g., tablets).
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // get the concatenated exception pattern from the all administrators
     String incomingSMSsPattern = phoneRestrictionPolicy.getIncomingSmsExceptionPatterns();
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 11 | 
| MDM 5.0 | 
| Global Scope | 
API to get the restriction pattern for incoming Short Message Service (SMS) text messages.
| allAdmins | trueif restriction pattern from all
            administrators must be returned,falsefor the
            pattern from the calling administrator. | 
|---|
null if no
         combination for incoming SMS restriction is set.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| If the specified parameter is false, this method
        returns the incoming SMS restriction pattern for the calling
        administrator. If the parameter istrue, this method
        returns a combination of all pattern sets by all administrators.
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // get the incoming SMS restriction pattern from the calling administrator (using parameter
     // false)
     String incomingSmsPattern = phoneRestrictionPolicy.getIncomingSmsRestriction(false);
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to get the limits on data packet usage per day, week, or month.
| type | Must be one of the following values: 
             | 
|---|
| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this API to determine the limit in data network usage per day, week, or month. For a device managed by multiple administrators, this method returns the more restricted value rather than the value set by the calling administrator. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 if (phoneRestrictionPolicy.getDataCallLimitEnabled()) {
     int currentDataCallsByDay = phoneRestrictionPolicy
             .getLimitOfDataCalls(LIMIT_NUMBER_OF_DATA_CALLS_BY_DAY);
     int currentDataCallsByWeek = phoneRestrictionPolicy
             .getLimitOfDataCalls(LIMIT_NUMBER_OF_DATA_CALLS_BY_WEEK);
     int currentDataCallsByMonth = phoneRestrictionPolicy
             .getLimitOfDataCalls(LIMIT_NUMBER_OF_DATA_CALLS_BY_MONTH);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to get the limit of incoming calls for a day, week, or month.
| type | Must be one of the these values: 
             | 
|---|
| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| This method returns the restriction limit on the number of incoming
        calls based on the parameter passed to it. The API returns falseif the device has no voice call capability (e.g., a tablet).For a device managed by multiple administrators, the last limit values set apply. This measure also applies to usage counters. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 if (phoneRestrictionPolicy.isLimitNumberOfCallsEnabled()) {
     int currentIncomingCallsByDay = phoneRestrictionPolicy
             .getLimitOfIncomingCalls(LIMIT_NUMBER_OF_CALLS_BY_DAY);
     int currentIncomingCallsByWeek = phoneRestrictionPolicy
             .getLimitOfIncomingCalls(LIMIT_NUMBER_OF_CALLS_BY_WEEK);
     int currentIncomingCallsByMonth = phoneRestrictionPolicy
             .getLimitOfIncomingCalls(LIMIT_NUMBER_OF_CALLS_BY_MONTH);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to get the limit on incoming Short Message Service (SMS) text messages for a day, week, or month.
| type | Must be one of the following values: 
             | 
|---|
| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| This method returns the restriction limit set on the number of
        incoming SMS messages based on the parameter passed to it. For a device managed by multiple administrators, the last limit values set apply. This setting also applies to usage counters. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 if (phoneRestrictionPolicy.isLimitNumberOfSmsEnabled()) {
     int currentIncomingSmsByDay = phoneRestrictionPolicy
             .getLimitOfIncomingSms(LIMIT_NUMBER_OF_SMS_BY_DAY);
     int currentIncomingSmsByWeek = phoneRestrictionPolicy
             .getLimitOfIncomingSms(LIMIT_NUMBER_OF_SMS_BY_WEEK);
     int currentIncomingSmsByMonth = phoneRestrictionPolicy
             .getLimitOfIncomingSms(LIMIT_NUMBER_OF_SMS_BY_MONTH);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to get the limit on the number of outgoing calls for a day, week, and
 month. The API returns false if the device has no voice call
 capability (e.g., a tablet).
 
| type | Must be one of the following values: 
             | 
|---|
| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| This method returns the restriction limit on the number of
        outgoing calls based on the parameter passed to it. For a device managed by multiple administrators, the last limit values set apply. This measure also applies to usage counters. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 if (phoneRestrictionPolicy.isLimitNumberOfCallsEnabled()) {
     int currentOutgoingCallsByDay = phoneRestrictionPolicy
             .getLimitOfOutgoingCalls(LIMIT_NUMBER_OF_CALLS_BY_DAY);
     int currentOutgoingCallsByWeek = phoneRestrictionPolicy
             .getLimitOfOutgoingCalls(LIMIT_NUMBER_OF_CALLS_BY_WEEK);
     int currentOutgoingCallsByMonth = phoneRestrictionPolicy
             .getLimitOfOutgoingCalls(LIMIT_NUMBER_OF_CALLS_BY_MONTH);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to get the limit on outgoing Short Message Service (SMS) text messages for a day, week, or month.
| type | Must be one of the following values: 
             | 
|---|
| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| This method returns the restriction limit on the number of outgoing
        SMS messages based on the time period parameter (day, week, or month)
        passed to it. For a device managed by multiple administrators, the last limit values set apply. This setting also applies to usage counters. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 if (phoneRestrictionPolicy.isLimitNumberOfSmsEnabled()) {
     int currentIncomingSmsByDay = phoneRestrictionPolicy
             .getLimitOfOutgoingSms(LIMIT_NUMBER_OF_SMS_BY_DAY);
     int currentIncomingSmsByWeek = phoneRestrictionPolicy
             .getLimitOfOutgoingSms(LIMIT_NUMBER_OF_SMS_BY_WEEK);
     int currentIncomingSmsByMonth = phoneRestrictionPolicy
             .getLimitOfOutgoingSms(LIMIT_NUMBER_OF_SMS_BY_MONTH);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to get the exception pattern for outgoing calls.
null.| SecurityException | If caller does not have required permissions | 
|---|
| An administrator can use this API to retrieve the current pattern
        used as exception/whitelist for outgoing calls. The exception pattern
        works as a whitelist against the restriction pattern for the same
        administrator who set it, but has no priority over restriction
        pattern set by other administrator. The API returns nullif the device has no voice call capability (e.g., a tablet).
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // get the concatenated exception pattern from the all administrators
     String outgoingCallsPattern = phoneRestrictionPolicy.getOutgoingCallExceptionPatterns();
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 11 | 
| MDM 5.0 | 
| Global Scope | 
API to get the restriction pattern for outgoing calls.
| allAdmins | If true, gets a composition of all
            restrictions from all administrators. Iffalse,
            gets restriction pattern from the calling administrator only. | 
|---|
null.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this API to retrieve the current pattern used
        to restrict outgoing calls. The API returns nullif the
        device has no voice call capability (e.g., a tablet).
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // get the restriction pattern from the calling administrator (using parameter
     // false)
     String outgoingCallsPattern = phoneRestrictionPolicy.getOutgoingCallRestriction(false);
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to get the exception pattern for outgoing SMSs.
null.| SecurityException | If caller does not have required permissions | 
|---|
| An administrator can use this API to retrieve the current pattern
        used as exception/whitelist for outgoing SMSs. The exception
        pattern works as a whitelist against the restriction pattern for
        the same administrator who set it, but has no priority over
        restriction pattern set by other administrator. The API returns nullif the device has no voice call capability (e.g., tablets).
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // get the concatenated exception pattern from the all administrators
     String outgoingSMSsPattern = phoneRestrictionPolicy.getOutgoingSmsExceptionPatterns();
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature | 
| API level 11 | 
| MDM 5.0 | 
| Global Scope | 
API to get the restriction pattern for outgoing Short Message Service (SMS) text messages.
| allAdmins | trueif pattern from all administrators must
            be returned,falsefor the pattern from the
            calling administrator only. | 
|---|
null
         if no combination for outgoing SMS restrictions is set or if it fails.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| If the specified parameter is false, this method
        returns the outgoing SMS restriction pattern for the calling
        administrator. If the parameter istrue, this method
        returns a combination of all SMS restriction pattern sets by all
        administrators.
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // get the SMS restriction pattern from the calling administrator (when parameter is
     // false)
     String outgoingSmsPattern = phoneRestrictionPolicy.getOutgoingSmsRestriction(false);
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
Deprecated in API level 35
API to get a Rich Communication Services (RCS) data.
| id | Id of RCS data. | 
|---|
| SecurityException | If caller does not have required permissions | 
|---|
| This method returns RCS datas as below using parameters (id) passed to it. - remote_uri, sender_alias, content_type, body, timestamp for all 
 - file_path, thumbnail_path for file type 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 long id = intent.getExtras().getLong(EXTRA_MSG_ID);
 
 String action = intent.getAction();
 boolean isFile = false;
 if (ACTION_RCS_MSG_FILE_THUMBNAIL_RECEIVED.equals(action)
        || ACTION_RCS_MSG_FILE_RECEIVED.equals(action)
        || ACTION_RCS_MSG_FILE_SENT.equals(action)) {
     isFile = true;
 }
 Bundle rcsData = phoneRestrictionPolicy.getRCSMessage(id);
 String remoteUri = rcsData.getString(REMOTE_URI);
 String senderAlias = rcsData.getString(SENDER_ALIAS);
 String contentType = rcsData.getString(CONTENT_TYPE);
 String body = rcsData.getString(BODY);
 long timestamp = rcsData.getLong(TIMESTAMP);
 if (isFile) {
     String filePath = rcsData.getString(FILE_PATH);
     String thumbnailPath = rcsData.getString(THUMBNAIL_PATH);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_ADVANCED_RESTRICTION" permission which has a protection level of signature. | 
| API level 26 | 
| KNOX 3.2 | 
| Global Scope | 
API to check whether storage of blocked incoming Multimedia Message Service (MMS) messages is enabled.
true if blocked incoming MMS messages are stored for
         late delivery, else false.| An administrator can use this API to check whether the blocked
        incoming MMS are stored for late delivery. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.isBlockMmsWithStorageEnabled()) {
         Log.d(TAG, "Blocked incoming MMS are stored for late delivery");
     } else {
         Log.d(TAG, "MMS are not blocked by this policy");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| API level 6 | 
| MDM 4.0 | 
| Global Scope | 
API to check whether storage of blocked incoming Short Message Service (SMS) text messages is enabled.
true if blocked incoming SMS messages are stored for
         late delivery, else false.| An administrator can use this API to check whether blocked
        incoming SMS messages are stored for late delivery. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.isBlockSmsWithStorageEnabled()) {
         Log.d(TAG, "Blocked incoming SMS are stored for late delivery");
     } else {
         Log.d(TAG, "SMS are not blocked by this policy");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| API level 6 | 
| MDM 4.0 | 
| Global Scope | 
API to get the display status of caller Id during an incoming call.
true if displaying caller Id is allowed during an
         incoming call, else false.| An administrator can use this API to determine whether displaying
        caller Id is allowed during an incoming call. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.isCallerIDDisplayAllowed()) {
         Log.d(TAG, "caller Id display allowed  on call ");
     } else {
         Log.w(TAG, "caller Id display disallowed on call");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| API level 6 | 
| MDM 4.0 | 
| Global Scope | 
API to check whether the copy.
true if copy contact to SIM is enabled, else false.| Administrator can check whether contact adding, copy or edition is enabled or not.
 The default value will be true;
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.isCopyContactToSimAllowed()) {
         Log.d(TAG, "Copy, adding or edition of SIM Contact is allowed");
     } else {
         Log.w(TAG, "Copy, adding or edition of SIM Contact is disallowed");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 } | 
| API level 11 | 
| MDM 5.0 | 
| Global Scope | 
API to determine whether incoming Multimedia Messaging Service (MMS) messages are allowed.
true if incoming MMS messages are allowed, else false.| An administrator can use this API to determine whether incoming
        MMS messages are allowed or disallowed. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.isIncomingMmsAllowed()) {
         Log.d(TAG, "Incoming MMS is allowed");
     } else {
         Log.w(TAG, "Incoming MMS is disallowed");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| API level 5 | 
| MDM 3.0 | 
| Global Scope | 
API to determine whether incoming Short Message Service (SMS) text messages are allowed.
true if incoming SMS messages are allowed, else false.| An administrator can use this API to determine whether incoming
        SMS messages are allowed. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.isIncomingSmsAllowed()) {
         Log.d(TAG, "Incoming SMS is allowed");
     } else {
         Log.w(TAG, "Incoming SMS is disallowed");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| API level 5 | 
| MDM 3.0 | 
| Global Scope | 
API to check whether the number of calls is limited.
true if the number of calls is limited, false if the number of calls
         is unlimited.| An administrator can use this method to verify if there is a
        limitation on the number of calls. 
        This policy is controlled by the last administrator who called it.
        For a device managed by multiple administrators, the last limit
        values apply. This measure also applies to usage counters. The API
        returns  
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.isLimitNumberOfCallsEnabled()) {
         Log.d(TAG, "Call limit enabled");
     } else {
         Log.w(TAG, "Call limit disabled");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to check whether the number of Short Message Service (SMS) text messages is limited.
true if a limit on the number of SMS messages is
         enabled, false if limiting the number of SMS
         messages is disabled.| An administrator can use this API to verify whether the device limits
        the number of SMS messages. For a device managed by multiple administrators, the last limit values set apply. This measure also applies to usage counters. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.isLimitNumberOfSmsEnabled()) {
         Log.d(TAG, "SMS limit enabled");
     } else {
         Log.w(TAG, "SMS limit disabled");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to determine whether outgoing Multimedia Messaging Service (MMS) messages are allowed.
true if outgoing MMS messages are allowed, else false.| An administrator can use this API to determine whether outgoing
        MMS messages are allowed or disallowed. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.isOutgoingMmsAllowed()) {
         Log.d(TAG, "Outgoing MMS is allowed");
     } else {
         Log.w(TAG, "Outgoing MMS is disallowed");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| API level 5 | 
| MDM 3.0 | 
| Global Scope | 
API to determine whether outgoing Short Message Service (SMS) text messages are allowed.
true if outgoing SMS messages are allowed, else false.| An administrator can use this API to determine whether outgoing
        SMS messages are allowed. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.isOutgoingSmsAllowed()) {
         Log.d(TAG, "Outgoing SMS is allowed");
     } else {
         Log.w(TAG, "Outgoing SMS is disallowed");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| API level 5 | 
| MDM 3.0 | 
| Global Scope | 
API to check whether Rich Communication Services (RCS) feature is enabled or not.
| feature | RCS feature options see, RCS_FEATURE_ALL | 
|---|
true if successful, else false| SecurityException | If caller does not have required permissions | 
|---|
| This API can check which feature are disabled about Rich Communication Services (RCS). 
 
 EnterpriseDeviceManager edm = (EnterpriseDeviceManager)
      getSystemService(EnterpriseDeviceManager.ENTERPRISE_POLICY_SERVICE);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 
 try {
      //check whether the RCS feature is disabled or not.
      boolean result = phoneRestrictionPolicy.isRCSEnabled(PhoneRestrictionPolicy.RCS_FEATURE_ALL));
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature | 
| API level 24 | 
| Global Scope | 
Deprecated in API level 33
API to check whether processing of WAP Push messages is allowed.
true if WAP Push message processing is allowed, false
         if WAP Push message processing is disallowed.| An administrator can use this API to check whether processing WAP
        Push messages is allowed. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.isWapPushAllowed()) {
         Log.d(TAG, "WAP Push processing is allowed");
     } else {
         Log.w(TAG, "WAP Push processing is disallowed");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| API level 6 | 
| MDM 4.0 | 
| Global Scope | 
API to remove the exception pattern (concatenated or not) for incoming calls set by the device administrators.
true if removing incoming call exception pattern is
         successful, else false.| SecurityException | If caller does not have required permissions | 
|---|
| An administrators can use this API to remove the current pattern
        used to allow incoming calls. The exception pattern works as a
        whitelist against the restriction pattern for the same
        administrator who set it, but has no priority over restriction
        pattern set by other administrator. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.removeIncomingCallExceptionPattern()) {
         Log.d(TAG, "success removing incoming call exception pattern");
     } else {
         Log.w(TAG, "failed removing incoming call exception pattern");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 11 | 
| MDM 5.0 | 
| Global Scope | 
API to remove the restriction pattern for incoming calls set by the calling administrator.
true if removing incoming call restriction is
         successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this API to remove the current pattern
              used to restrict incoming calls. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.removeIncomingCallRestriction()) {
         Log.d(TAG, "success removing incoming call restriction");
     } else {
         Log.w(TAG, "failed removing incoming call restriction");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to remove the exception pattern (concatenated or not) for incoming SMSs set by the device administrators.
true if removing incoming sms exception pattern is
         successful, else false.| SecurityException | If caller does not have required permissions | 
|---|
| An administrators can use this API to remove the current pattern
        used to allow incoming SMSs. The exception pattern works as a
        whitelist against the restriction pattern for the same administrator
        who set it, but has no priority over restriction pattern set by
        other administrator. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.removeIncomingSmsExceptionPattern()) {
         Log.d(TAG, "success removing incoming sms exception pattern");
     } else {
         Log.w(TAG, "failed removing incoming sms exception pattern");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 11 | 
| MDM 5.0 | 
| Global Scope | 
API to remove the restriction pattern for incoming Short Message Service (SMS) text messages set by the calling administrator.
true if removing incoming SMS restriction pattern
         was successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| This method removes the incoming SMS restriction pattern set
        by the calling administrator. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.removeIncomingSmsRestriction()) {
         Log.d(TAG, "success removing incoming SMS restriction");
     } else {
         Log.w(TAG, "failed removing incoming SMS restriction");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to remove the exception pattern (concatenated or not) for outgoing calls set by the device administrators.
true if removing outgoing call exception pattern is
         successful, else false.| SecurityException | If caller does not have required permissions | 
|---|
| An administrators can use this API to remove the current pattern
        used to allow outgoing calls. The exception pattern works as a
        whitelist against the restriction pattern for the same administrator
        who set it, but has no priority over restriction pattern set by
        other administrator. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.removeOutgoingCallExceptionPattern()) {
         Log.d(TAG, "success removing outgoing call exception pattern");
     } else {
         Log.w(TAG, "failed removing outgoing call exception pattern");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 11 | 
| MDM 5.0 | 
| Global Scope | 
API to remove the restriction pattern for outgoing calls set by the calling administrator.
true if removing outgoing call restriction is
         successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this API to remove the current pattern
        used to restrict outgoing calls. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.removeOutgoingCallRestriction()) {
         Log.d(TAG, "success removing outgoing call restriction");
     } else {
         Log.w(TAG, "failed removing outgoing call restriction");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to remove the exception pattern (concatenated or not) for incoming SMSs set by the device administrators.
true if removing incoming sms exception pattern is
         successful, else false.| SecurityException | If caller does not have required permissions | 
|---|
| An administrators can use this API to remove the current pattern
        used to allow incoming SMSs. The exception pattern works as a
        whitelist against the restriction pattern for the same administrator
        who set it, but has no priority over restriction pattern set by
        other administrator. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.removeIncomingSmsExceptionPattern()) {
         Log.d(TAG, "success removing incoming sms exception pattern");
     } else {
         Log.w(TAG, "failed removing incoming sms exception pattern");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 11 | 
| MDM 5.0 | 
| Global Scope | 
API to remove the restriction pattern for outgoing Short Message Service (SMS) text messages set by the calling administrator.
true if removing outgoing SMS restriction pattern was successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| This method removes the outgoing SMS restriction pattern set by
        the calling administrator. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.removeOutgoingSmsRestriction()) {
         Log.d(TAG, "success removing outgoing SMS restriction");
     } else {
         Log.w(TAG, "failed removing outgoing SMS restriction");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to reset the counters for incoming and outgoing calls.
true if resetting call counters is successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| This method resets all counters for incoming and outgoing
        calls for each date type (day, week, and month). The limits set for
        each kind of call are not changed. The API returns falseif the device has no voice call capability (e.g., a tablet).For a device managed by multiple administrators, the last limit values set apply. This measure also applies to usage counters. 
 
  EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
  PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
  phoneRestrictionPolicy.enableLimitNumberOfCalls(true);
  phoneRestrictionPolicy.setLimitOfIncomingCalls(1, 2, 3);
  phoneRestrictionPolicy.setLimitOfOutgoingCalls(1, 2, 3);
  try {
      // Some time after the policy is enabled, the user has probably used some of the quota.
      // The administrator can reset the used quota.
      if (phoneRestrictionPolicy.resetCallsCount())
          Log.d(TAG, "success resetting call used quota");
      } else {
          Log.w(TAG, "failed resetting call used quota");
      }
  } catch (SecurityException e) {
      Log.w(TAG, "SecurityException: " + e);
  }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to reset the counters for data usage limits sent and received on device.
true if the operation succeed, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| This method resets the counters for data usage limits for each
        time period (day, week, and month). The limits set for each period
        are not changed. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
  try {
      phoneRestrictionPolicy.setDataCallLimitEnabled(true);
      phoneRestrictionPolicy.setLimitOfDataCalls(1, 2, 3);
      // The user has probably used some of the quota
      // during the time period after the policy is enabled.
      // The administrator can reset the used quota by calling this reset method:
      if (phoneRestrictionPolicy.resetDataCallLimitCounter())
          Log.d(TAG, "success resetting data used quota");
      } else {
          Log.w(TAG, "failed resetting data used quota");
      }
  } catch (SecurityException e) {
      Log.w(TAG, "SecurityException: " + e);
  }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to reset the counters for incoming or outgoing Short Message Service (SMS) text messages.
true if resetting SMS counts is successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| This method resets all counters for incoming or outgoing SMS messages
        for each duration period (day, week, and month). The limits set for each
        period are not changed. For a device managed by multiple administrators, the last limit values set apply. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 phoneRestrictionPolicy.enableLimitNumberOfSms(true);
 phoneRestrictionPolicy.setLimitOfIncomingSms(1, 2, 3);
 phoneRestrictionPolicy.setLimitOfOutgoingSms(1, 2, 3);
 try {
     // The user has probably used some of the quotas
     // after the policy is enabled.
     // The administrator can reset the used quota by calling this reset method:
     if (phoneRestrictionPolicy.resetSmsCount()) {
         Log.d(TAG, "success resetting SMS used quota");
     } else {
         Log.w(TAG, "failed resetting SMs used quota");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to enable a limit on data carrier network usage on the device.
| status | trueif the device shall limit data call traffic
            (count amount of data) | 
|---|
true if setting data call limit is enabled
         successfully, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this API to enable a limit on data carrier
        network usage. The default value for this policy is false,
        which means it is disabled by default.For a device managed by multiple administrators, the last limit values set apply. This setting also applies to usage counters. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.setDataCallLimitEnabled(true)) {
         Log.w(TAG, "success enabling data call limit");
     } else {
         Log.w(TAG, "failure enabling data call limit");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| setLimitOfDataCalls(long, long, long) | 
| Global Scope | 
Deprecated in API level 35
API to set a disclaimer text for outgoing sms and mms.
@hide_knox
| text | The disclaimer text to be attached on outgoing sms and mms. Pass null to reset. Note: The maximum supported character length is 30. Since Knox 3.7, it is 60. | 
|---|
| SecurityException | If caller does not have required permissions | 
|---|
| This API will set a disclaimer text which will be attached on outgoing sms and mms 
 
 EnterpriseDeviceManager edm = (EnterpriseDeviceManager)
      getSystemService(EnterpriseDeviceManager.ENTERPRISE_POLICY_SERVICE);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 
 try {
     // set a new disclaimer text
     String text = "sampleurl";
     if (phoneRestrictionPolicy.setDisclaimerText("text")) {
         Log.d(TAG, "success setting disclaimer text");
     } else {
         Log.w(TAG, "failed setting disclaimer text");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature | 
| API level 21 | 
| MDM 5.7.1 | 
| Global Scope | 
API to enable or disable emergency calls only on device.
| enable | Enables emergency calls only. | 
|---|
true if setting emergency call only is successful,
         else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| If enabled, only emergency calls are allowed. All other
        calls and messages are blocked. The API returns falseif the
        device has no voice call capability (e.g., a tablet).
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.setEmergencyCallOnly(true)) {
         Log.d(TAG, "success blocking all calls except emergency");
     } else {
         Log.w(TAG, "failed blocking all calls except emergency");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to set an exception pattern to be matched by incoming call numbers.
| pattern | The exception pattern to be matched against the incoming call number. | 
|---|
true if setting incoming call exception pattern is
         successful, else false.| SecurityException | If caller does not have required permissions | 
|---|
| This API overrides any exception pattern previously set by the
        administrator for incoming calls. The exception pattern works as a
        whitelist against the restriction pattern for the same administrator
        who set it, but has no priority over restriction pattern set by other
        administrator. The API returns falseif the device
        has no voice call capability (e.g., tablets).
        See  
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // set a new pattern to block all incoming calls
     if (phoneRestrictionPolicy.setIncomingCallExceptionPattern(".*")) {
         Log.d(TAG, "success setting incoming call exception pattern");
     } else {
         Log.w(TAG, "failed setting incoming call exception pattern");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 11 | 
| MDM 5.0 | 
| Global Scope | 
API to set a restriction pattern to be matched by incoming call numbers.
| pattern | The restriction pattern to be matched against the incoming call number. | 
|---|
true if setting incoming call restriction was
         successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| This API overrides any pattern previously set by the administrator
        for incoming calls. The API returns falseif the
        device has no voice call capability (e.g., a tablet).
        See  
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // set a new pattern to block all incoming calls
     if (phoneRestrictionPolicy.setIncomingCallRestriction(".*")) {
         Log.d(TAG, "success setting incoming call restriction");
     } else {
         Log.w(TAG, "failed setting incoming call restriction");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to set an exception pattern to be matched by incoming SMS numbers.
| pattern | The exception pattern to be matched against the incoming SMS number. | 
|---|
true if setting incoming SMS exception pattern is
         successful, else false.| SecurityException | If caller does not have required permissions | 
|---|
| This API overrides any exception pattern previously set by the
        administrator for incoming SMSs. The exception pattern works as
        a whitelist against the restriction pattern for the same
        administrator who set it, but has no priority over restriction
        pattern set by other administrator. The API returns falseif the device has no voice call capability (e.g., tablets).
        See  
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // set a new pattern to block all incoming SMSs
     if (phoneRestrictionPolicy.setIncomingSmsExceptionPattern(".*")) {
         Log.d(TAG, "success setting incoming SMS exception pattern");
     } else {
         Log.w(TAG, "failed setting incoming SMS exception pattern");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 11 | 
| MDM 5.0 | 
| Global Scope | 
API to set incoming Short Message Service (SMS) text message restriction pattern for the calling administrator.
| pattern | The restriction pattern. | 
|---|
true if setting incoming SMS restriction is successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| This method overrides any previously set pattern in the database or
        adds a new one if none exist. 
        See  
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // set a new pattern to block all incoming SMS
     if (phoneRestrictionPolicy.setIncomingSmsRestriction(".*")) {
         Log.d(TAG, "success setting incoming SMS restriction");
     } else {
         Log.w(TAG, "failed setting incoming SMS restriction");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to set the limit on data packet usage per day, week, and month.
| limitByDay | The maximum number of bytes per day. | 
|---|---|
| limitByWeek | The maximum number of bytes per week. | 
| limitByMonth | The maximum number of bytes per month. | 
true if setting limit on data network usage is
         successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this interface to limit the amount of data
        packets sent or received through the carrier data network by day,
        week, and month. For a device managed by multiple administrators, the last limit values set apply. This setting also applies to usage counters. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.setDataCallLimitEnabled(true)) {
         // Set the data usage limit to 100MB by day, 500MB by week, 1GB by month
         if (mPhoneRestrictionPolicy.setLimitOfDataCalls(104857600, 524288000, 1073741824)) {
             Log.d(TAG, "success setting data usage limits");
         } else {
             Log.w(TAG, "failure setting data usage limits");
         }
     } else {
         Log.w(TAG, "failure enabling data usage limits");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| setDataCallLimitEnabled(boolean) | 
| Global Scope | 
API to set the limit for the number of incoming calls per day, week, and month.
| limitByDay | The maximum number of incoming calls for a day. | 
|---|---|
| limitByWeek | The maximum number of incoming calls for a week. | 
| limitByMonth | The maximum number of incoming calls for a month. | 
true if setting the limit of incoming calls was successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this API to set a limit to the number of
        incoming calls by day, week, or month. Passing "0" as a parameter
        means that there is no limit on the number of calls for that
        duration period (day, week or month). 
        For a device managed by multiple administrators, the last limit
        values set apply. This measure also applies to usage counters.
        The API returns  
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.enableLimitNumberOfCalls(true)) {
         // Set the incoming call limit to 5 by day, no limit by week, 100 by
         // month
         if (phoneRestrictionPolicy.setLimitOfIncomingCalls(5, 0, 100)) {
             Log.d(TAG, "success setting incoming call limits");
         } else {
             Log.w(TAG, "failure setting incoming call limits");
         }
     } else {
         Log.w(TAG, "failure enabling call limits");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| enableLimitNumberOfCalls(boolean) | 
| Global Scope | 
API to set a limit on the number of incoming Short Message Service (SMS) text messages per day, week, and month.
| limitByDay | The maximum number of incoming SMS messages for a day. | 
|---|---|
| limitByWeek | The maximum number of incoming SMS messages for a week. | 
| limitByMonth | The maximum number of incoming SMS messages for a month. | 
true if setting a limit on the number of incoming
         SMS messages is successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this API to set a limit on the number of
        incoming SMS messages by day, week, and month. Passing "0" as a
        parameter means that there is no limit on the number of incoming
        SMS messages for the related period (day, week, or month). For a device managed by multiple administrators, the last limit values set apply. This setting also applies to usage counters. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.enableLimitNumberOfSms(true)) {
         // Set the incoming SMS message limit to 10 by day, no limit by week, no limit
         // by month
         if (phoneRestrictionPolicy.setLimitOfIncomingSms(10, 0, 0)) {
             Log.d(TAG, "success setting incoming SMS limits");
         } else {
             Log.w(TAG, "failure setting incoming SMS limits");
         }
     } else {
         Log.w(TAG, "failure enabling SMS limits");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| enableLimitNumberOfSms(boolean) | 
| Global Scope | 
API to set the limit for the number of outgoing calls per day, week, and month.
 The API returns false if the device has no voice call capability (e.g., a
 tablet).
 
| limitByDay | The maximum number of outgoing calls for a day. | 
|---|---|
| limitByWeek | The maximum number of outgoing calls for a week. | 
| limitByMonth | The maximum number of outgoing calls for a month. | 
true if setting the limit of outgoing calls is
         successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this API to set a limit to the number
        of outgoing calls by day, week, and month. Passing "0" as a
        parameter means that there is no limit on the number of calls for
        the related duration period (day, week, or month). For a device managed by multiple administrators, the last limit values set apply. This measure also applies to usage counters. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.enableLimitNumberOfCalls(true)) {
         // Set the outgoing call limit to 10 by day, no limit by week, no limit
         // by month
         if (phoneRestrictionPolicy.setLimitOfOutgoingCalls(10, 0, 0)) {
             Log.d(TAG, "success setting outgoing call limits");
         } else {
             Log.w(TAG, "failure setting outgoing call limits");
         }
     } else {
         Log.w(TAG, "failure enabling call limits");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| enableLimitNumberOfCalls(boolean) | 
| Global Scope | 
API to set a limit of number of outgoing Short Message Service (SMS) text messages per day, week, and month.
| limitByDay | The maximum number of outgoing SMS messages for a day. | 
|---|---|
| limitByWeek | The maximum number of outgoing SMS messages for a week. | 
| limitByMonth | The maximum number of outgoing SMS messages for a month. | 
true if setting limit on outgoing SMS is successful,
         else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| An administrator can use this API set a limit on the number of
        outgoing SMS messages by day, week, and month. Passing "0" as a
        parameter means that there is no limit on the number of outgoing
        SMS messages for the related period (day, week, or month). For a device managed by multiple administrators, the last limit values set apply. This setting also applies to usage counters. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     if (phoneRestrictionPolicy.enableLimitNumberOfSms(true)) {
         // Set the outgoing SMS message limit to 5 by day, 20 by week, 100 by month
         if (phoneRestrictionPolicy.setLimitOfOutgoingSms(5, 20, 100)) {
             Log.d(TAG, "success setting outgoing SMS limits");
         } else {
             Log.w(TAG, "failure setting outgoing SMS limits");
         }
     } else {
         Log.w(TAG, "failure enabling SMS limits");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| enableLimitNumberOfSms(boolean) | 
| Global Scope | 
API to set an exception pattern to be matched by outgoing call numbers.
| pattern | The exception pattern to be matched against the outgoing call number. | 
|---|
true if setting the outgoing call exception pattern
         is successful, else false.| SecurityException | If caller does not have required permissions | 
|---|
| This API overrides any exception pattern previously set by the
        administrator for outgoing calls. The exception pattern works as a
        whitelist against the restriction pattern for the same administrator
        who set it, but has no priority over restriction pattern set by
        other administrator. The API returns falseif the
        device has no voice call capability (e.g., tablets).Some regular expresions accepted: 
         
         
         
         
         
         
         
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // Note that double backslashes are needed when writing the
     // string in Java.
     if (phoneRestrictionPolicy
             .setOutgoingCallExceptionPattern("(?![1]?[\\-]?800[\\-]?[0-9]{3}[\\-]?[0-9]{4}$).*")) {
         Log.d(TAG, "successful setting outgoing call exception pattern");
     } else {
         Log.w(TAG, "failed setting outgoing call exception pattern");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 11 | 
| MDM 5.0 | 
| Global Scope | 
API to set a restriction pattern to be matched by outgoing call numbers.
| pattern | The restriction pattern to be matched against the outgoing call number. | 
|---|
true if setting the outgoing call restriction is
         successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| This API overrides any pattern previously set by the administrator for
        outgoing calls. The API returns falseif the device has no voice call
        capability (e.g., a tablet).Some regular expresions accepted: 
         
         
         
         
         
         
         
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // Note that double backslashes are needed when writing the
     // string in Java.
     if (phoneRestrictionPolicy
             .setOutgoingCallRestriction("(?![1]?[\\-]?800[\\-]?[0-9]{3}[\\-]?[0-9]{4}$).*")) {
         Log.d(TAG, "successful setting outgoing call restriction");
     } else {
         Log.w(TAG, "failed setting outgoing call restriction");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to set an exception pattern to be matched by outgoing SMS numbers.
| pattern | The exception pattern to be matched against the outgoing SMS number. | 
|---|
true if setting the outgoing SMS exception pattern
         is successful, else false.| SecurityException | If caller does not have required permissions | 
|---|
| This API overrides any exception pattern previously set by the
        administrator for outgoing SMSs. The exception pattern works as
        a whitelist against the restriction pattern for the same
        administrator who set it, but has no priority over restriction
        pattern set by other administrator. The API returns falseif the device has no voice call capability (e.g., tablets).Some regular expresions accepted: 
         
         
         
         
         
         
         
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // Note that double backslashes are needed when writing the
     // string in Java.
     if (phoneRestrictionPolicy
             .setOutgoingSmsExceptionPattern("(?![1]?[\\-]?800[\\-]?[0-9]{3}[\\-]?[0-9]{4}$).*")) {
         Log.d(TAG, "successful setting outgoing SMS exception pattern");
     } else {
         Log.w(TAG, "failed setting outgoing SMS exception pattern");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 11 | 
| MDM 5.0 | 
| Global Scope | 
API to set the outgoing Short Message Service (SMS) text message restriction pattern for the calling administrator.
| pattern | The restriction pattern. | 
|---|
true if setting outgoing SMS restriction is successful, else false.| SecurityException | If caller does not have required permissions | 
|---|---|
| UnsupportedOperationException | If caller specifies an iccId at getPhoneRestrictionPolicy(String). | 
| This method overrides any previously set pattern in the database or
        adds a new one if none exist. 
 
 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 try {
     // set a new pattern to block all outgoing SMS
     if (phoneRestrictionPolicy.setOutgoingSmsRestriction(".*")) {
         Log.d(TAG, "success setting outgoing SMS restriction");
     } else {
         Log.w(TAG, "failed setting outgoing SMS restriction");
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature. | 
| API level 2 | 
| MDM 2.0 | 
| Global Scope | 
API to enable or disable Rich Communication Services (RCS) features on device native message apps(e.g. Samsung message app, Google Message app).
| feature | RCS feature options see, RCS_FEATURE_ALL | 
|---|---|
| enable | trueto enable, elsefalse | 
| SecurityException | If caller does not have required permissions | 
|---|
| This API can enable or disable the rich communciation service. The user cannot enable the RCS feature once it is disabled. 
 
 EnterpriseDeviceManager edm = (EnterpriseDeviceManager)
      getSystemService(EnterpriseDeviceManager.ENTERPRISE_POLICY_SERVICE);
 PhoneRestrictionPolicy phoneRestrictionPolicy = edm.getPhoneRestrictionPolicy();
 
 try {
     if (phoneRestrictionPolicy.setRCSEnabled(PhoneRestrictionPolicy.RCS_FEATURE_ALL, false)==PhoneRestrictionPolicy.ERROR_NONE) {
         // disable all RCS features (call, message) 
     } else {
         // default behavior. user can use RCS text message and call on device.
     }
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);
 }
  | 
| The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_PHONE_RESTRICTION" permission which has a protection level of signature | 
| API level 24 | 
| Global Scope |