java.lang.Object | |
↳ | com.samsung.android.knox.custom.ProKioskManager |
This class provides APIs to control device in ProKiosk mode.
The API will return ERROR_FAIL
, if the API fails for an unknown reason or because the service was not available.
NOTE: Since version 2.5, the architecture of the SDK changed.
Now, all APIs are members of different classes according to their permission type.
(APIs with permission type KNOX_CUSTOM_PROKIOSK, KNOX_CUSTOM_SETTING & KNOX_CUSTOM_SYSTEM are placed in ProKioskManager
, SettingsManager
& SystemManager
classes respectively).
Additionally, a main interface class has been created, CustomDeviceManager
, which allows public access to the above classes and provides some utility APIs.
API level 17 |
Version 2.5 |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method gets the exit UI package name or class name.
| |||||||||||
Deprecated
in API level 35
NOTE: This API is not available since android 14. | |||||||||||
This method gets the mask that determines which notification messages will be hidden from the user
when in ProKiosk mode.
| |||||||||||
This method gets the home activity package when the device is in ProKiosk Home.
| |||||||||||
This method gets the input method restriction state when the device is in ProKiosk mode.
| |||||||||||
This method gets the custom items currently set for power dialog option.
| |||||||||||
Return the current status of the power dialog custom items.
| |||||||||||
This method gets the turned on items in power dialog screen as a bit-mask.
| |||||||||||
This method gets the ProKiosk mode power off dialog option mode.
| |||||||||||
This method gets the ProKiosk mode state of the device.
| |||||||||||
This method gets the specified ProKiosk mode string.
| |||||||||||
This method gets the currently turned on UI elements in ProKiosk mode in the Settings app on the device.
| |||||||||||
This method gets the display state of the clock on the status bar.
| |||||||||||
This method gets the display state of the notification icons on the status bar.
| |||||||||||
This method gets the state of the status bar.
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 35
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 35
NOTE: This API is not available since android 14. | |||||||||||
This method gets the state of Volume Key app switching.
| |||||||||||
This method gets the list of apps to be cycled with the volume keys if Volume Key app switching
is turned on in ProKiosk mode.
| |||||||||||
This method sets the UI class to be called when exiting ProKiosk mode.
| |||||||||||
Deprecated
in API level 35
NOTE: This API is not available since android 14. | |||||||||||
This method turns on/off individual system notification messages displayed to the user in when
the device is in ProKiosk mode.
| |||||||||||
This method sets the activity that is activated when the home button is pressed while the
device is in ProKiosk mode.
| |||||||||||
This method restrict the user from changing the input method type in ProKiosk mode.
| |||||||||||
This method allows the pass code provided in the
setProKioskState(boolean, String) method to be modified. | |||||||||||
This method sets the power dialog custom items, this will clear previously assigned items.
| |||||||||||
This method turn on or turn off the power dialog custom items.
| |||||||||||
This method turns on/off individual items displayed in the power dialog screen.
| |||||||||||
When the power button is long pressed, a dialog is displayed containing the option to turn off
ProKiosk mode if ProKiosk mode is active.
| |||||||||||
Deprecated
in API level 35
NOTE: This API is not available since android 14. | |||||||||||
When the power button is long pressed, a dialog is displayed containing the option to
turn off ProKiosk mode if ProKiosk mode is active.
| |||||||||||
This method turns on/off UI elements in ProKiosk mode in the Settings app on the device.
| |||||||||||
This method shows or hides the display of the clock on the status bar.
| |||||||||||
This method shows or hides the display of the notification icons on the status bar.
| |||||||||||
This method shows or hides the status bar.
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 35
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 35
NOTE: This API is not available since android 14. | |||||||||||
This method turns on/off volume key app switching in ProKiosk mode.
| |||||||||||
This method sets (or clears) the list of apps to be cycled with the volume keys if Volume Key
app switching is turned on in ProKiosk mode.
| |||||||||||
This method turns on the ProKiosk mode functionality.
| |||||||||||
This method turns off the ProKiosk mode functionality.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
This method gets the exit UI package name or class name. The default package and class point to the built-in password entry screen.
stringType | The value to return: PACKAGE_STRING or CLASS_STRING . |
---|
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); String exitUiPackage = kcpkm.getExitUI(CustomDeviceManager.PACKAGE_STRING); String exitUiClass = kcpkm.getExitUI(CustomDeviceManager.CLASS_STRING); |
API level 17 |
Version 1.0 |
Global Scope |
Deprecated
in API level 35
NOTE: This API is not available since android 14.
This method gets the state of hard key intent reporting.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); if (kcpkm.getHardKeyIntentState()) { Log.d(TAG, "Hard key intents are turned on in ProKiosk mode"); } |
API level 17 |
Version 2.5 |
Global Scope |
This method gets the mask that determines which notification messages will be hidden from the user when in ProKiosk mode. The default value for the mask zero (all notifications displayed).
setHideNotificationMessages(int)
.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); if (kcpkm.getHideNotificationMessages() & CustomDeviceManager.NOTIFICATIONS_BATTERY_LOW != 0) { Log.d(TAG, "Battery Low Warning Notification is turned off in ProKiosk mode"); } |
API level 17 |
Version 2.0 |
Global Scope |
This method gets the home activity package when the device is in ProKiosk Home.
null
if the package has not been set).CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); String HomeActivity = kcpkm.getHomeActivity(); |
API level 17 |
Version 1.0 |
Global Scope |
This method gets the input method restriction state when the device is in ProKiosk mode. The default input method restriction state is turned off.
true
if input method switching is restricted, false
if not.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); if (kcpkm.getInputMethodRestrictionState()) { Log.d(TAG, "input Method Restriction is on"); } |
API level 17 |
Version 1.0 |
Global Scope |
This method gets the custom items currently set for power dialog option.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); ArrayList |
API level 17 |
Version 2.0 |
Global Scope |
Return the current status of the power dialog custom items.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); if (kcpkm.getPowerDialogCustomItemsState()) { Log.d(TAG, "Custom items on"); } |
API level 17 |
Version 2.0 |
Global Scope |
This method gets the turned on items in power dialog screen as a bit-mask.
setPowerDialogItems(int)
.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); int mask = kcpkm.getPowerDialogItems(); if(mask & CustomDeviceManager.POWER_DIALOG_POWEROFF != 0) { Log.d(TAG, "POWEROFF turned on in ProKiosk mode"); } |
API level 17 |
Version 2.0 |
Global Scope |
This method gets the ProKiosk mode power off dialog option mode. The default ProKiosk mode
power off dialog option mode is SHOW
.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); if (kcpkm.getPowerDialogOptionMode() == CustomDeviceManager.HIDE) { Log.d(TAG, "ProKiosk mode option in power off dialog is hidden"); } |
API level 17 |
Version 1.0 |
Global Scope |
This method gets the ProKiosk mode state of the device. The default ProKiosk mode state is false
.
true
if the device is in ProKiosk mode, false
if not.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); if (kcpkm.getProKioskState()) { Log.d(TAG, "ProKiosk mode is on"); } |
API level 17 |
Version 1.0 |
Global Scope |
This method gets the specified ProKiosk mode string.
stringType | The string to return: PRO_KIOSK_OPTION_STRING , PRO_KIOSK_ON_STRING or PRO_KIOSK_OFF_STRING . |
---|
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); String proKioskModeOnString = kcpkm.getProKioskString(CustomDeviceManager.PRO_KIOSK_ON_STRING); |
API level 17 |
Version 1.0 |
Global Scope |
This method gets the currently turned on UI elements in ProKiosk mode in the Settings app on the device.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); int elements = kcpkm.getSettingsEnabledItems(); Log.d("Wi-Fi setting: " + (((elements & CustomDeviceManager.PRO_KIOSK_SETTINGS_WIFI) != 0) ? "enabled" : "disabled")); Log.d("Bluetooth setting: " + (((elements & CustomDeviceManager.PRO_KIOSK_SETTINGS_BLUETOOTH) != 0) ? "enabled" : "disabled")); // etc. |
API level 17 |
Version 2.5 |
Global Scope |
This method gets the display state of the clock on the status bar.
The default status bar icon state is true
(show).
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); if (kcpkm.getStatusBarClockState()) { Log.d(TAG, "Clock is shown on status bar"); } |
API level 17 |
Version 1.0 |
Global Scope |
This method gets the display state of the notification icons on the status bar.
The default status bar icon state is true
(show).
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); if (kcpkm.getStatusBarIconsState()) { Log.d(TAG, "Icons are shown on status bar"); } |
API level 17 |
Version 1.0 |
Global Scope |
This method gets the state of the status bar. The default status bar mode is SHOW
.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); if (kcpkm.getStatusBarMode() == CustomDeviceManager.HIDE) { Log.d(TAG, "Status bar is hidden"); } |
API level 17 |
Version 1.0 |
Global Scope |
Deprecated in API level 35
This method gets the display state of Notifications and ability to expand the status bar.
The default status bar Notifications state is true
(show).
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcsm = cdm.getProKioskManager(); if (kcsm.getStatusBarNotificationsState()) { Log.d(TAG, "Notifications are shown on status bar"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 35
NOTE: This API is not available since android 14.
This method gets the USB mass storage (MTP) state when the device is connected to a PC.
true
if the device acts as a mass storage device, false
if not.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); if (kcpkm.getUsbMassStorageState()) { Log.d(TAG, "USB mass storage (MTP) is on"); } |
API level 17 |
Version 1.0 |
Global Scope |
Deprecated
in API level 35
NOTE: This API is not available since android 14.
This method gets the source or destination IP address for the USB Net functionality. The
function returns null
if the address has not been set.
addressType | The address to retrieve: SOURCE_ADDRESS or DESTINATION_ADDRESS . |
---|
null
if the address has not been set.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); String sourceAddress = kcpkm.getUsbNetAddress(CustomDeviceManager.SOURCE_ADDRESS); |
API level 17 |
Version 1.0 |
Global Scope |
Deprecated
in API level 35
NOTE: This API is not available since android 14.
This method gets the USB Net functionality state. By default, the USB Net state is turned off.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); if (kcpkm.getUsbNetState()) { Log.d(TAG, "USB Net functionality is on"); } |
API level 17 |
Version 1.0 |
Global Scope |
This method gets the state of Volume Key app switching.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); if (kcpkm.getVolumeKeyAppState()) { Log.d(TAG, "Volume Key app switching is on"); } |
API level 17 |
Version 2.5 |
Global Scope |
This method gets the list of apps to be cycled with the volume keys if Volume Key app switching is turned on in ProKiosk mode.
null
, if not set.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); List |
API level 17 |
Version 2.5 |
Global Scope |
This method sets the UI class to be called when exiting ProKiosk mode. The package and the class name should point at an activity that provides a method to enter a PIN/password and exit the ProKiosk mode. If the class does not exist, the built-in UI screen is used instead.
exitUIPackage | The package name of the activity to be displayed.
If this is null , the default screen will be used. |
---|---|
exitUIClass | The class name for the activity to be displayed.
If this is null , the default screen will be used. |
SUCCESS
The exit package was set successfully. ERROR_INVALID_PACKAGE
The package or class names are not valid. SecurityException | The calling application does not have the required permission. |
---|
try { String exitUIPackage = "com.example.mypackage"; String exitUIClass = "com.example.mypackage.customui"; CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); kcpkm.setExitUI(exitUIPackage, exitUIClass); } 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_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 1.0 |
Global Scope |
Deprecated
in API level 35
NOTE: This API is not available since android 14.
This method turns on/off hard key intent reporting in ProKiosk mode.
If this state is turned on, and the device is in ProKiosk mode with the screen on, then the device will broadcast the intent -
ACTION_HARD_KEY_PRESS
EXTRA_KEY_CODE
, specifying the actual key pressed.
The keys that are responded to are -
KeyEvent.KEYCODE_VOLUME_UP
KeyEvent.KEYCODE_VOLUME_DOWN
KeyEvent.KEYCODE_HOME
KeyEvent.KEYCODE_BACK
KeyEvent.KEYCODE_MENU
KeyEvent.KEYCODE_APP_SWITCH
KeyEvent.KEYCODE_POWER
state | true to turn on, false to turn off. |
---|
SUCCESS
The state was successfully set.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); kcpkm.setHardKeyIntentState(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_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method turns on/off individual system notification messages displayed to the user in when
the device is in ProKiosk mode. The mask allows individual notification messages such as low battery
warning to be shown/hidden.
NOTE: The specified notifications are hidden when the bit in the mask is set to 1.
NOTE: CustomDeviceManager.NOTIFICATIONS_SAFE_VOLUME is no longer supported for legal reasons.
mask | Specified notification elements as a mask. NOTIFICATIONS_BATTERY_LOW | NOTIFICATIONS_BATTERY_FULL | NOTIFICATIONS_STATUS_BAR | NOTIFICATIONS_NITZ_SET_TIME | NOTIFICATIONS_ALL (= all of the above) |
---|
SUCCESS
The system notification mask was set successfully. ERROR_INVALID_VALUE
One or more of the specified elements is invalid.SecurityException | The calling application does not have the required permission. |
---|
try { int mask = CustomDeviceManager.NOTIFICATIONS_BATTERY_LOW | CustomDeviceManager.NOTIFICATIONS_STATUS_BAR; CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); kcpkm.setHideNotificationMessages(mask); } 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_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 2.0 |
Global Scope |
This method sets the activity that is activated when the home button is pressed while the
device is in ProKiosk mode. When the ProKiosk mode is exited, the normal home application is
returned as the default home application.
NOTE: The device must be rebooted for this change to take full effect unless the specified application overrides the
Activity.onBackPressed() function.
NOTE: This feature should be tested before deploying. Some applications take quite a time to start and this can cause undesirable behavior when selecting the home application. To workaround this feature, a small application can be started that immediately launches the required application and then exits.
homePackage | The name of the package to be set as the home application.
If this is null , the default home application will be used. |
---|
SUCCESS
The home activity was set successfully. ERROR_INVALID_PACKAGE
The specified package was invalid. SecurityException | The calling application does not have the required permission. |
---|
try { String homePackage = "com.example.mypackage"; CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); kcpkm.setHomeActivity(homePackage); } 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_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 1.0 |
Global Scope |
This method restrict the user from changing the input method type in ProKiosk mode.
state | true to turn on restriction and prevent the user from switching input types, false to turn off the restriction. |
---|
SUCCESS
The restriction was set successfully.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); kcpkm.setInputMethodRestrictionState(true); } 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_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 1.0 |
Global Scope |
This method allows the pass code provided in the setProKioskState(boolean, String)
method to be modified.
The current pass code will need to be provided for security.
currentPassCode | The current pass code required for security. |
---|---|
passCode | The updated pass code to be used when exiting ProKiosk mode. |
SUCCESS
The pass code was successfully updated. ERROR_INVALID_PASSCODE
The pass code is invalid or null
. ERROR_PRO_KIOSK_NOT_ACTIVE
The device is not in ProKiosk mode. SecurityException | The calling application does not have the required permission. |
---|
try { String oldPassCode = "12345"; String newPassCode = "56789"; CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); kcpkm.setPassCode(oldPassCode, newPassCode); } 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_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 1.0 |
Global Scope |
This method sets the power dialog custom items, this will clear previously assigned items. The items are stored persistently.
item | List has to be less than 5 items, in case of empty or null
the current custom items will be deleted. |
---|
SUCCESS
items turned on. ERROR_INVALID_LENGTH
Invalid number of Items supplied. SecurityException | The calling application does not have the required permission. |
---|
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); Intent intent = new Intent(); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setClassName("com.company.testapp", "com.company.testapp.testactivity"); try { ArrayList |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 2.0 |
Global Scope |
This method turn on or turn off the power dialog custom items.
state | true to turn on, false to turn off. |
---|
SUCCESS
items turned on. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); if (kcpkm.setPowerDialogCustomItemsState(true) == CustomDeviceManager.SUCCESS) { Log.d(TAG, "Custom items on"); } } 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_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 2.0 |
Global Scope |
This method turns on/off individual items displayed in the power dialog screen.
NOTE: Not all of the flags work on all devices.
value | Bit-mask value as below - POWER_DIALOG_POWEROFF | POWER_DIALOG_RESTART | POWER_DIALOG_EMERGENCY | POWER_DIALOG_BUGREPORT | POWER_DIALOG_ALL | (=all of the above)POWER_DIALOG_NONE | (=none of the above) |
---|
SUCCESS
Items set successfully. ERROR_INVALID_VALUE
Invalid Bit-mask supplied. SecurityException | The calling application does not have the required permission. |
---|
try { int mask = CustomDeviceManager.POWER_DIALOG_POWEROFF | CustomDeviceManager.POWER_DIALOG_RESTART; CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); kcpkm.setPowerDialogItems(mask); } 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_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 2.0 |
Global Scope |
When the power button is long pressed, a dialog is displayed containing the option to turn off ProKiosk mode if ProKiosk mode is active. This method allows the option mode to be set to show, hide or turned off. If the mode is set to hide, the menu option is not shown until the volume up key is pressed.
SUCCESS
The mode was set successfully. ERROR_INVALID_MODE_TYPE
The specified mode is invalid. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); kcpkm.setPowerDialogOptionMode(CustomDeviceManager.HIDE); } 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_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 1.0 |
Global Scope |
Deprecated
in API level 35
NOTE: This API is not available since android 14.
This method turns on/off the ProKiosk mode functionality. ProKiosk mode generally restricts the device to a single application and restricts the functionality of the device.
NOTE: This feature should be tested before deploying. Some applications take quite a time to start and this can cause undesirable behavior when selecting the home application. As a workaround, a small application can be started that immediately launches the required application and then exits.
status | true to turn on, false to turn off. |
---|---|
passCode | If ProKiosk mode is being turned on, sets the pass code to be used to exit. If ProKiosk mode is being turned off, specifies the pass code to be validated against the pass code originally supplied. |
SUCCESS
The state was set successfully. ERROR_INVALID_PASSCODE
The specified pass code was either invalid or null
. ERROR_PRO_KIOSK_NOT_ACTIVE
The device is not in ProKiosk mode when an exit was requested. ERROR_PRO_KIOSK_ACTIVE
The device is already in ProKiosk mode when another entry was requested. ERROR_POLICY_RESTRICTED
The device is already in Kiosk mode through the Knox Standard SDK KioskMode.enableKioskMode method. SecurityException | The calling application does not have the required permission. |
---|
try { String defaultPassCode = "12345"; CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); kcpkm.setProKioskState(true, defaultPassCode); } 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_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 1.0 |
Global Scope |
When the power button is long pressed, a dialog is displayed containing the option to turn off ProKiosk mode if ProKiosk mode is active. This method allows the strings that are displayed to be modified. The string specified by stringType will be modified.
stringType | The string value to be modified: PRO_KIOSK_OPTION_STRING , PRO_KIOSK_ON_STRING or PRO_KIOSK_OFF_STRING . |
---|---|
stringValue | The new value for the string. If the value is null , the default value will be used. |
SUCCESS
The string was set successfully. ERROR_INVALID_STRING_TYPE
The specified string type is invalid. SecurityException | The calling application does not have the required permission. |
---|
try { String proKioskModeOnString = "ProKiosk mode is Active"; CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); kcpkm.setProKioskString(CustomDeviceManager.PRO_KIOSK_ON_STRING, proKioskModeOnString); } 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_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 1.0 |
Global Scope |
This method turns on/off UI elements in ProKiosk mode in the Settings app on the device.
state | true to turn on the specified UI elements, false to turn them off. |
---|---|
elements | The specified elements as a mask, or PRO_KIOSK_SETTINGS_ALL to turn on (or turn off) all available elements. |
SUCCESS
The state was set successfully. ERROR_INVALID_VALUE
One or more of the specified elements is invalid.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); kcpkm.setSettingsEnabledItems(true, CustomDeviceManager.PRO_KIOSK_SETTINGS_WIFI | CustomDeviceManager.PRO_KIOSK_SETTINGS_BLUETOOTH); } 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_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method shows or hides the display of the clock on the status bar.
state | true to show the clock, false to hide it. |
---|
SUCCESS
The clock state was set successfully.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); kcpkm.setStatusBarClockState(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_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 1.0 |
Global Scope |
This method shows or hides the display of the notification icons on the status bar.
state | true to show the notification icons, false to hide them. |
---|
SUCCESS
The notification icons state was set successfully.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); kcpkm.setStatusBarIconState(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_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 1.0 |
Global Scope |
This method shows or hides the status bar. If the status bar is hidden in normal mode, every application will use the entire display space for itself. Notifications will therefore be hidden from the user. The status bar will still be available if you drag it down. Soft Navigation bar will be hidden from the user as well and available if you drag it up.
SUCCESS
The status bar mode was set successfully. ERROR_POLICY_RESTRICTED
The status bar has been hidden through the Knox Standard SDK hideStatusBar(boolean)
method. ERROR_INVALID_MODE_TYPE
The specified mode is invalid. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); kcpkm.setStatusBar(CustomDeviceManager.HIDE); } 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_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 1.0 |
Global Scope |
Deprecated in API level 35
This method shows or hides the display of Notifications and ability to expand the status bar.
state | true to show the notifications, false to hide them. |
---|
SUCCESS
The notifications state was set successfully.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcsm = cdm.getProKioskManager(); kcsm.setStatusBarNotificationsState(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_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 35
NOTE: This API is not available since android 14.
This method turns on/off USB mass storage (MTP) when the device is connected to a PC.
state | true to turn on mass storage, false to turn it off . |
---|
SUCCESS
The mass storage state was changed. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); kcpkm.setUsbMassStorageState(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_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 1.0 |
Global Scope |
Deprecated
in API level 35
NOTE: This API is not available since android 14.
This method sets source and destination IP addresses for the USB Net functionality.
sourceAddress | The source IP address. |
---|---|
destinationAddress | The destination IP address. |
SUCCESS
The USB Net addresses were set successfully. ERROR_NOT_SUPPORTED
USB Net functionality is not supported on the device. ERROR_INVALID_ADDRESS
USB Net source/destination address invalid or null
.SecurityException | The calling application does not have the required permission. |
---|
try { String sourceAddress = "10.43.48.100"; String destinationAddress = "10.43.48.101"; CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); kcpkm.setUsbNetAddresses(sourceAddress, destinationAddress); } 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_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 1.0 |
Global Scope |
Deprecated
in API level 35
NOTE: This API is not available since android 14.
This method turns on/off the USB Net functionality. USB Net functionality
offers Ethernet connectivity over USB using pre-configured fixed IP addresses.
NOTE: Enabling USB Net functionality automatically disables the USB mass storage setting.
Also, USB Net functionality cannot be turned on if USB Debugging mode is active.
status | true to turn on USB Net, false to turn it off. |
---|
SUCCESS
The USB Net state was set successfully. ERROR_NOT_SUPPORTED
USB Net functionality is not supported on the device. ERROR_INVALID_MODE_TYPE
USB Debugging mode active. ERROR_INVALID_ADDRESS
USB Net source/destination address invalid or null
.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); kcpkm.setUsbNetState(true); } 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_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 1.0 |
Global Scope |
This method turns on/off volume key app switching in ProKiosk mode.
When turned on, the hard volume keys will cycle between the packages named in the Volume Key Apps List
with setVolumeKeyAppsList(List)
.
state | true to turn on, false to turn off. |
---|
SUCCESS
The state was set successfully.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); kcpkm.setVolumeKeyAppState(true); } 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_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method sets (or clears) the list of apps to be cycled with the volume keys if Volume Key
app switching is turned on in ProKiosk mode.
NOTE: Errors are only returned if a list item is not a syntactically valid package name. A package
which does not exist, or which has no launch activity, will be accepted in the app list, but will
simply be ignored in the volume key cycle.
NOTE: If volume key app switching is turned on, and the list is empty or null
, or contains no
existing or launchable apps, then the volume keys are effectively turned off in ProKiosk mode.
appList | The list of apps (can be empty or null ). |
---|
SUCCESS
The state was set successfully. ERROR_INVALID_VALUE
Invalid package name(s) or any item is null
in the list.SecurityException | The calling application does not have the required permission. |
---|
try { ArrayList |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CUSTOM_PROKIOSK" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method turns on the ProKiosk mode functionality. ProKiosk mode generally restricts the device to a single application and restricts the functionality of the device.
NOTE: This feature should be tested before deploying. Some applications take quite a time to start and this can cause undesirable behavior when selecting the home application. As a workaround, a small application can be started that immediately launches the required application and then exits.
passCode | The pass code to be used to exit prokiosk mode. |
---|
SUCCESS
The state was set successfully. ERROR_FAIL
The prokiosk mode failed. ERROR_NOT_SUPPORTED
The API is not supported as no prokiosk permission is there. null
. ERROR_INVALID_PACKAGE
The specified package is unavailable as home application. ERROR_PRO_KIOSK_ACTIVE
The device is already in ProKiosk mode when another entry was requested. ERROR_POLICY_RESTRICTED
The device is already in Kiosk mode through the Knox Standard SDK KioskMode.enableKioskMode method. ERROR_INVALID_PASSCODE
The specified pass code is unavailable. ERROR_DEX_MODE
The device is running in DeX mode. SecurityException | The calling application does not have the required permission. |
---|
try { String defaultPassCode = "12345"; String pkgName = "com.sec.android.app.sbrowser"; CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); kcpkm.startProKioskMode(pkgName, defaultPassCode); } 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_CUSTOM_PROKIOSK" permission. |
API level 26 |
KNOX 3.2 |
Global Scope |
This method turns off the ProKiosk mode functionality. ProKiosk mode generally restricts the device to a single application and restricts the functionality of the device.
passCode | The pass code to be used to exit prokiosk mode. |
---|
SUCCESS
The state was set successfully. ERROR_FAIL
The prokiosk mode failed. ERROR_NOT_SUPPORTED
The API is not supported as no prokiosk permission is there. null
. ERROR_PRO_KIOSK_NOT_ACTIVE
The device is not in ProKiosk mode when an exit was requested. ERROR_INVALID_PASSCODE
The specified pass code is unavailable. SecurityException | The calling application does not have the required permission. |
---|
try { String defaultPassCode = "12345"; CustomDeviceManager cdm = CustomDeviceManager.getInstance(); ProKioskManager kcpkm = cdm.getProKioskManager(); kcpkm.stopProKioskMode(defaultPassCode); } 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_CUSTOM_PROKIOSK" permission. |
API level 26 |
KNOX 3.2 |
Global Scope |