java.lang.Object | |
↳ | com.samsung.android.knox.kiosk.KioskMode |
This class provides APIs to enable, disable, and define device behavior for kiosk mode. These APIs can be used in conjunction with other MDM APIs. An administrator can use kiosk mode APIs without enabling kiosk mode. Kiosk mode allows enterprises to restrict user access to selected applications and features on the device. These applications and features can be made available through the kiosk home screen.
API level 5 |
MDM 3.0 |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | ACTION_DISABLE_KIOSK_MODE_RESULT | Broadcast Action : Sent to inform administrators about the result of the disable kiosk mode operation. | |||||||||
String | ACTION_ENABLE_KIOSK_MODE_RESULT | Broadcast Action : Sent to inform administrators about the result of the enable Kiosk mode operation. | |||||||||
String | ACTION_UNEXPECTED_KIOSK_BEHAVIOR | Broadcast Action : Sent to inform administrators that unexpected kiosk behavior has occurred. | |||||||||
int | EDGE_FUNCTION_ALL | Bitmask to indicate all edge screen functionalities. | |||||||||
int | ERROR_BUSY | Indicates that kiosk mode service is busy with other request. | |||||||||
int | ERROR_KIOSK_ALREADY_ENABLED | Indicates that kiosk mode is already enabled. | |||||||||
int | ERROR_NONE | Indicates that kiosk mode operation was successful. | |||||||||
int | ERROR_PACKAGE_NOT_FOUND | Indicates that the kiosk home package cannot be found. | |||||||||
int | ERROR_PERMISSION_DENIED | Indicates that kiosk mode is enabled by another administrator. | |||||||||
int | ERROR_UNKNOWN | Indicates an unknown error. | |||||||||
String | EXTRA_KIOSK_RESULT | Used as an int extra field with ACTION_ENABLE_KIOSK_MODE_RESULT and
ACTION_DISABLE_KIOSK_MODE_RESULT . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
API to allow or deny Air Command on device.
| |||||||||||
API to allow or deny Air View on device.
| |||||||||||
API to allow or deny edge screen functionalities on device.
| |||||||||||
API to allow or block hardware keys on the device.
| |||||||||||
API to allow or deny multi window mode on device.
| |||||||||||
API to allow or deny task manager application and recent applications window.
| |||||||||||
API to clear all notifications from status bar, except those flagged with
Notification.FLAG_ONGOING_EVENT or Notification.FLAG_NO_CLEAR.
| |||||||||||
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 33
| |||||||||||
API to get a list of all blocked hardware keys.
| |||||||||||
API to check whether edge screen functionalities are blocked on device.
| |||||||||||
API to get the list of hardware keys available on the device.
| |||||||||||
Deprecated
in API level 33
| |||||||||||
API to hide the device navigation bar.
| |||||||||||
API to hide the device status bar.
| |||||||||||
API to hide the device status bar, system bar, or navigation bar.
| |||||||||||
API to check whether Air Command is allowed.
| |||||||||||
API to check whether Air View is allowed.
| |||||||||||
API to check whether a hardware key is allowed.
| |||||||||||
Deprecated
in API level 33
| |||||||||||
API to check if multi window mode is allowed or not allowed.
| |||||||||||
API to check whether the navigation bar is hidden
| |||||||||||
API to check whether the status bar is hidden.
| |||||||||||
API to check whether the status bar, the system bar, or the navigation bar is hidden.
| |||||||||||
API to check whether task manager and recent applications are allowed.
| |||||||||||
API to clear recent tasks list.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Broadcast Action : Sent to inform administrators about the result of the disable kiosk mode operation.
The receiver must hold "com.samsung.android.knox.permission.KNOX_KIOSK_MODE" to receive this broadcast.
This targeted broadcast is sent only to the administrator who called the API. The intent
has the following extra value:
EXTRA_KIOSK_RESULT
:
ERROR_NONE
for success
ERROR_PERMISSION_DENIED
if kiosk mode is enabled by another administrator
ERROR_UNKNOWN
for unknown error
ERROR_BUSY
if another request in progress
API level 5 |
MDM 3.0 |
Broadcast Action : Sent to inform administrators about the result of the enable Kiosk mode operation.
The receiver must hold "com.samsung.android.knox.permission.KNOX_KIOSK_MODE" to receive this broadcast.
This targeted broadcast is sent only to the administrator who calls the API. The intent
has the following extra value:
EXTRA_KIOSK_RESULT
:
ERROR_NONE
for success
ERROR_KIOSK_ALREADY_ENABLED
if kiosk mode is already enabled
ERROR_PACKAGE_NOT_FOUND
if the administrator-specified home screen package is
not found on the device
ERROR_UNKNOWN
for unknown error
ERROR_BUSY
if another request in progress
API level 5 |
MDM 3.0 |
Broadcast Action : Sent to inform administrators that unexpected kiosk behavior has occurred. Kiosk mode is forcefully disabled before broadcasting this intent. The receiver must hold "com.samsung.android.knox.permission.KNOX_KIOSK_MODE" to receive this broadcast. This targeted broadcast is sent only to the administrator that enabled kiosk mode.
API level 5 |
MDM 3.0 |
Bitmask to indicate all edge screen functionalities.
API level 17 |
MDM 5.5 |
Global Scope |
Indicates that kiosk mode service is busy with other request.
API level 5 |
MDM 3.0 |
Indicates that kiosk mode is already enabled.
API level 5 |
MDM 3.0 |
Indicates that kiosk mode operation was successful.
API level 5 |
MDM 3.0 |
Indicates that the kiosk home package cannot be found.
API level 5 |
MDM 3.0 |
Indicates that kiosk mode is enabled by another administrator.
API level 5 |
MDM 3.0 |
Indicates an unknown error.
API level 5 |
MDM 3.0 |
Used as an int extra field with ACTION_ENABLE_KIOSK_MODE_RESULT
and
ACTION_DISABLE_KIOSK_MODE_RESULT
. Contains the result of the enable or disable
kiosk mode operation.
API level 5 |
MDM 3.0 |
API to allow or deny Air Command on device.
allow | true to allow Air Command on device, false to block.NOTE: Since MDM 5.5, |
---|
true
if successful, false
if failed.SecurityException | If caller does not have required permissions |
---|
Administrator could set this policy to block Air Command feature on
device.
If it set to false , user will not be able use the stylus air command.
Otherwise if it is set to true , this mode will be allowed again.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); try { // Administrator wishes to block air command functionality. kioskModeService.allowAirCommandMode(false); } catch (RemoteException e) { Log.e(TAG, "Remote exception : " + e); } |
The API usage requires the caller to have the "com.samsung.android.knox.permission.KNOX_KIOSK_MODE" permission with a protection level of signature. |
API level 13 |
MDM 5.2 |
Global Scope |
API to allow or deny Air View on device.
allow | true to allow Air View on device, false to block |
---|
true
if successful, false
if failedSecurityException | If caller does not have required permissions |
---|
Administrator could set this policy to block Air View feature on
device.
If it set to false , user will not be able use the stylus pen air
view mode. Otherwise if it is set to true , this mode will be
allowed again.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); try { // Administrator wishes to block air view functionality. kioskModeService.allowAirViewMode(false); } catch (RemoteException e) { Log.e(TAG, "Remote exception : " + e); } |
The API usage requires the caller to have the "com.samsung.android.knox.permission.KNOX_KIOSK_MODE" permission with a protection level of signature. |
API level 13 |
MDM 5.2 |
Global Scope |
API to allow or deny edge screen functionalities on device.
edgeScreenFunction | Administrator can pass EDGE_FUNCTION_ALL to
block all edge screen functionalities. Calling this API with any other flags will return false . |
---|---|
allow | true to allow edge screen functionalities on device, false to block |
true
if successful, false
if failedSecurityException | If caller does not have required permissions |
---|
Administrator could use this policy to block or allow edge screen
functionalities on device.
EDGE_FUNCTION_ALL can be provided to block all the edge screen
functionalities. Calling this API with any other flags will return false .
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); boolean result = false; try { int edgeScreenFunctions = KioskMode.EDGE_FUNCTION_ALL; result = kioskModeService.allowEdgeScreen(edgeScreenFunctions, false); } catch (RemoteException e) { Log.e(TAG, "Remote exception : " + e); } if (result == true) { // Policy has been successfully applied } |
The API usage requires the caller to have the "com.samsung.android.knox.permission.KNOX_KIOSK_MODE" permission with a protection level of signature. |
API level 17 |
MDM 5.5 |
Global Scope |
API to allow or block hardware keys on the device.
hwKeyId | The list of Ids corresponding to the hardware keys. |
---|---|
allow | true to allow the list of hardware keys, false to block
them. |
null
on failure.SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to block the user from using some hardware
keys. If a list of hardware keys is set to false , the keys are
disabled, and the user cannot use them until the administrator
enables them again. If a list is set to true , user can use the
keys. The list returned identifies those keys successfully blocked or
allowed. If the administrator blocks a key that is not a hardware key, the key
is not effectively blocked at runtime. To obtain the
corresponding actions for each key Id, see Android Developer KeyEvent Page..
|
NOTE: Since MDM 5.3, only owner (User 0) administrator can call this API. For guest users, API will return EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); // disable try { List |
NOTE: Since MDM 5.3, only COM (Kiosk) container administrator can call this API. For other container types, API will return // When you create container successfully, containerID will be returned via intent. // Use this containerID in below API. EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID); KioskMode kioskModeService = kcm.getKioskMode(); try { List |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_KIOSK_MODE" permission with a protection level of signature. |
API level 5 |
MDM 3.0 |
User Scope |
API to allow or deny multi window mode on device.
allow | true to allow multi window mode, false to
disallow multi window mode.NOTE: Since MDM 5.5, |
---|
true
on set multi window mode allowance success, false
on set multi
window mode allowance failure.SecurityException | If caller does not have required permissions |
---|
Administrator could set this policy to block using multi window feature
on device. If it set to false , user will not be able to launch
flash bar that supports to launch apps with multi window by long
pressing back key administrator allows it again. If it is set to true ,
this mode will be allowed again.
|
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); // disable try { if (kioskModeService.allowMultiWindowMode(false)) { // multi window mode will be disabled. } else { // failure enabling policy } // enable if (kioskModeService.allowMultiWindowMode(true)) { // multi window mode will be enabled. } else { // failure disabling policy } } catch (SecurityException e) { Log.w(TAG, "SecurityException: "; + e); } |
NOTE: Since MDM 5.3, only COM (Kiosk) container administrator can call this API. For other container types, API will return false. // When you create container successfully, containerID will be returned via intent. // Use this containerID in below API. EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID); KioskMode kioskModeService = kcm.getKioskMode(); try { if (kioskModeService.allowMultiWindowMode(false)) { // multi window mode will be disabled. } else { // failure enabling policy } // enable if (kioskModeService.allowMultiWindowMode(true)) { // multi window mode will be enabled. } else { // failure disabling policy } } catch (SecurityException se) { Log.e(TAG, "Security Exception : " + se); } |
The use of this API requires the caller to add the "com.samsung.android.knox.permission.KNOX_KIOSK_MODE" permission with a protection level of signature. |
API level 6 |
MDM 4.0 |
User Scope |
API to allow or deny task manager application and recent applications window.
allow | true to allow task manager and recent applications, false to
disallow task manager and recent applications. |
---|
true
if allowing/disallowing task manager was successful, else false
.SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to block the user from using the task
manager and accessing recent applications. If set to false , the task manager
application is disabled (and force stopped if it is running), and user cannot
launch it until the administrator enables it again. In addition, if the
user long presses the Home key, the recent applications window does
not appear. If set to true , the task manager and recent applications window
are enabled. |
NOTE 1: Since MDM 5.3, only owner (User 0) administrator can call this API. For guest users, API will return NOTE 2: Since MDM 5.5, if Task Manager is not pre-loaded in the device, this API will return EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); // disable try { if (kioskModeService.allowTaskManager(false)) { // task manager and recent applications are disabled. } else { // failure enabling policy } // enable if (kioskModeService.allowTaskManager(true)) { // task manager and recent applications are enabled. } else { // failure disabling policy } } catch (SecurityException e) { Log.w(TAG, "SecurityException: "; + e); } |
NOTE 1: Since MDM 5.3, only COM (Kiosk) container administrator can call this API. For other container types,
API will return NOTE 2: Since MDM 5.5, if Task Manager is not pre-loaded in the device, this API will return // When you create container successfully, containerID will be returned via intent. // Use this containerID in below API. EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID); KioskMode kioskModeService = kcm.getKioskMode(); try { if (kioskModeService.allowTaskManager(false)) { // task manager and recent applications are disabled. } else { // failure enabling policy } // enable if (kioskModeService.allowTaskManager(true)) { // task manager and recent applications are enabled. } else { // failure disabling policy } } catch (SecurityException se) { Log.e(TAG, "Security Exception : " + se); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_KIOSK_MODE" permission with a protection level of signature. |
API level 5 |
MDM 3.0 |
User Scope |
API to clear all notifications from status bar, except those flagged with Notification.FLAG_ONGOING_EVENT or Notification.FLAG_NO_CLEAR.
true
if successful, false
if failedSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to clear notifications from
status bar, except those flagged with Notification.FLAG_ONGOING_EVENT or Notification.FLAG_NO_CLEAR. The list of notifications on
status bar will be empty when the user views it. The behavior of
this API is the same as the button "clear" on the Android's status
bar and notification panel. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); try { // clear all notifications from status bar, except those flagged with // Notification.FLAG_ONGOING_EVENT ot Notification.FLAG_NO_CLEAR kioskModeService.clearAllNotifications(); } catch (SecurityException e) { Log.e(TAG, "SecurityException: " + e); } |
// When you create container successfully, containerID will be returned via intent. // Use this containerID in below API. EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID); KioskMode kioskModeService = kcm.getKioskMode(); try { // clear all notifications from status bar, except those flagged with // Notification.FLAG_ONGOING_EVENT ot Notification.FLAG_NO_CLEAR kioskModeService.clearAllNotifications(); } catch (SecurityException se) { Log.e(TAG, "Security Exception : " + se); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_KIOSK_MODE" permission with a protection level of signature. |
API level 11 |
MDM 5.0 |
User Scope |
Deprecated in API level 33
API to disable kiosk mode.
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to disable kiosk mode. Intent
ACTION_DISABLE_KIOSK_MODE_RESULT is broadcasted as result of this API call. A
home screen that was set as the default before kiosk mode was enabled
is reset as the default home screen. All other policies
applied by the administrator while in kiosk mode are not reverted. An
administrator who attempts to disable kiosk mode receives an error if
it was enabled by another administrator. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); try { kioskModeService.disableKioskMode(); } catch (SecurityException se) { Log.e(TAG, "Security Exception : " + se); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_KIOSK_MODE" permission with a protection level of signature |
API level 5 |
MDM 3.0 |
Global Scope |
Deprecated in API level 33
API to disable Kiosk Mode with predefined Kiosk settings.
SecurityException | If caller does not have required permissions |
---|
Administrator can use this API to disable Kiosk Mode on the device. Intent
ACTION_DISABLE_KIOSK_MODE_RESULT is broadcasted as result of this API call.
The administrator can enforce additional restrictions in kiosk mode if the argument is set.
If argument is false , Specific kiosk mode will disabled.
When it is called multiple times, the previous value will be changed to new one. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); try { KioskSetting kiosk; kiosk.settingsChanges = false; kiosk.statusBarExpansion = false; kiosk.homeKey = false; kiosk.airCommand = true; kiosk.airView = true; kiosk.hardwareKey = null; kiosk.multiWindow = false; kiosk.smartClip = true; kiosk.taskManager = false; kiosk.clearAllNotifications = false; kiosk.navigationBar = false; kiosk.statusBar = true kiosk.systemBar = false; kiosk.wipeRecentTasks = false; kioskModeService.disableKioskMode(kiosk); } catch (SecurityException se) { Log.e(TAG, "Security Exception : " + se); } |
The use of this API requires the caller to add the "com.samsung.android.knox.permission.KNOX_KIOSK_MODE" permission with a protection level of signature |
API level 11 |
MDM 5.0 |
Global Scope |
Deprecated in API level 33
API to enable kiosk mode with an administrator-specified home screen.
kioskPackage | Package name of the administrator-specified home screen application |
---|
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to enable kiosk mode with
an administrator-specified home screen. Intent ACTION_ENABLE_KIOSK_MODE_RESULT
is broadcasted as result of this API call. The most recent tasks are cleared,
and uninstallation and re-installation of the home application are disabled.
The administrator can enforce additional restrictions in kiosk mode using other
kiosk mode and EDM policies. This API assumes that the administrator-specified
home screen application package is already installed and enabled
on the device. An administrator who attempts to enable kiosk mode receives
an error if it is already enabled.NOTE: User can exit the kiosk configured by the administrator by booting the device into Safe
Mode or by adding LockScreen widgets or shortcuts via Settings application.
It is recommended that administrators call |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); try { String kioskPackage = "com.abc.kiosk"; kioskModeService.enableKioskMode(kioskPackage); } catch (SecurityException se) { Log.e(TAG, "Security Exception : " + se); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_KIOSK_MODE" permission with a protection level of signature |
API level 5 |
MDM 3.0 |
Global Scope |
Deprecated in API level 33
API to enable Kiosk Mode with default Kiosk home screen and predefined Kiosk settings.
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to enable kiosk mode on the device.
The administrator can enforce additional restrictions in kiosk mode if the argument is set.
If argument is false , Specific kiosk mode will disabled.
When it is called multiple times, the previous value will be changed to new one.
|
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); try { KioskSetting kiosk; Kiosk.settingsChanges = false; Kiosk.statusBarExpansion = false; Kiosk.homeKey = false; Kiosk.airCommand = false; Kiosk.airView = false; Kiosk.hardwareKey = null; Kiosk.multiWindow = false; Kiosk.smartClip = false; Kiosk.taskManager = false; Kiosk.clearAllNotifications = false; Kiosk.navigationBar = false; Kiosk.statusBar = true Kiosk.systemBar = false; Kiosk.wipeRecentTasks = false; kioskModeService.enableKioskMode(kiosk); } catch (SecurityException se) { Log.e(TAG, "Security Exception : " + se); } |
The use of this API requires the caller to add the "com.samsung.android.knox.permission.KNOX_KIOSK_MODE" permissions with a protection level of signature |
API level 11 |
MDM 5.0 |
Global Scope |
Deprecated in API level 33
API to enable kiosk mode with the default kiosk home screen.
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to enable kiosk mode on the device.
Intent ACTION_ENABLE_KIOSK_MODE_RESULT is broadcasted as result
of this API call. When kiosk mode is enabled with no arguments, the user
is presented with a restricted version of the native Samsung home screen.
No default application shortcuts appear when the home screen is
launched for the first time, including the phone application
used to make emergency calls. The most recent tasks are cleared.
The uninstallation and reinstallation of the default kiosk application
is also disabled. The administrator can enforce additional restrictions
in kiosk mode using other kiosk mode and EDM policies. An administrator
receives an error in an attempt to enable kiosk mode if it is already
enabled.NOTE: User can exit the kiosk configured by the administrator by booting the device into Safe Mode
or by adding LockScreen widgets or shortcuts via Settings application.
It is recommended that administrators call |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); try { kioskModeService.enableKioskMode(); } catch (SecurityException se) { Log.e(TAG, "Security Exception : " + se); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_KIOSK_MODE" permission with a protection level of signature |
API level 5 |
MDM 3.0 |
Global Scope |
API to get a list of all blocked hardware keys.
null
on failure.
An administrator can use this API to check the list of all blocked hardware keys on the device. A nonhardware key is effectively allowed at runtime. To obtain the corresponding actions for each key Id, see Android Developer KeyEvent Page.. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); try { // administrator wants the list of keys blocked in system List |
// When you create container successfully, containerID will be returned via intent. // Use this containerID in below API. EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID); KioskMode kioskModeService = kcm.getKioskMode(); try { // administrator wants the list of keys blocked in system List |
API level 5 |
MDM 3.0 |
User Scope |
API to check whether edge screen functionalities are blocked on device.
EDGE_FUNCTION_ALL
if all edge screen functionalities are blocked,
else 0
will be returned.An administrator can use this API to check if edge screen
functionalities are currently blocked on device.
In case no edge screen functionality is blocked, 0
will be returned, otherwise EDGE_FUNCTION_ALL will be returned.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); int blockedEdgeScreenFunctions = 0; try { blockedEdgeScreenFunctions = kioskModeService.getBlockedEdgeScreen(); } catch (RemoteException e) { Log.e(TAG, "Remote exception : " + e); } if ((blockedEdgeScreenFunctions & KioskMode.EDGE_FUNCTION_ALL) > 0) { // Edge screen functionalities are blocked on device } |
API level 17 |
MDM 5.5 |
Global Scope |
API to get the list of hardware keys available on the device.
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to determine which keys (and the respective ID) can be
blocked with allowHardwareKeys(List, boolean) . To obtain
the corresponding actions for each Key Id, see Android Developer KeyEvent Page.
The number of elements in the list depends on the keys available on the device.
NOTE: This API will only return supported hardware keys on device (not soft keys). |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_KIOSK_MODE" permission with a protection level of signature. |
API level 5 |
MDM 3.0 |
User Scope |
Deprecated in API level 33
API to return package name of kiosk home screen.
If Kiosk Mode is enabled, this API returns the package name of the application set as the kiosk home screen. If kiosk mode is disabled, this API returns null. |
API level 5 |
MDM 3.0 |
User Scope |
API to hide the device navigation bar.
hide | true to hide, false to show |
---|
true
if successful, else false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to hide the device navigation bar. Android 3.0 added the system bar, which resides at the bottom of the screen to provide system navigation (Home, Back and so forth), for tablet devices. The system bar is also an interface for elements traditionally provided by the status bar. Since Android 4.0 a new type of system UI called the navigation bar is supported. The navigation bar is a re-tuned version of the system bar designed for handsets. The navigation bar provides navigation controls for devices that do not have hardware counterparts for navigating the system but leaves out the system bar's notification UI and setting controls. As such, a device that provides the navigation bar also has the status bar on the top. The administrator may use hideSystemBar(boolean) to hide/show all
bars (status, system, and navigation) and allowHardwareKeys(List, boolean) to disable hard keys on devices having hard keys.
|
NOTE: Since MDM 5.3, only owner (User 0) administrator can call this API. For guest users, API will return EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); try { // hide navigation UI kioskModeService.hideNavigationBar(true); // show navigation UI kioskModeService.hideNavigationBar(false); } catch (SecurityException e) { Log.e(TAG, "SecurityException: " + e); } |
NOTE: Since MDM 5.3, only COM (Kiosk) container administrator can call this API. For other container types, API will return // When you create container successfully, containerID will be returned via intent. // Use this containerID in below API. EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID); KioskMode kioskModeService = kcm.getKioskMode(); try { // hide navigation UI kioskModeService.hideNavigationBar(true); // show navigation UI kioskModeService.hideNavigationBar(false); } catch (SecurityException se) { Log.e(TAG, "Security Exception : " + se); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_KIOSK_MODE" permission with a protection level of signature. |
API level 6 |
MDM 4.0 |
User Scope |
API to hide the device status bar.
hide | true to hide, false to show |
---|
true
if successful, else false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to hide only the device status bar. The status bar resides at the top of the handset devices to deliver information such as carrier signal, time, notifications, and so forth. The administrator may use hideSystemBar(boolean) to hide/show all
bars (status, system, and navigation).
|
NOTE: Since MDM 5.3, only owner (User 0) administrator can call this API. For guest users, API will return EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); try { // hide status UI kioskModeService.hideStatusBar(true); // show status UI kioskModeService.hideStatusBar(false); } catch (SecurityException e) { Log.e(TAG, "SecurityException: " + e); } |
NOTE: Since MDM 5.3, only COM (Kiosk) container administrator can call this API. For other container types, API will return // When you create container successfully, containerID will be returned via intent. // Use this containerID in below API. EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID); KioskMode kioskModeService = kcm.getKioskMode(); try { // hide status UI kioskModeService.hideStatusBar(true); // show status UI kioskModeService.hideStatusBar(false); } catch (SecurityException se) { Log.e(TAG, "Security Exception : " + se); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_KIOSK_MODE" permission with a protection level of signature. |
API level 6 |
MDM 4.0 |
User Scope |
API to hide the device status bar, system bar, or navigation bar.
hide | true to hide, false to show |
---|
true
if successful, false
if failedSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to hide the status bar,
the system bar, or the navigation bar, depending on the
device platform. The status bar resides at the top of the handset devices to deliver information such as the carrier signal, time, notifications, and so forth. Android 3.0 added the system bar, which resides at the bottom of the screen, for tablet devices to provide system navigation (Home, Back and so forth). The system bar is also an interface for elements traditionally provided by the status bar. Since Android 4.0 a new type of system UI called the navigation bar has appeared. The navigation bar is a re-tuned version of the system bar designed for handsets. The navigation bar provides navigation controls for devices that do not have hardware counterparts for navigating the system but leaves out the system bar's notification UI and setting controls. As such, a device that provides the navigation bar also has the status bar on the top. Warning : This API hides the navigation bars required by users to navigate between screens in Android 3.0 and Android 4.0 devices. Use this API cautiously. |
NOTE: Since MDM 5.3, only owner (User 0) administrator can call this API. For guest users, API will return EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); try { // hide system ui kioskModeService.hideSystemBar(true); // show system ui kioskModeService.hideSystemBar(false); } catch (SecurityException e) { Log.e(TAG, "SecurityException: " + e); } |
NOTE: Since MDM 5.3, only COM (Kiosk) container administrator can call this API. For other container types, API will return // When you create container successfully, containerID will be returned via intent. // Use this containerID in below API. EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID); KioskMode kioskModeService = kcm.getKioskMode(); try { // hide system ui kioskModeService.hideSystemBar(true); // show system ui kioskModeService.hideSystemBar(false); } catch (SecurityException se) { Log.e(TAG, "Security Exception : " + se); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_KIOSK_MODE" permission with a protection level of signature. |
API level 5 |
MDM 3.0 |
User Scope |
API to check whether Air Command is allowed.
true
if air command is allowed, false
otherwise.An administrator can use this API to check whether Air Command is
allowed. The default value is true (allowed).
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); boolean result = true; try { // Administrator wants to check if Air Command functionality // is allowed or not at device result = kioskModeService.isAirCommandModeAllowed(); } catch (RemoteException e) { Log.e(TAG, "Remote exception : " + e); } |
API level 13 |
MDM 5.2 |
Global Scope |
API to check whether Air View is allowed.
true
if air view is allowed, false
otherwise.An administrator can use this API to check whether Air View is
allowed. The default value is true (allowed).
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); boolean result = true; try { // Administrator wants to check if Air View functionality // is allowed or not at device result = kioskModeService.isAirViewModeAllowed(); } catch (RemoteException e) { Log.e(TAG, "Remote exception : " + e); } |
API level 13 |
MDM 5.2 |
Global Scope |
API to check whether a hardware key is allowed.
hwKeyId | The Id that corresponds to the hardware key.
A nonhardware key is effectively allowed at runtime,
even if it returns false . |
---|
true
if hardware key is allowed, else false
.An administrator can use this API to check whether a particular hardware
key is allowed. The default value is true (allowed).
|
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); try { //administrator wants to check whether volume up key is allowed on device int keyCodeVolumeUp = KeyEvent.KEYCODE_VOLUME_UP; if (kioskModeService.isHardwareKeyAllowed(keyCodeVolumeUp)) { // volume key is allowed on device } else { // volume key is blocked on device } } catch (SecurityException e) { Log.w(TAG, "SecurityException: "; + e); } |
// When you create container successfully, containerID will be returned via intent. // Use this containerID in below API. EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID); KioskMode kioskModeService = kcm.getKioskMode(); try { //administrator wants to check whether volume up key is allowed on device int keyCodeVolumeUp = KeyEvent.KEYCODE_VOLUME_UP; if (kioskModeService.isHardwareKeyAllowed(keyCodeVolumeUp)) { // volume key is allowed on device } else { // volume key is blocked on device } } catch (SecurityException se) { Log.e(TAG, "Security Exception : " + se); } |
API level 5 |
MDM 3.0 |
User Scope |
Deprecated in API level 33
API to check whether kiosk mode is enabled.
true
if kiosk mode is enabled, false
if kiosk mode is disabledAPI level 5 |
MDM 3.0 |
Global Scope |
API to check if multi window mode is allowed or not allowed.
true
if multi window mode is allowed, false
if not.Administrator can check whether multi window mode are allowed on device
or not. The default value will be true .
|
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); try { // administrator wants to check if multi window mode is allowed on device or not if (kioskModeService.isMultiWindowModeAllowed()) { // multi window mode is allowed on device } else { // multi window mode is blocked on device } } catch (SecurityException e) { Log.w(TAG, "SecurityException: "; + e); } |
// When you create container successfully, containerID will be returned via intent. // Use this containerID in below API. EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID); KioskMode kioskModeService = kcm.getKioskMode(); try { // administrator wants to check if multi window mode is allowed on device or not if (kioskModeService.isMultiWindowModeAllowed()) { // multi window mode is allowed on device } else { // multi window mode is blocked on device } } catch (SecurityException se) { Log.e(TAG, "Security Exception : " + se); } |
API level 6 |
MDM 4.0 |
User Scope |
API to check whether the navigation bar is hidden
true
if navigation bar is hidden, else false
An administrator can use this API to check whether the navigation bar is hidden.
The default value is false (visible). |
API level 6 |
MDM 4.0 |
User Scope |
API to check whether the status bar is hidden.
true
if status bar is hidden, else false
An administrator can use this API to check whether the status bar
is hidden. The default value is false (visible). |
API level 6 |
MDM 4.0 |
User Scope |
API to check whether the status bar, the system bar, or the navigation bar is hidden.
true
if hidden, false
if visibleAn administrator can use this API to check whether the
the status bar, the system bar, or the navigation bar, depending on the
device platform, is hidden. The default value is false (visible). |
API level 5 |
MDM 3.0 |
User Scope |
API to check whether task manager and recent applications are allowed.
true
if task manager and recent applications are allowed, else false
.An administrator can use this API to check whether the task manager application
and the recent applications window are allowed. The default value is true (allowed).
|
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); try { // administrator wants to check if task manager is allowed on device or not if (kioskModeService.isTaskManagerAllowed()) { // task manager is allowed on device } else { // task manager is blocked on device } } catch (SecurityException e) { Log.w(TAG, "SecurityException: "; + e); } |
// When you create container successfully, containerID will be returned via intent. // Use this containerID in below API. EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID); KioskMode kioskModeService = kcm.getKioskMode(); try { // administrator wants to check if task manager is allowed on device or not if (kioskModeService.isTaskManagerAllowed()) { // task manager is allowed on device } else { // task manager is blocked on device } } catch (SecurityException se) { Log.e(TAG, "Security Exception : " + se); } |
API level 5 |
MDM 3.0 |
User Scope |
API to clear recent tasks list.
true
if successful, false
if failedSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to clear the device list of recent tasks.
The list appears empty when the user views it. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); KioskMode kioskModeService = edm.getKioskMode(); try { // clear recent tasks kioskModeService.wipeRecentTasks(); } catch (SecurityException e) { Log.e(TAG, "SecurityException: " + e); } |
// When you create container successfully, containerID will be returned via intent. // Use this containerID in below API. EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID); KioskMode kioskModeService = kcm.getKioskMode(); try { // clear recent tasks kioskModeService.wipeRecentTasks(); } catch (SecurityException se) { Log.e(TAG, "Security Exception : " + se); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_KIOSK_MODE" permission with a protection level of signature. |
API level 5 |
MDM 3.0 |
User Scope |