java.lang.Object | |
↳ | com.samsung.android.knox.custom.SystemManager |
This class provides APIs to control system behavior for systems that can normally not be accessed.
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 adds or updates a number in the auto call pickup list.
| |||||||||||
Deprecated
in API level 36
NOTE: This API is not available since android 13. | |||||||||||
This method adds an application shortcut to the specified screen at the position provided.
| |||||||||||
This method adds a widget to the specified screen at the position and size provided.
| |||||||||||
This method clears the device boot or shutdown animation.
| |||||||||||
This method removes the specified homescreen page.
| |||||||||||
This method dials an emergency number without the user needing to confirm it.
| |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since android 14. | |||||||||||
This method gets the auto call pickup answer mode for the given number.
| |||||||||||
This method gets the auto call pickup delay for the given number.
| |||||||||||
This method gets the list of numbers to be answered by the Auto Call Pickup facility.
| |||||||||||
This method gets the device's auto call pickup state.
| |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since android 14. | |||||||||||
This method gets the state of the device loud speaker.
| |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since android 14. | |||||||||||
This method gets the package name of the application at the specified position in the favorites bar.
| |||||||||||
This method gets the maximum number of apps allowed in the favorite bar.
| |||||||||||
This method gets the Force Auto Shutdown value.
| |||||||||||
This method gets the Force Auto Start Up value.
| |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 35
| |||||||||||
This method gets the state of hard key intent broadcasting.
| |||||||||||
Deprecated
in API level 36
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
This method checks the given keyboard mode.
| |||||||||||
Deprecated
in API level 28
| |||||||||||
Deprecated
in API level 37
| |||||||||||
This method gets the currently hidden UI elements in the lock screen on the device.
| |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
This method gets the package name for a lock screen shortcut.
| |||||||||||
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since android 11. | |||||||||||
This method gets the custom items currently set for power dialog option.
| |||||||||||
Return the current status of the power dialog custom items.
| |||||||||||
Deprecated
in API level 37
| |||||||||||
This method gets the quick panel button visibility.
| |||||||||||
This method gets the quick panel edit state.
| |||||||||||
This method gets the quick panel items.
| |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 36
| |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
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.
| |||||||||||
This method gets the display state of Notifications and ability to expand the status bar.
| |||||||||||
This method gets the status bar text string.
| |||||||||||
This method gets the scroll width of the status bar text.
| |||||||||||
This method gets the status bar text string size.
| |||||||||||
This method gets the status bar text string style.
| |||||||||||
Deprecated
in API level 37
| |||||||||||
This method gets the state of display of toasts.
| |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 36
NOTE: This API is not available since android 13. | |||||||||||
Deprecated
in API level 37
| |||||||||||
This method gets the current USB connection type.
| |||||||||||
This method gets the USB mass storage (MTP) state when the device is connected to a PC.
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
This method gets the user inactivity timeout value in seconds.
| |||||||||||
This method gets the vibration intensity.
| |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since android 14. | |||||||||||
This method gets the state of the volume panel display.
| |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since android 11. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since android 11. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since android 11. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since android 11. | |||||||||||
This method gets the launcher's zero page state.
| |||||||||||
This method powers off the device.
| |||||||||||
This method removes a number from the auto call pickup list.
| |||||||||||
This method removes the application at the specified position in the favorite bar.
| |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 36
NOTE: This API is not available since android 13. | |||||||||||
This method removes an application shortcut from the specified screen.
| |||||||||||
This method removes a widget from the specified screen.
| |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since android 14. | |||||||||||
This method sets the volume level of the specified stream.
| |||||||||||
This method enables or disables auto call pickup.
| |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since android 14. | |||||||||||
This method configures device boot animation.
| |||||||||||
This method sets the browser homepage.
| |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since android 14. | |||||||||||
This method turns on/off the device loud speaker.
| |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since android 14. | |||||||||||
This method sets the application at the specified position in the favorite bar.
| |||||||||||
This method turns on/off the Force Auto Shutdown feature.
| |||||||||||
This method turns on/off the Force Auto Start Up feature.
| |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since android 14. | |||||||||||
This method turns on/off hard key intent broadcasting.
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
This method sets the Keyboard mode to Normal, Prediction Off or No Settings.
| |||||||||||
Deprecated
in API level 37
| |||||||||||
This method hides or shows lock screen UI elements on the device.
| |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
This method sets the package name for a lock screen shortcut.
| |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since android 11. | |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
This method sets the power dialog custom items, this will clear previously assigned items.
| |||||||||||
This method turns on/off the power dialog custom items.
| |||||||||||
Deprecated
in API level 37
| |||||||||||
This method sets the quick panel button visibility.
| |||||||||||
This method turns on/off editing of the quick panel items.
| |||||||||||
This method sets the list of items in the quick panel.
| |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
This method configures device shutdown animation.
| |||||||||||
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.
| |||||||||||
This method shows or hides the display of Notifications and ability to expand the status bar.
| |||||||||||
This method sets status bar text, including text style and size.
| |||||||||||
This method sets status bar text, including text style, size and scroll width.
| |||||||||||
This method sets the specified ringtone or notification tone to the ringtone name specified.
| |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 35
| |||||||||||
This method turns on/off the display of toasts.
| |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 37
| |||||||||||
This method sets the USB connection type.
| |||||||||||
This method turns on/off USB mass storage (MTP) when the device is connected to a PC.
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
This method sets the timeout for user inactivity to the specified number of seconds.
| |||||||||||
This method sets the vibration intensity.
| |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since android 14. | |||||||||||
This method turns on/off the volume panel display.
| |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since android 11. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since android 11. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since android 11. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since android 11. | |||||||||||
This method sets the launcher's zero page state.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
This method adds or updates a number in the auto call pickup list.
number | The phone number to be added.
delay The delay in seconds (1-30), or 0 for immediate pickup.
answerMode ANSWER_MODE_DEFAULT
or ANSWER_MODE_SPEAKER |
---|
SUCCESS
The number was set successfully. ERROR_INVALID_VALUE
The number, delay or answer mode was invalid. ERROR_NOT_SUPPORTED
Telephony is not supported on the device. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.addAutoCallNumber("+441784428600", 5, CustomDeviceManager.ANSWER_MODE_DEFAULT); } 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_SYSTEM" permission. |
API level 20 |
Version 2.7 |
Global Scope |
Deprecated
in API level 36
NOTE: This API is not available since android 13.
This method sets the list of additional apps to be made available in Ultra Power Saving 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 Ultra Power Saving Mode.
packages | The list of apps (can be empty or null ). |
---|
SUCCESS
The list of apps was set successfully. ERROR_INVALID_STRING
if list is null
or empty. ERROR_INVALID_VALUE
Invalid package name(s) in list. ERROR_NOT_SUPPORTED
If device does not support Ultra Power Saving Mode. 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method adds an application shortcut to the specified screen at the position provided.
page | The home screen to place the shortcut onto. |
---|---|
posX | The x position of the shortcut. |
posY | The y position of the shortcut. |
packageName | The package of the required shortcut. |
SUCCESS
The shortcut was successfully added to the home screen. ERROR_INVALID_VALUE
The page or position is out of range. ERROR_INVALID_PACKAGE
The package name is invalid.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.addShortcut(0, 0, 0, "com.android.chrome/com.google.apps.chrome.Main"); } 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_SYSTEM" permission. |
API level 23 |
Version 2.9 |
Global Scope |
This method adds a widget to the specified screen at the position and size provided.
page | The home screen to place the widget onto. |
---|---|
posX | The x position of the widget. |
posY | The y position of the widget. |
sizeX | The width of the widget. |
sizeY | The height of the widget. |
packageName | The package of the required widget. |
SUCCESS
The widget was successfully added to the home screen. ERROR_INVALID_VALUE
The page, position or size is out of range. ERROR_INVALID_PACKAGE
The package name is invalid.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); String widgetPackage = "com.example.widget"; String widgetProvider = ".WidgetProvider"; kcsm.addWidget(0, 0, 0, 3, 1, widgetPackage + "/" + widgetProvider); } 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_SYSTEM" permission. |
API level 23 |
Version 2.9 |
Global Scope |
This method clears the device boot or shutdown animation.
mode | ANIMATION_MODE_STARTUP or ANIMATION_MODE_SHUTDOWN |
---|
SUCCESS
Clear animation was successful. ERROR_NOT_SUPPORTED
Clear animation not supported.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.clearAnimation(CustomDeviceManager.ANIMATION_MODE_STARTUP); } 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_SYSTEM" permission. |
API level 19 |
Version 2.6 |
Global Scope |
This method removes the specified homescreen page.
page | The home screen page to be deleted. |
---|
SUCCESS
The page was successfully removed. ERROR_NOT_FOUND
There is no page at the specified position.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.deleteHomeScreenPage(1); } 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_SYSTEM" permission. |
API level 23 |
Version 2.9 |
Global Scope |
This method dials an emergency number without the user needing to confirm it.
phoneNumber | The phone number to be dialled. |
---|
SUCCESS
The number was dialled. ERROR_INVALID_STRING
The specified phone number was blank/invalid. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.dialEmergencyNumber("999"); } 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_SYSTEM" permission. |
API level 17 |
Version 2.0 |
Global Scope |
Deprecated in API level 37
This method gets the currently turned on accessibility settings on the device.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); int elements = kcsm.getAccessibilitySettingsItems(); Log.d("Answer call on home button: " + (((elements & CustomDeviceManager.ACCESSIBILITY_ANSWER_CALL_ON_HOME) != 0) ? "enabled" : "disabled")); Log.d("End call on power button: " + (((elements & CustomDeviceManager.ACCESSIBILITY_END_CALL_ON_POWER) != 0) ? "enabled" : "disabled")); // etc. |
API level 19 |
Version 2.6 |
Global Scope |
Deprecated
in API level 30
NOTE: This API is not available since android 14.
This method gets the list of namespaces blocked by the application block download functionality.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); List |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 30
NOTE: This API is not available since android 14.
This method gets the state of the application block download functionality.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getAppBlockDownloadState()) { Log.d(TAG, "Downloading of specified Apps is blocked"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 30
NOTE: This API is not available since android 14.
This method gets the application drawer button state.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if(kcsm.getAppsButtonState() == CustomDeviceManager.HIDE { Log.d(TAG, "Apps button is hidden"); } |
API level 23 |
Version 2.9 |
Global Scope |
This method gets the auto call pickup answer mode for the given number.
ANSWER_MODE_DEFAULT
ANSWER_MODE_SPEAKER
ERROR_INVALID_VALUE
The number was invalid. ERROR_NOT_FOUND
The number is not on the auto call pickup list. CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); int mode = kcsm.getAutoCallNumberAnswerMode(number); if(mode != CustomDeviceManager.NOT_FOUND) { String modeStr = (mode == CustomDeviceManager.ANSWER_MODE_DEFAULT ? "default" : "speaker"); Log.d(TAG, "Auto call pickup answer mode = " + modeStr); } |
API level 20 |
Version 2.7 |
Global Scope |
This method gets the auto call pickup delay for the given number.
ERROR_INVALID_VALUE
The number was invalid. ERROR_NOT_FOUND
The number is not on the auto call pickup list. CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); int delay = kcsm.getAutoCallNumberDelay(number); if(delay != CustomDeviceManager.NOT_FOUND) { Log.d(TAG, "Auto call pickup delay = " + delay + " sec"); } |
API level 20 |
Version 2.7 |
Global Scope |
This method gets the list of numbers to be answered by the Auto Call Pickup facility.
null
.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); List |
API level 20 |
Version 2.7 |
Global Scope |
This method gets the device's auto call pickup state.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getAutoCallPickupState() == CustomDeviceManager.ON) { Log.d(TAG, "Auto call pickup is enabled"); } |
API level 20 |
Version 2.7 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method gets the auto-rotation state of the device.
true
if on, false
if not.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getAutoRotationState()) { Log.d(TAG, "Auto Rotation is on"); } |
API level 17 |
Version 1.0 |
Global Scope |
Deprecated
in API level 30
NOTE: This API is not available since android 14.
This method gets the battery level color item which contains list of battery attribute levels and colors.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); StatusbarIconItem batteryLevelColorItem = kcsm.getBatteryLevelColourItem(); if (batteryLevelColorItem != null) { StatusbarIconItem.AttributeColour[] batteryColorsArray = batteryLevelColorItem.getAttributeColourArray(); for (StatusbarIconItem.AttributeColour item : batteryColorsArray) { Log.d(TAG, "Level:" + item.getAttribute() + "% color: 0x" + Integer.toHexString(item.getColour())); } } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 37
This method gets the currently turned off UI elements in the call screen on the device.
setCallScreenDisabledItems(boolean, int)
.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); int elements = kcsm.getCallScreenDisabledItems(); Log.d("Speaker: " + (((elements & CustomDeviceManager.CALL_SCREEN_INCALL_SPEAKER) != 0) ? "disabled" : "enabled")); Log.d("Bluetooth: " + (((elements & CustomDeviceManager.CALL_SCREEN_INCALL_BLUETOOTH) != 0) ? "disabled" : "enabled")); |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 30
NOTE: This API is not available since android 14.
This method gets the state of the charger connection sound.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getChargerConnectionSoundEnabledState()) { Log.d(TAG, "Charger connection sound is on"); } |
API level 17 |
Version 2.5 |
Global Scope |
This method gets the state of the device loud speaker.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getDeviceSpeakerEnabledState()) { Log.d(TAG, "Media sound is forced to device speaker"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 37
This method gets the display mirroring state. The default value is false
.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getDisplayMirroringState()) { Log.d(TAG, Display mirroring is on"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 30
NOTE: This API is not available since android 14.
This method gets the state of extended call info.
true
if on, false
if not.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getExtendedCallInfoState()) { Log.d(TAG, "Extended call info is on"); } |
API level 17 |
Version 2.0 |
Global Scope |
This method gets the package name of the application at the specified position in the favorites bar.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); Log.d(TAG, "Favorite application 0 is " + kcsm.getFavoriteApp(0)); |
API level 23 |
Version 2.9 |
Global Scope |
This method gets the maximum number of apps allowed in the favorite bar. The favorite bar is the bar at the bottom of the home screen that displays a list of shortcuts.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); int maxItems = kcsm.getFavoriteAppsMaxCount(); |
API level 23 |
Version 2.9 |
Global Scope |
This method gets the Force Auto Shutdown value. The default value is NORMAL
.
NORMAL
, USB_DETACHED
or IMMEDIATELY
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getForceAutoShutDownState() != CustomDeviceManager.NORMAL) { Log.d(TAG, "Force Auto Shutdown is on"); } |
API level 22 |
Version 2.8 |
Global Scope |
This method gets the Force Auto Start Up value. The default value is off.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getForceAutoStartUpState()) { Log.d(TAG, "Force Auto Startup is on"); } |
API level 19 |
Version 2.6 |
Global Scope |
Deprecated
in API level 30
NOTE: This API is not available since android 14.
This method gets the state of the ongoing notification on Status Bar when device is connected to Gear accessory.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getGearNotificationState()) { Log.d(TAG, "Gear Notification on Status Bar is on"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 35
This method gets if hard key functionality will be blocked or not
when hard key intent is reported.
NOTE: This API will return true
if hard key functionality has been
blocked using either KEY_ACTION_DOWN
or KEY_ACTION_UP
.
keyCode | KEYCODE_PTT PTT button key code. KEYCODE_EMERGENCY Emergency button key code. |
---|---|
reportType | KEY_ACTION_DOWN Key press. KEY_ACTION_UP Key release. |
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if(kcsm.getHardKeyBlockState(KPCCManager.KEYCODE_PTT, CustomDeviceManager.KEY_ACTION_DOWN) == CustomDeviceManager.ON) { Log.d(TAG, "PTT key functionality is blocked"); } |
API level 29 |
Version 3.4 |
This method gets the state of hard key intent broadcasting.
keyCode | KeyEvent.KEYCODE_VOLUME_UP KeyEvent.KEYCODE_VOLUME_DOWN KeyEvent.KEYCODE_HOME KeyEvent.KEYCODE_BACK KeyEvent.KEYCODE_MENU KeyEvent.KEYCODE_APP_SWITCH KeyEvent.KEYCODE_POWER KeyEvent.KEYCODE_HEADSETHOOK KEYCODE_PTT KEYCODE_EMERGENCY |
---|---|
reportType | KEY_ACTION_DOWN_UP Key press and release.KEY_ACTION_LONG Key long press.KEY_ACTION_DOUBLE Key double press. |
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if(kcsm.getHardKeyIntentState(KeyEvent.KEYCODE_HOME, CustomDeviceManager.KEY_ACTION_DOWN_UP) == CustomDeviceManager.ON) { Log.d(TAG, "Home key report is on when the key is pressed and released"); } |
API level 36 |
Version 3.9 |
Deprecated in API level 36
This method gets the state of hard key intent reporting.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getHardKeyIntentState()) { Log.d(TAG, "Hard key intents are turned on"); } |
API level 24 |
Version 3.0 |
Global Scope |
Deprecated in API level 35
This method gets the state of hard key intent reporting.
keyCode | KEYCODE_PTT PTT button key code. KEYCODE_EMERGENCY Emergency button key code. |
---|---|
reportType | KEY_ACTION_DOWN Key press. KEY_ACTION_UP Key release. |
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if(kcsm.getHardKeyIntentState(KPCCManager.KEYCODE_PTT, CustomDeviceManager.KEY_ACTION_DOWN) == CustomDeviceManager.ON) { Log.d(TAG, "PTT key report is on when the key is pressed"); } |
API level 29 |
Version 3.4 |
Deprecated in API level 37
This method gets the home screen mode.
HOME_SCREEN_ONLY
All application icons displayed on the home screen. HOME_SCREEN_AND_APPS
Applications displayed in the application drawer.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getHomeScreenMode() == SystemManager.HOME_SCREEN_ONLY) { Log.d(TAG, "All applications are displayed on the home screen"); } |
API level 24 |
Version 3.0 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method gets the state of the infrared transmitter.
true
if turned on, false
if not.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getInfraredState()) { Log.d(TAG, "Infrared is turned on"); } |
API level 17 |
Version 2.5 |
Global Scope |
This method checks the given keyboard mode.
true
if given mode is on, false
if not.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getKeyboardMode(CustomDeviceManager.KEYBOARD_MODE_PREDICTION_OFF)) { Log.d(TAG, "Predictive text turned off"); } |
API level 28 |
Version 3.3 |
Global Scope |
Deprecated in API level 28
This method gets the Keyboard mode.
KEYBOARD_MODE_NORMAL
Default keyboard behavior. KEYBOARD_MODE_PREDICTION_OFF
Predictive text turned off. KEYBOARD_MODE_SETTINGS_OFF
Keyboard settings turned off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getKeyboardMode() == SystemManager.KEYBOARD_MODE_PREDICTION_OFF) { Log.d(TAG, "Predictive text turned off"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 37
This method gets the state of LCD Backlight.
true
if LCD Backlight is on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getLcdBacklightState()) { Log.d(TAG, "LCD Backlight is on"); } |
API level 17 |
Version 2.5 |
Global Scope |
This method gets the currently hidden UI elements in the lock screen on the device.
setLockScreenHiddenItems(boolean, int)
.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); int elements = kcsm.getLockScreenHiddenItems(); Log.d("Clock setting: " + (((elements & CustomDeviceManager.LOCK_SCREEN_CLOCK) != 0) ? "hidden" : "shown")); Log.d("Battery info setting: " + (((elements & CustomDeviceManager.LOCK_SCREEN_BATTERY_INFO) != 0) ? "hidden" : "shown")); |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method gets the lock screen override mode.
LOCK_SCREEN_OVERRIDE_NORMAL
Normal operation, LOCK_SCREEN_OVERRIDE_SWIPE
Swipe or LOCK_SCREEN_OVERRIDE_NONE
None (no lock screen) CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getLockScreenOverrideMode() == CustomDeviceManager.LOCK_SCREEN_OVERRIDE_SWIPE) { Log.d(TAG, "Lock screen is overridden to Swipe"); } |
API level 17 |
Version 2.5 |
Global Scope |
This method gets the package name for a lock screen shortcut.
shortcut | BOTTOM_LEFT for left, BOTTOM_RIGHT for right |
---|
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); Log.d("Left shortcut: " + kcsm.getLockScreenShortcut(CustomDeviceManager.BOTTOM_LEFT)); |
API level 20 |
Version 2.7 |
Global Scope |
Deprecated in API level 33
This method returns the Mac address.
NOTE: A valid MAC address is returned only on Wi-Fi connection.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); Log.d(TAG, "MAC Address: " + kcsm.getMacAddress(); |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CUSTOM_SYSTEM" permission. |
API level 20 |
Version 2.7 |
Global Scope |
Deprecated
in API level 33
NOTE: This API is not available since android 11.
This method gets the current mobile network type.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getMobileNetworkType() == CustomDeviceManager.NETWORK_TYPE_WCDMA_PREF) { Log.d(TAG, "Mobile network type is WCDMA_PREF"); } |
API level 19 |
Version 2.6 |
Global Scope |
This method gets the custom items currently set for power dialog option.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); ArrayList |
API level 19 |
Version 2.6 |
Global Scope |
Return the current status of the power dialog custom items.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getPowerDialogCustomItemsState()) { Log.d(TAG, "Custom items on"); } |
API level 19 |
Version 2.6 |
Global Scope |
Deprecated in API level 37
This method gets the state of the power menu when the device is locked.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getPowerMenuLockedState()) { Log.d(TAG, "Power menu is on"); } |
API level 17 |
Version 2.5 |
Global Scope |
This method gets the quick panel button visibility.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if(kcsm.getQuickPanelButtons() & CustomDeviceManager.QUICK_PANEL_BUTTON_S_FINDER) { Log.d(TAG, "S Finder button is visible"); } |
API level 19 |
Version 2.6 |
Global Scope |
This method gets the quick panel edit state.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getQuickPanelEditMode() == CustomDeviceManager.ON) { Log.d(TAG, "Quick panel editing is on"); } |
API level 19 |
Version 2.6 |
Global Scope |
This method gets the quick panel items.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); List |
API level 19 |
Version 2.6 |
Global Scope |
Deprecated in API level 37
This method gets the package that will be started when the Recent hardware button is long-pressed.
null
if the package has not been set).CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); String longPressActivity = kcsm.getRecentLongPressActivity(); |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 37
This method gets operation mode of long-pressing the Recent hardware button.
RECENT_LONGPRESS_OFF
The button operates in the default manner. RECENT_LONGPRESS_HOME
The button starts the specified activity when the home application is the current application. RECENT_LONGPRESS_GLOBAL
The button starts the specified activity whenever the button is long-pressed regardless of the current application. CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getRecentLongPressMode() == CustomDeviceManager.RECENT_LONGPRESS_HOME) { Log.d(TAG, "The Recent button will start the activity only for the launcher."); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 37
This method gets the state of Screen Off on HOME long press.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getScreenOffOnHomeLongPressState()) { Log.d(TAG, "Screen Off is turned on on HOME long press"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 37
This method gets the state of Screen Off on status bar double tap.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getScreenOffOnStatusBarDoubleTapState()) { Log.d(TAG, "Screen Off is turned on on status bar double tap"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 36
This method gets the screen timeout in seconds.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); int screenTimeout = kcsm.getScreenTimeout(); |
API level 17 |
Version 1.0 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method gets the hardware sensors which are currently off.
setSensorDisabled(boolean, int)
.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); int elements = kcsm.getSensorDisabled(); Log.d("Accelerometer: " + (((elements & CustomDeviceManager.SENSOR_ACCELEROMETER) != 0) ? "disabled" : "enabled")); |
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(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getStatusBarClockState()) { Log.d(TAG, "Clock is shown on status bar"); } |
API level 19 |
Version 2.6 |
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(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getStatusBarIconsState()) { Log.d(TAG, "Icons are shown on status bar"); } |
API level 19 |
Version 2.6 |
Global Scope |
This method gets the state of the status bar. The default status bar mode is SHOW
.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getStatusBarMode() == CustomDeviceManager.HIDE) { Log.d(TAG, "Status bar is hidden"); } |
API level 19 |
Version 2.6 |
Global Scope |
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(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getStatusBarNotificationsState()) { Log.d(TAG, "Notifications are shown on status bar"); } |
API level 19 |
Version 2.6 |
Global Scope |
This method gets the status bar text string.
null
.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); String text = kcsm.getStatusBarText(); Log.d(TAG, "Status bar text is: " + text); |
API level 17 |
Version 2.5 |
Global Scope |
This method gets the scroll width of the status bar text.
USE_DEFAULT
for system default value. CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getStatusBarTextScrollWidth() > CustomDeviceManager.USE_DEFAULT) { Log.d(TAG, "Status Bar text scrolling on"); } |
API level 17 |
Version 2.5 |
Global Scope |
This method gets the status bar text string size.
USE_DEFAULT
for system default value. CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getStatusBarTextSize() != CustomDeviceManager.USE_DEFAULT) { Log.d(TAG, "Custom Status Bar text size specified"); } |
API level 17 |
Version 2.5 |
Global Scope |
This method gets the status bar text string style.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getStatusBarTextStyle() != CustomDeviceManager.USE_DEFAULT) { Log.d(TAG, "Custom Status Bar text style specified"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 37
This method gets the currently turned on system sounds on the device.
setSystemSoundsEnabledState(int, int)
.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); int elements = kcsm.getSystemSoundsEnabledState(); Log.d("DTMF when dialing: " + (((elements & CustomDeviceManager.SYSTEM_SOUNDS_DTMF_DIALING) != 0) ? "enabled" : "disabled")); |
API level 19 |
Version 2.6 |
Global Scope |
This method gets the state of display of toasts.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getToastEnabledState()) { Log.d(TAG, "Toasts are on"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method gets the value of the custom toast gravity.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getToastGravity() & Gravity.LEFT) { Log.d(TAG, "Custom toast gravity is left-oriented"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method gets the state of custom toast gravity.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getToastGravityEnabledState()) { Log.d(TAG, "Custom toast gravity is on"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method gets the value of the custom toast gravity X offset.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); int x = kcsm.getToastGravityXOffset(); |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method gets the value of the custom toast gravity Y offset.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); int y = kcsm.getToastGravityYOffset(); |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method gets the state of display of package names on toasts.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getToastShowPackageNameState()) { Log.d(TAG, "Package names on toasts are on"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method gets the state of the torch on the Volume buttons.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getTorchOnVolumeButtonsState()) { Log.d(TAG, "Torch on Volume buttons is on"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 36
NOTE: This API is not available since android 13.
This method gets the list of additional apps available in Ultra Power Saving Mode.
NOTE: Returned list contain package name along with the default activity. e.g. com.sec.chanon.HomeActivity
null
, if not set.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); List |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 37
This method gets the SIM unlock on boot state.
true
if the SIM is set to unlock on Boot, false
if not.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getUnlockSimOnBootState()) { Log.d(TAG, "SIM unlock is on"); } |
API level 17 |
Version 2.5 |
Global Scope |
This method gets the current USB connection type.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getUsbConnectionType() == CustomDeviceManager.USB_CONNECTION_TYPE_MTP_ADB) { Log.d(TAG, "USB connection type is USB_CONNECTION_TYPE_MTP_ADB"); } |
API level 20 |
Version 2.7 |
Global Scope |
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(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getUsbMassStorageState()) { Log.d(TAG, "USB mass storage (MTP) is on"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 35
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 . |
---|
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); String sourceAddress = kcsm.getUsbNetAddress(CustomDeviceManager.SOURCE_ADDRESS); |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 35
This method gets the USB Net functionality state when. By default, the USB Net state is turned off.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getUsbNetState()) { Log.d(TAG, "USB Net functionality is on"); } |
API level 17 |
Version 2.5 |
Global Scope |
This method gets the user inactivity timeout value in seconds. The default value for the user inactivity timeout is zero (0) seconds, which disables the timer.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); int userInactivityTimeout = kcsm.getUserInactivityTimeout(); |
API level 17 |
Version 1.0 |
Global Scope |
This method gets the vibration intensity.
mode | Vibration type to get:
VIBRATION_CALL or
VIBRATION_NOTIFICATION or
VIBRATION_SYSTEM . |
---|
VIBRATION_MAX_INTENSITY
.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); int val = kcsm.getVibrationIntensity(CustomDeviceManager.VIBRATION_CALL); Log.d(TAG, "Vibration intensity for Call is " + val); |
API level 19 |
Version 2.6 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method gets the state of volume button rotation.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getVolumeButtonRotationState()) { Log.d(TAG, "Volume button rotation is on"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 30
NOTE: This API is not available since android 14.
This method gets the current volume control stream.
setVolumeControlStream(int)
.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getVolumeControlStream() == CustomDeviceManager.VOLUME_CONTROL_STREAM_NOTIFICATION) { Log.d(TAG, "Volume control stream is set to Notification"); } |
API level 17 |
Version 2.5 |
Global Scope |
This method gets the state of the volume panel display.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getVolumePanelEnabledState()) { Log.d(TAG, "Volume Panel is on"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 33
NOTE: This API is not available since android 11.
This method gets the Wi-Fi auto switching delay in seconds.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); Log.d(TAG, "Wi-Fi auto switching delay is: " + kcsm.getWifiAutoSwitchDelay()); |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 33
NOTE: This API is not available since android 11.
This method get the Wi-Fi auto switching state.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getWifiAutoSwitchState()) { Log.d(TAG, "Wi-Fi auto switching is on"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 33
NOTE: This API is not available since android 11.
This method get the Wi-Fi auto switching threshold.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); Log.d(TAG, "Wi-Fi auto switching threshold is: " + kcsm.getWifiAutoSwitchThreshold()); |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 33
NOTE: This API is not available since android 11.
This method gets the device's mobile hotspot state.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.getWifiHotspotEnabledState() == CustomDeviceManager.ON) { Log.d(TAG, "Mobile hotspot is on"); } |
API level 19 |
Version 2.6 |
Global Scope |
This method gets the launcher's zero page state.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if(kcsm.getZeroPageState() == CustomDeviceManager.HIDE) { Log.d(TAG, "Zero page is hidden"); } |
API level 23 |
Version 2.9 |
Global Scope |
getFavoriteAppsMaxCount()
getFavoriteApp(int)
setFavoriteApp(String, int)
removeFavoriteApp(int)
setAppsButtonState(int)
getAppsButtonState()
setZeroPageState(int)
deleteHomeScreenPage(int)
addWidget(int, int, int, int, int, String)
removeWidget(String)
addShortcut(int, int, int, String)
removeShortcut(String)
This method powers off the device.
SUCCESS
The state was set successfully. ERROR_POLICY_RESTRICTED
Power off has been disabled through the Knox Standard SDK allowPowerOff(boolean)
method. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.powerOff(); } 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_SYSTEM" permission. |
API level 20 |
Version 2.7 |
Global Scope |
This method removes a number from the auto call pickup list.
number | The phone number to be removed. |
---|
SUCCESS
The number was set successfully. ERROR_NOT_FOUND
The number is not on the auto call pickup list. ERROR_INVALID_VALUE
The number was invalid. ERROR_NOT_SUPPORTED
Telephony is not supported on the device. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.removeAutoCallNumber("+441784428600"); } 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_SYSTEM" permission. |
API level 20 |
Version 2.7 |
Global Scope |
This method removes the application at the specified position in the favorite bar. This is the bar at the bottom of the home screen that displays a list of shortcuts.
position | The favorite application to remove from the list as a number from 0 to getFavoriteAppsMaxCount() -1. |
---|
SUCCESS
Application was set successfully as a favorite. ERROR_NOT_FOUND
There is no item at the specified position. ERROR_INVALID_VALUE
The position is out of range (the range depends on the particular specification of the device).SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.removeFavoriteApp(0); } 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_SYSTEM" permission. |
API level 23 |
Version 2.9 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method removes the lock screen from the device (meaning that simply pressing the power or home
button will restore the device).
NOTE: The lock screen is removed even if the user had previously setup a secure pattern or pass code.
SUCCESS
The lock screen was successfully removed. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.removeLockScreen(); } 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_SYSTEM" permission. |
API level 17 |
Version 1.0 |
Global Scope |
Deprecated
in API level 36
NOTE: This API is not available since android 13.
This method removes list of additional apps to be made available in Ultra Power Saving Mode.
packages | The list of apps. |
---|
SUCCESS
The list of apps was set successfully. ERROR_INVALID_STRING
if list is null
or empty. ERROR_INVALID_VALUE
Invalid package name(s) in list. ERROR_NOT_SUPPORTED
If device does not support Ultra Power Saving Mode. ERROR_NOT_FOUND
If package(s) to be removed are not 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method removes an application shortcut from the specified screen.
packageName | The package of the required shortcut. |
---|
SUCCESS
The shortcut was successfully removed from the home screen. ERROR_INVALID_PACKAGE
The package name is invalid. ERROR_NOT_FOUND
The shortcut could not be found.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.removeShortcut("com.android.chrome/com.google.apps.chrome.Main"); } 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_SYSTEM" permission. |
API level 23 |
Version 2.9 |
Global Scope |
This method removes a widget from the specified screen.
packageName | The package of the required widget. |
---|
SUCCESS
The widget was successfully removed from the home screen. ERROR_INVALID_PACKAGE
The package name is invalid. ERROR_NOT_FOUND
The widget could not be found.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); String widgetPackage = "com.example.widget"; String widgetProvider = ".WidgetProvider"; kcsm.removeWidget(widgetPackage + "/" + widgetProvider); } 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_SYSTEM" permission. |
API level 23 |
Version 2.9 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
Start a call and then make a call to sendDtmfTone specifying the tone and the duration.
The tone defines which key is being simulated (0-9, *, #) and the duration specifies how long the tone should be played for.
You should hear the tone played through the called phone for the specified length of time.
tone | The tone as a character ('0'..'9', '*' or '#') |
---|---|
duration | The duration, between 100 and 5000 milliseconds |
SUCCESS
DTMF tone was sent successfully. ERROR_INVALID_VALUE
DTMF tone or duration was invalid. ERROR_NOT_SUPPORTED
Send DTMF Tone configuration not supported.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.sendDtmfTone('*', 1000); } 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_SYSTEM" permission. |
API level 19 |
Version 2.6 |
Global Scope |
Deprecated in API level 37
This method turns on/off accessibility settings on the device.
state | ON to turn on the specified elements,
OFF to turn off them. |
---|---|
elements | Accessibility settings, as a combination of the following flags: ACCESSIBILITY_ANSWER_CALL_ON_HOME | ACCESSIBILITY_ANSWER_CALL_ON_VOICE | ACCESSIBILITY_END_CALL_ON_POWER | ACCESSIBILITY_NOTIFICATION_REMINDER | ACCESSIBILITY_SINGLE_TAP_MODE | ACCESSIBILITY_ALL (= all of the above) NOTE: ACCESSIBILITY_ANSWER_CALL_ON_HOME is not supported on devices
that do not have a physical home button. |
SUCCESS
The state was set successfully. ERROR_INVALID_VALUE
One or more of the specified elements is invalid. ERROR_INVALID_MODE_TYPE
The specified state is invalid. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setAccessibilitySettingsItems(CustomDeviceManager.ON, CustomDeviceManager.ACCESSIBILITY_ANSWER_CALL_ON_HOME | CustomDeviceManager.ACCESSIBILITY_END_CALL_ON_POWER); } 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_SYSTEM" permission. |
API level 19 |
Version 2.6 |
Global Scope |
Deprecated
in API level 30
NOTE: This API is not available since android 14.
This method set the namespaces blocked by the block download functionality.
NOTE: Passing "*" will block all the applications/services which are using the Android DownloadService.
namespaces | List of Application Package Namespaces to be blocked. |
---|
SUCCESS
The Namespaces list was set successfully. ERROR_INVALID_VALUE
The Application package name is not valid. 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 30
NOTE: This API is not available since android 14.
This method turns on/off blocking of downloads of specified applications.
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(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setAppBlockDownloadState(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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 30
NOTE: This API is not available since android 14.
This method sets the application drawer button state. SHOW
means that the icon appears in the
favorites bar, HIDE
means that the user needs to swipe up or down to view the list of applications on the favorite bar.
SUCCESS
The state was set successfully. ERROR_INVALID_MODE_TYPE
The specified state is invalid.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setAppsButtonState(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_SYSTEM" permission. |
API level 23 |
Version 2.9 |
Global Scope |
This method sets the volume level of the specified stream. If the volume is set greater than the maximum value for the stream, the volume will be set to the maximum permitted value.
audioStream | The audio stream to set the volume for: VOICE_CALL , SYSTEM_SOUNDS , RINGER , MEDIA_PLAYBACK , NOTIFICATIONS .NOTE: CustomDeviceManager.ALARM no longer works on N OS. |
---|---|
volumeLevel | The new volume level (stream dependent). |
SUCCESS
The specified volume level was set successfully. ERROR_INVALID_SOUND_TYPE
The specified audio stream is invalid. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setAudioVolume(CustomDeviceManager.SYSTEM_SOUNDS, 10); } 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_SYSTEM" permission. |
API level 17 |
Version 1.0 |
Global Scope |
This method enables or disables auto call pickup.
SUCCESS
Auto call pickup state was set successfully. ERROR_INVALID_MODE_TYPE
The specified state is invalid. ERROR_NOT_SUPPORTED
Telephony is not supported on the device. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setAutoCallPickupState(CustomDeviceManager.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_SYSTEM" permission. |
API level 20 |
Version 2.7 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method turns on/off the auto-rotate feature of the device. If used for turning off the auto-rotate feature, the rotation parameter specifies the required rotation.
state | true to turn on auto rotation, false to turn it off . |
---|---|
rotation | The rotation of the device: ROTATION_0 , ROTATION_90 , ROTATION_180 , ROTATION_270 or ROTATION_CURRENT . |
SUCCESS
The auto rotation state was set successfully. ERROR_INVALID_ROTATION_TYPE
The specified rotation type is invalid.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setAutoRotationState(false, CustomDeviceManager.ROTATION_90); } 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_SYSTEM" permission. |
API level 17 |
Version 1.0 |
Global Scope |
Deprecated
in API level 30
NOTE: This API is not available since android 14.
This method sets the color of battery icon for each specified battery percentage level.
Setting a new list of battery percentage levels will clear the previous levels.
Default battery colors will be displayed if batteryIconItem is set to null
.
NOTE: The new concept means that the battery color will revert to white when the device is charging or the battery percentage
is in the final band.
NOTE: A maximum of 5 battery percentage levels can be specified and the levels should be between 0% and 100% in increasing levels.
NOTE: The device may need to be rebooted for this change to take effect.
batteryIconItem | A Status Bar Icon Item StatusbarIconItem . NOTE: The each attribute value represents battery percentage level below which the specified color applies. |
---|
SUCCESS
Battery level color item set. ERROR_INVALID_VALUE
Invalid battery level or icon value. ERROR_INVALID_LENGTH
Invalid number of battery levels. SecurityException | The calling application does not have the required permission. |
---|
try { StatusbarIconItem.AttributeColour[] batteryColors = new StatusbarIconItem.AttributeColour[3]; StatusbarIconItem batteryIconItem = new StatusbarIconItem(StatusbarIconItem.STATUSBAR_ICON_BATTERY_BARS, batteryColors); batteryIconItem.setAttributeColour(0, 10, 0xFFCC0000); // Red color when battery level is 10% or less batteryIconItem.setAttributeColour(1, 40, 0xFFCC6600); // Orange color when battery level is 40% or less batteryIconItem.setAttributeColour(2, 99, 0xFF8BCC15); // Green color when battery level is 99% or less batteryIconItem.setAttributeColour(3, 100, 0xFFFFFFFF); // White color when battery level is 100% or less (this is enforced by the firmware regardless of the specified color) CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.setBatteryLevelColourItem(batteryIconItem) == CustomDeviceManager.SUCCESS ) { Log.d(TAG, "The custom battery level colors have been set"); } } 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method configures device boot animation.
All files must be present in the directory returned by
getFilesDir()
and file access permissions must be set for the files to be readable to others, using
setReadable(true, false).
NOTE: If device encryption is turned ON from Settings > Security, then system default animation will be shown.
NOTE: This method might not work with certain operators. It is not currently supported by USA carrier devices and USA open model devices only support the feature after R2.8 of the Knox Customization SDK, which was merged into Knox SDK.
NOTE: The screen orientation is based on the location of the home button. Therefore it orients the screen frame in landscape mode if the home button is in horizontal position of the device, and vice versa.
animationFD | Specifies file containing graphics to be displayed. |
---|---|
loopFD | Specifies file containing animation loop graphics to be displayed. |
soundFD | Specifies file containing sound to be played. |
delay | Specifies delay of boot sound in milliseconds. |
SUCCESS
Animation configuration was set successfully. ERROR_INVALID_VALUE
Delay is below 0 or over 2147483646. ERROR_NOT_SUPPORTED
Animation configuration not supported. SecurityException | The calling application does not have the required permission. |
---|
try { String animationFile = getFilesDir() + "/animation.qmg"; String loopFile = getFilesDir() + "/animation_loopsource.qmg"; String soundFile = getFilesDir() + "/sound.ogg"; File fileAnimation = new File(animationFile); fileAnimation.setReadable(true, false); ParcelFileDescriptor animationFD = ParcelFileDescriptor.open(animationFile, ParcelFileDescriptor.MODE_READ_ONLY); File fileLoop = new File(loopFile); fileLoop.setReadable(true, false); ParcelFileDescriptor loopFD = ParcelFileDescriptor.open(loopFile, ParcelFileDescriptor.MODE_READ_ONLY); File fileSound = new File(soundFile); fileSound.setReadable(true, false); ParcelFileDescriptor soundFD = ParcelFileDescriptor.open(soundFile, ParcelFileDescriptor.MODE_READ_ONLY); CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setBootingAnimation(animationFD, loopFD, soundFD, 2000); } 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_SYSTEM" permission. |
API level 19 |
Version 2.6 |
Global Scope |
This method sets the browser homepage.
url | The new homepage URL. |
---|
SUCCESS
The homepage was set successfully. ERROR_INVALID_STRING
The homepage was null
or empty. ERROR_INVALID_VALUE
The homepage was invalid. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setBrowserHomepage("http://www.samsung.com"); } 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 37
This method turns on/off UI elements in the call screen on the device. The method only turns on/off those items that are included in the elements list, all other items are left untouched.
NOTE: Not all of the flags work on all devices.
status | true to turn off the specified UI elements, false to turn on them. |
---|---|
elements | UI elements, as a combination of the following flags: CALL_SCREEN_INCALL_EXTRA_VOLUME | CALL_SCREEN_INCALL_ADD_CALL | CALL_SCREEN_INCALL_SPEAKER | CALL_SCREEN_INCALL_MUTE | CALL_SCREEN_INCALL_BLUETOOTH | CALL_SCREEN_ENDCALL_CONTACTS | CALL_SCREEN_ENDCALL_CALL_BUTTONS | CALL_SCREEN_ALL (= all of the above) |
SUCCESS
The UI elements were hidden or shown 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 callScreenElements = CustomDeviceManager.CALL_SCREEN_INCALL_SPEAKER | CustomDeviceManager.CALL_SCREEN_INCALL_BLUETOOTH; CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setCallScreenDisabledItems(true, callScreenElements); } 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 30
NOTE: This API is not available since android 14.
This method turns on/off the charger connection sound. (i.e. whether a sound will play when the charger is connected).
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(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setChargerConnectionSoundEnabledState(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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method turns on/off the device loud speaker.
Once turned on, all sound is played from device loud speaker, even though device is connected to headphone or any other external speaker.
state | true to turn on, false to turn off. |
---|
SUCCESS
The speaker state was set successfully. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setDeviceSpeakerEnabledState(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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 37
This method sets the display mirroring state. Display mirroring allows the phone's display to be replicated onto another display device.
state | true to turn on, false to turn off. |
---|
SUCCESS
The display mirroring state was set successfully. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setDisplayMirroringState(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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 30
NOTE: This API is not available since android 14.
This method turns on/off extended call info.
When turned on, the device will broadcast intents of type com.samsung.android.knox.intent.action.CALL_STATE_CHANGED.
Purpose of this is to extend the granularity of the existing available call state info from that publicly available in PhoneStateListener.
The particular transition which PhoneStateListener does not provide is between alerting and active (i.e. when an outgoing call has been answered).
NOTE: Extended call info events are only broadcast if the device is in ProKiosk mode.
state | true to turn on extended call info, false to turn it off . |
---|
SUCCESS
Extended call info state was set successfully. ERROR_NOT_SUPPORTED
Telephony is not supported on the device. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setExtendedCallInfoState(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_SYSTEM" permission. |
API level 17 |
Version 2.0 |
Global Scope |
This method sets the application at the specified position in the favorite bar. This is the bar at the bottom of the home screen that displays a list of shortcuts.
packageName | Package to be set as a favorite. |
---|---|
position | The position of the application in the list as a number from 0 to getFavoriteAppsMaxCount() -1. |
SUCCESS
Application was set successfully as a favorite. ERROR_INVALID_PACKAGE
The package name is invalid. ERROR_INVALID_VALUE
The position is out of range (the range depends on the particular specification of the device).SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setFavoriteApp("com.samsung.android.contacts/com.android.dialer.DialtactsActivity", 0); } 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_SYSTEM" permission. |
API level 23 |
Version 2.9 |
Global Scope |
This method turns on/off the Force Auto Shutdown feature. This feature determines if the device should switch off
when a condition is met. The default value is NORMAL
meaning the feature is switched off.
mode | NORMAL Switch auto shutdown off. USB_DETACHED Shut down the device when the USB lead is detached. IMMEDIATELY Shut down the device immediately. |
---|
SUCCESS
The auto shutdown state was set successfully. ERROR_INVALID_MODE_TYPE
The specified mode is invalid. ERROR_NOT_SUPPORTED
Force Auto Shutdown is not supported on the device. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setForceAutoShutdownState(CustomDeviceManager.USB_DETACHED); } 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_SYSTEM" permission. |
API level 22 |
Version 2.8 |
Global Scope |
This method turns on/off the Force Auto Start Up feature. This feature modifies the
boot loader start up behavior so that the device boots up fully when power is applied to
USB connector instead of just booting up to the battery charging UI. The device can be powered
down by removing power from USB connector and calling the powerOff()
method.
NOTE: For Android OS 12 and lower, this feature is compatible with Qualcomm & LSI chipset only. For Android OS 13 and higher, it works on all devices (with any chipset).
SUCCESS
Force Auto Start Up was set successfully. ERROR_INVALID_MODE_TYPE
The specified state is invalid. ERROR_NOT_SUPPORTED
Force Auto Start Up not supported on the device. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setForceAutoStartUpState(CustomDeviceManager.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_SYSTEM" permission. |
API level 19 |
Version 2.6 |
Global Scope |
Deprecated
in API level 30
NOTE: This API is not available since android 14.
This method turns on/off the ongoing notification on Status Bar when device is connected to Gear accessory.
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(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setGearNotificationState(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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method turns on/off hard key intent broadcasting.
state | true to broadcast intent for each keys you requests when it is pressed or released. false to turn it off. |
---|---|
keyCode | KeyEvent.KEYCODE_VOLUME_UP KeyEvent.KEYCODE_VOLUME_DOWN KeyEvent.KEYCODE_HOME KeyEvent.KEYCODE_BACK KeyEvent.KEYCODE_APP_SWITCH KeyEvent.KEYCODE_POWER KeyEvent.KEYCODE_HEADSETHOOK KEYCODE_PTT KEYCODE_EMERGENCY |
reportType | KEY_ACTION_DOWN_UP Key press and release.KEY_ACTION_LONG Key long press.KEY_ACTION_DOUBLE Key double press. |
intent | Intent you want to receive, and it could be null. If it is null, the ACTION_HARD_KEY_REPORT intent will be broadcasted with the following extras: - EXTRA_KEY_CODE that specifies the key that was pressed. - EXTRA_REPORT_TYPE_NEW that specifies the type of key press. - EXTRA_REPORT_TYPE_NEW_LONG_UP If it is an intent caused by release after long press, true or false If it isn't null, you might want to use customizable intent which re-defined by 3rd app. In the customizable intent, the above extras are still available. |
setPackage | Package name which the intent must be delivered to. If you set, system will send explicit intent, otherwise it would be implicit intent. |
deviceWide | true to broadcast to DO and PO both. false to broadcast to API caller's scope only, it is usually called as profileWide.customizable intent CAN NOT be used in deviceWide, saying again it supports only profileWide. |
SUCCESS
The state was successfully set.ERROR_FAIL
The state failed to be set.ERROR_INVALID_VALUE
One of the specified values was invalid.ERROR_NOT_SUPPORTED
Customizable intent CAN NOT be used in deviceWide.ERROR_POLICY_RESTRICTED
Home key was blocked by Knox internal policy.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setHardKeyIntentBroadcast(true, KeyEvent.KEYCODE_HOME, CustomDeviceManager.KEY_ACTION_DOWN_UP, null, null, 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_SYSTEM" permission. |
API level 36 |
Version 3.9 |
Global Scope |
Deprecated in API level 35
This method turns on/off hard key intent reporting, blocking or not hard key functionality.
If the state
is ON
, the ACTION_HARD_KEY_REPORT
intent will be broadcasted with the following extras:
- EXTRA_KEY_CODE
that specifies the key that was pressed.
- EXTRA_REPORT_TYPE
that specifies the type of key press.
The client will be able to block or keep the hard key functionality configuring block
parameter.
NOTE: The hard key functionality will be blocked if either KEY_ACTION_DOWN
or
KEY_ACTION_UP
is passed at reportType
parameter.
state | ON to turn hard key reporting on. OFF to turn hard key reporting off. |
---|---|
keyCode | KEYCODE_PTT PTT button key code. KEYCODE_EMERGENCY Emergency button key code. |
reportType | KEY_ACTION_DOWN Key press. KEY_ACTION_UP Key release. |
block | ON to block hard key functionality when state is ON . OFF to keep hard key functionality when state is ON . |
SUCCESS
The key report was set successfully. ERROR_FAIL
The key report failed to be set. ERROR_INVALID_VALUE
One of the specified values was invalid. ERROR_NOT_SUPPORTED
Key code value is not supported.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setHardKeyIntentState(CustomDeviceManager.ON, KPCCManager.KEYCODE_PTT, (CustomDeviceManager.KEY_ACTION_DOWN | CustomDeviceManager.KEY_ACTION_UP), CustomDeviceManager.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_SYSTEM" permission. |
API level 29 |
Version 3.4 |
Deprecated in API level 35
This method turns on/off hard key intent reporting.
If this state is turned 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
SUCCESS
The state was successfully set.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setHardKeyIntentState(CustomDeviceManager.OFF); } 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_SYSTEM" permission. |
API level 24 |
Version 3.0 |
Global Scope |
Deprecated in API level 37
This method sets the home screen mode to home screen only or home screen and applications.
mode | HOME_SCREEN_ONLY All application icons displayed on the home screen. HOME_SCREEN_AND_APPS Applications displayed in the application drawer. |
---|
SUCCESS
Home screen mode was set successfully. ERROR_INVALID_MODE_TYPE
The specified mode is invalid. ERROR_NOT_SUPPORTED
The launcher does not support changing mode. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setHomeScreenMode(CustomDeviceManager.HOME_SCREEN_ONLY); } 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_SYSTEM" permission. |
API level 24 |
Version 3.0 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method turns on/off the infrared (IR) transmitter.
state | true to turn on infrared, false to turn it off . |
---|
SUCCESS
The state was set successfully. ERROR_NOT_SUPPORTED
The device does not support infrared. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); int result = kcsm.setInfraredState(false); Log.d(TAG, "Infrared set: " + result); } 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method sets the Keyboard mode to Normal, Prediction Off or No Settings.
mode | KEYBOARD_MODE_NORMAL Default keyboard behavior. KEYBOARD_MODE_PREDICTION_OFF Predictive text disabled. KEYBOARD_MODE_SETTINGS_OFF Keyboard settings disabled. |
---|
SUCCESS
Keyboard 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(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setKeyboardMode(CustomDeviceManager.KEYBOARD_MODE_PREDICTION_OFF); } 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 37
This method turns LCD Backlight on and off.
state | true to turn LCD Backlight on, false to turn it off. |
---|
SUCCESS
The LCD Backlight state was set successfully. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setLcdBacklightState(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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method hides or shows lock screen UI elements on the device. Only those items that are specified in the elements list will be affected, all the other UI elements will remain in their current state.
NOTE: Not all of the flags work on all devices.
status | true to hide the specified UI elements, false to show them. |
---|---|
elements | UI elements, as a combination of the following flags: LOCK_SCREEN_NONE LOCK_SCREEN_CLOCK LOCK_SCREEN_BATTERY_INFO LOCK_SCREEN_CARRIER_INFO LOCK_SCREEN_OWNER_INFO LOCK_SCREEN_SHORTCUT LOCK_SCREEN_HELP_TEXT LOCK_SCREEN_NOTIFICATIONS LOCK_SCREEN_ALL (= all UI items) NOTE: LOCK_SCREEN_ALL also covers all the features that have been added from
N OS that do not have individual settings. Setting LOCK_SCREEN_ALL will
remove all the features from the lock screen and setting LOCK_SCREEN_NONE
will restore all the features. |
SUCCESS
The UI elements were hidden or shown 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 lockscreenElements = CustomDeviceManager.LOCK_SCREEN_CLOCK | CustomDeviceManager.LOCK_SCREEN_BATTERY_INFO); CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setLockScreenHiddenItems(true, lockscreenElements); } 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method overrides the lock screen.
This feature allows the device to turn off the lock screen without removing the saved password
or credentials.
The default mode is LOCK_SCREEN_OVERRIDE_NORMAL
.
NOTE: On device restart, lock screen will be set to normal.
mode | One of : LOCK_SCREEN_OVERRIDE_NORMAL Normal operation, LOCK_SCREEN_OVERRIDE_SWIPE Swipe or LOCK_SCREEN_OVERRIDE_NONE None (no lock screen) |
---|
SUCCESS
The lock screen override mode was set successfully. ERROR_INVALID_MODE_TYPE
The lock screen override mode was invalid. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setLockScreenOverrideMode(CustomDeviceManager.LOCK_SCREEN_OVERRIDE_SWIPE); } 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method sets the package name for a lock screen shortcut.
shortcut | BOTTOM_LEFT for left, BOTTOM_RIGHT for right |
---|---|
packageName | the package name |
SUCCESS
The UI elements were hidden or shown successfully ERROR_INVALID_VALUE
The shortcut index is invalid.
ERROR_INVALID_PACKAGE
The package name is invalid.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setLockScreenShortcut(CustomDeviceManager.BOTTOM_LEFT, "com.myco.mypackage"); } 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_SYSTEM" permission. |
API level 20 |
Version 2.7 |
Global Scope |
Deprecated
in API level 33
NOTE: This API is not available since android 11.
This method sets the mobile network type.
type | One of the following types: NETWORK_TYPE_WCDMA_PREF NETWORK_TYPE_GSM_ONLY NETWORK_TYPE_WCDMA_ONLY NETWORK_TYPE_LTE_GSM_WCDMA NETWORK_TYPE_LTE_ONLY |
---|
SUCCESS
The network type was set successfully. ERROR_INVALID_VALUE
The specified network type is invalid. ERROR_NOT_SUPPORTED
This device does not support telephony. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setMobileNetworkType(CustomDeviceManager.NETWORK_TYPE_WCDMA_PREF); } 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_SYSTEM" permission. |
API level 19 |
Version 2.6 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method turns on/off the multi-window feature on the device.
state | true to turn on the multi-window state, false to turn off the multi-window state. |
---|
SUCCESS
The multi-window state was set successfully. ERROR_POLICY_RESTRICTED
Multi window mode has been disabled through the Knox Standard SDK allowMultiWindowMode(boolean)
method. ERROR_NOT_SUPPORTED
If there is no multi-window support on the device. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setMultiWindowState(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_SYSTEM" 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(); SystemManager kcsm = cdm.getSystemManager(); 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_SYSTEM" permission. |
API level 19 |
Version 2.6 |
Global Scope |
This method turns on/off the power dialog custom items.
state | boolean 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(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.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_SYSTEM" permission. |
API level 19 |
Version 2.6 |
Global Scope |
Deprecated in API level 37
This method turns on/off the Power Menu when the device is locked.
NOTE: Since this API works by disabling power menu when power button was pressed while in the lockscreen, other APIs which disable the lockscreen will affect its function since there is no lockscreen to begin with. An example of such is when selecting the "None" option in setLockscreenOverrideMode API.
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(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setPowerMenuLockedState(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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method sets the quick panel button visibility.
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setQuickPanelButtons(CustomDeviceManager.QUICK_PANEL_BUTTON_S_FINDER); } 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_SYSTEM" permission. |
API level 19 |
Version 2.6 |
Global Scope |
This method turns on/off editing of the quick panel items.
SUCCESS
The quick panel edit state was set successfully. ERROR_INVALID_MODE_TYPE
The specified state is invalid. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setQuickPanelEditMode(CustomDeviceManager.OFF); } 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_SYSTEM" permission. |
API level 19 |
Version 2.6 |
Global Scope |
This method sets the list of items in the quick panel.
items | List of integer values to determine which items should be displayed. |
---|
SUCCESS
The quick panel list was updated successfully.SecurityException | The calling application does not have the required permission. |
---|
try { List |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CUSTOM_SYSTEM" permission. |
API level 19 |
Version 2.6 |
Global Scope |
Deprecated in API level 37
This method sets the package that should be started when the Recent hardware button is long-pressed.
packageName | The package to be started when the button is long-pressed.
If this is null , the package name will be cleared. |
---|
SUCCESS
The package was successfully set. ERROR_NOT_SUPPORTED
The device does not have the Recent button. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.setRecentLongPressActivity("com.example.myPackage") == CustomDeviceManager.SUCCESS) { Log.d(TAG, "The package has been set to run."); } } 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 37
This method sets the behavior for long-pressing the Recent hardware button. The valid options are RECENT_LONGPRESS_OFF
, RECENT_LONGPRESS_HOME
and RECENT_LONGPRESS_GLOBAL
.
RECENT_LONGPRESS_OFF
means that long-pressing the Recent button will have the default effect (displaying the menu).
RECENT_LONGPRESS_HOME
means that long-pressing the Recent button when on the home application will start the specified application, otherwise it will have the default effect (displaying the menu).
RECENT_LONGPRESS_GLOBAL
means that long-pressing the Recent button will start the specified application whatever application is currently running.
mode | RECENT_LONGPRESS_OFF , RECENT_LONGPRESS_HOME or RECENT_LONGPRESS_GLOBAL . |
---|
SUCCESS
The mode was successfully set. ERROR_INVALID_MODE_TYPE
The specified mode is invalid. ERROR_NOT_SUPPORTED
The device does not have the Recent button. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.setRecentLongPressMode(CustomDeviceManager.RECENT_LONGPRESS_GLOBAL) == CustomDeviceManager.SUCCESS) { Log.d(TAG, "The long-press will operate in all activities."); } } 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 37
This method turns on/off Screen Off on HOME long press.
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(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setScreenOffOnHomeLongPressState(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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 37
This method turns on/off Screen Off on status bar double tap.
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(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setScreenOffOnStatusBarDoubleTapState(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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 35
This method sets the screen timeout to the specified number of seconds. NOTE: The screen timeout can be set as any value from 5 to Integer.MAX_VALUE / 1000 seconds. Although,the UI updation in Settings is limited to 600 seconds only for Amoled Display and 1800 seconds only for Non-Amoled Display
timeout | The new screen timeout in seconds. |
---|
SUCCESS
The screen timeout was set successfully. ERROR_INVALID_TIMEOUT
The specified timeout is invalid. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setScreenTimeout(60); } 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_SYSTEM" permission. |
API level 17 |
Version 1.0 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method turns on/off hardware sensors on the device. The method only turn on/off those items that are included in the elements list; all other items are left untouched
status | true to turn off the specified sensors, false to turn on them. |
---|---|
elements | Hardware sensors, as a combination of the following flags: SENSOR_GYROSCOPE | SENSOR_ACCELEROMETER | SENSOR_LIGHT | SENSOR_PROXIMITY | SENSOR_MAGNETIC | SENSOR_PRESSURE | SENSOR_ALL (= all of the above) NOTE: CustomDeviceManager.SENSOR_ORIENTATION no longer works on N OS. |
SUCCESS
The sensors were turned on/off 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 sensorElements = CustomDeviceManager.SENSOR_ACCELEROMETER | CustomDeviceManager.SENSOR_GYROSCOPE); CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setSensorDisabled(true, sensorElements); } 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method configures device shutdown animation.
All files must be present in the directory returned by
getFilesDir()
and file access permissions must be set for the files to be readable to others, using
setReadable(true, false).
NOTE: This method might not work with certain operators. It is not currently supported by USA carrier devices and USA open model devices only support the feature after R2.8 of the Knox Customization SDK, which was merged into the Knox SDK.
animationFD | Specifies file containing graphics to be displayed. |
---|---|
soundFD | Specifies file containing sound to be played. |
SUCCESS
Animation configuration was set successfully. ERROR_NOT_SUPPORTED
Animation configuration not supported. SecurityException | The calling application does not have the required permission. |
---|
try { String animationFile = getFilesDir() + "/animation.qmg"; String soundFile = getFilesDir() + "/sound.ogg"; File fileAnimation = new File(animationFile); fileAnimation.setReadable(true, false); ParcelFileDescriptor animationFD = ParcelFileDescriptor.open(animationFile, ParcelFileDescriptor.MODE_READ_ONLY); File fileSound = new File(soundFile); fileSound.setReadable(true, false); ParcelFileDescriptor soundFD = ParcelFileDescriptor.open(soundFile, ParcelFileDescriptor.MODE_READ_ONLY); CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setShuttingDownAnimation(animationFD, soundFD); } 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_SYSTEM" permission. |
API level 19 |
Version 2.6 |
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(); SystemManager kcsm = cdm.getSystemManager(); kcsm.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_SYSTEM" permission. |
API level 19 |
Version 2.6 |
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(); SystemManager kcsm = cdm.getSystemManager(); kcsm.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_SYSTEM" permission. |
API level 19 |
Version 2.6 |
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 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(); SystemManager kcsm = cdm.getSystemManager(); kcsm.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_SYSTEM" permission. |
API level 19 |
Version 2.6 |
Global Scope |
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(); SystemManager kcsm = cdm.getSystemManager(); 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_SYSTEM" permission. |
API level 19 |
Version 2.6 |
Global Scope |
This method sets status bar text, including text style and size.
text | Text string to be displayed on status bar. |
---|---|
style | One of: USE_DEFAULT BOLD_TEXT_STYLE ITALIC_TEXT_STYLE BOLD_ITALIC_TEXT_STYLE |
size | Text size in dip or USE_DEFAULT for system default value. |
SUCCESS
The state was set successfully. ERROR_INVALID_STRING_TYPE
If Text Style is invalid. ERROR_INVALID_VALUE
If Text Size is invalid. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setStatusBarText("Custom text", CustomDeviceManager.BOLD_TEXT_STYLE, 14); } 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method sets status bar text, including text style, size and scroll width.
text | Text string to be displayed on status bar. |
---|---|
style | The Text Style: USE_DEFAULT BOLD_TEXT_STYLE ITALIC_TEXT_STYLE BOLD_ITALIC_TEXT_STYLE . |
size | Text size in dip or USE_DEFAULT for system default value. |
scrollwidth | Text scroll width in dip or USE_DEFAULT for system default value. NOTE: If set to Default value, scrolling is turned off. When scrolling is turned on, the text is always displayed on a single line. |
SUCCESS
The state was set successfully. ERROR_INVALID_STRING_TYPE
If Text Style is invalid. ERROR_INVALID_VALUE
If Text Size is invalid. ERROR_INVALID_LENGTH
If Scroll Width is invalid. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setStatusBarTextScrollWidth("Custom text", CustomDeviceManager.BOLD_TEXT_STYLE, 14, 120); } 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method sets the specified ringtone or notification tone to the ringtone name specified. If the
specified ringtone name does not exist, the ringtone is not changed.
NOTE: In order to specify a silent tone, the tone name should be set to an empty string (not null
).
ringToneType | The ringtone type to be set: TYPE_RINGTONE , TYPE_RINGTONE_SECOND , TYPE_NOTIFICATION , TYPE_NOTIFICATION_SECOND . |
---|---|
ringToneName | The name of the ringtone or notification sound. |
SUCCESS
The ringtone was set successfully. ERROR_INVALID_RING_TONE_TYPE
The ringtone type was not valid. ERROR_RING_TONE_NOT_FOUND
The ringtone could not be found. SecurityException | The calling application does not have the required permission. |
---|
try { String ringToneName = "ringToneName"; CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setSystemRingtone(CustomDeviceManager.RING_TONE_TYPE, ringToneName); } 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_SYSTEM" permission. |
API level 17 |
Version 1.0 |
Global Scope |
Deprecated in API level 37
This method turns on/off specific system sounds on the device. The method only turns on/off those items that are included in the elements list; all other items are left untouched
state | ON to turn on the specified system sounds, OFF to turn off them. |
---|---|
elements | System sounds, as a combination of the following flags: SYSTEM_SOUNDS_DTMF_DIALING | SYSTEM_SOUNDS_SOUND_EFFECTS | SYSTEM_SOUNDS_LOCKSCREEN | SYSTEM_SOUNDS_HAPTIC_FEEDBACK | SYSTEM_SOUNDS_SIP_KEY_FEEDBACK | SYSTEM_SOUNDS_PEN_DETACH | SYSTEM_SOUNDS_ALL (= all of the above) |
SUCCESS
The system sounds were turned on or turned off successfully. ERROR_INVALID_VALUE
One or more of the specified elements is invalid.
ERROR_INVALID_MODE_TYPE
The specified state is invalid. SecurityException | The calling application does not have the required permission. |
---|
try { int soundElements = CustomDeviceManager.SYSTEM_SOUNDS_DTMF_DIALING | CustomDeviceManager.SYSTEM_SOUNDS_SOUND_EFFECTS); CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setSystemSoundsEnabledState(CustomDeviceManager.ON, soundElements); } 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_SYSTEM" permission. |
API level 19 |
Version 2.6 |
Global Scope |
Deprecated in API level 35
This method turns off all system sounds.
SUCCESS
The state was set successfully. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setSystemSoundsSilent(); } 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_SYSTEM" permission. |
API level 17 |
Version 2.0 |
Global Scope |
This method turns on/off the display of toasts.
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(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setToastEnabledState(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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method sets all values for custom toast gravity.
NOTE: These will always be overridden if an individual Toast calls
Toast.setGravity().
gravity | The gravity, as a mask of android.view.Gravity constants. |
---|---|
x | The X offset. May be negative. |
y | The Y offset. May be negative. |
SUCCESS
The values were set successfully. ERROR_INVALID_VALUE
The gravity value is invalid. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setToastGravity (Gravity.TOP | Gravity.LEFT, 40, 40); } 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method turns on/off custom toast gravity. When turned on, toasts will appear by default according to the positioning set in SystemManager.#setToastGravity().
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(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setToastGravityEnabledState(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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method turns on/off the display of package names on toasts.
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(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setToastShowPackageNameState(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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method turns on/off the operation of the torch on the Volume buttons. When turned on, and when the screen is off, a long press of Volume Up will turn the torch on. Any press of Volume Down will turn it off again.
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(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setTorchOnVolumeButtonsState(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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 37
This method sets the SIM card to unlock on boot.
state | true to turn on, false to turn off. |
---|
SUCCESS
The state was successfully set. ERROR_NOT_SUPPORTED
The device does not have a telephony service. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.setUnlockSimOnBootState(true) == CustomDeviceManager.SUCCESS) Log.d(TAG, "The SIM is set to be unlocked at boot time."); } 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 37
This method sets the SIM card PIN.
pin | The SIM PIN code. |
---|
SUCCESS
The state was successfully set. ERROR_INVALID_VALUE
The PIN was too short or not a number. ERROR_NOT_SUPPORTED
The device does not have a telephony service. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); if (kcsm.setUnlockSimPin("1234") == CustomDeviceManager.SUCCESS) Log.d(TAG, "The SIM PIN has been set."); } 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method sets the USB connection type.
type | One of the following types: USB_CONNECTION_TYPE_DEFAULT USB_CONNECTION_TYPE_MTP USB_CONNECTION_TYPE_PTP USB_CONNECTION_TYPE_MIDI USB_CONNECTION_TYPE_CHARGING |
---|
SUCCESS
The network type was set successfully. ERROR_INVALID_MODE_TYPE
The specified connection type is invalid. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setUsbConnectionType(CustomDeviceManager.USB_CONNECTION_TYPE_DEFAULT); } 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_SYSTEM" permission. |
API level 20 |
Version 2.7 |
Global Scope |
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(); SystemManager kcsm = cdm.getSystemManager(); kcsm.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_SYSTEM" permission. |
API level 17 |
Global Scope |
Deprecated in API level 35
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_INVALID_ADDRESS
USB Net source/destination address invalid or null
. ERROR_NOT_SUPPORTED
USB Net functionality is not supported on the device. 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(); SystemManager kcsm = cdm.getSystemManager(); kcsm.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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 35
This method turns on/off the USB Net functionality. USB Net functionality
offers Ethernet connectivity over USB using pre-configured fixed IP addresses.
NOTE: Switching on USB Net functionality automatically switches off 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_INVALID_MODE_TYPE
USB Debugging mode active. ERROR_INVALID_ADDRESS
USB Net source/destination address invalid or null
. ERROR_NOT_SUPPORTED
USB Net functionality is not supported on the device. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method sets the timeout for user inactivity to the specified number of seconds.
If the user is inactive for the specified length of time, an ACTION_NO_USER_ACTIVITY system intent is
broadcast. The string value of this intent is "com.samsung.android.knox.intent.action.NO_USER_ACTIVITY".
If the user subsequently interacts with the device, a ACTION_USER_ACTIVITY system intent is broadcast.
The string value of this intent is "com.samsung.android.knox.intent.action.USER_ACTIVITY".
NOTE:
timeout | The user inactivity timeout in seconds. |
---|
SUCCESS
The user inactivity timeout was set successfully. ERROR_INVALID_TIMEOUT
The specified timeout is invalid (negative). SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setUserInactivityTimeout(60); } 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_SYSTEM" permission. |
API level 17 |
Version 1.0 |
Global Scope |
This method sets the vibration intensity.
mode | Vibration type to set:
VIBRATION_CALL or
VIBRATION_NOTIFICATION or
VIBRATION_SYSTEM . |
---|---|
value | Value range from 0 to VIBRATION_MAX_INTENSITY . |
SUCCESS
Vibration intensity was set successfully. ERROR_INVALID_MODE_TYPE
The mode or value was invalid. ERROR_INVALID_VALUE
The value was invalid. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setVibrationIntensity(CustomDeviceManager.VIBRATION_CALL, 2); } 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_SYSTEM" permission. |
API level 19 |
Version 2.6 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method turns on/off volume button rotation. When turned on, the hard volume buttons on the device will function according to the rotation of the screen (i.e. whichever button is at the top or on the right is Volume Up).
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(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setVolumeButtonRotationState(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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 30
NOTE: This API is not available since android 14.
This method sets the volume control stream.
If anything other than VOLUME_CONTROL_STREAM_DEFAULT
is specified, then the selected
stream will become the default master volume stream on the Volume Control panel, and will
be the stream adjusted by the hard volume buttons.
streamType | The stream type: VOLUME_CONTROL_STREAM_DEFAULT VOLUME_CONTROL_STREAM_SYSTEM VOLUME_CONTROL_STREAM_RING VOLUME_CONTROL_STREAM_MUSIC VOLUME_CONTROL_STREAM_NOTIFICATION |
---|
SUCCESS
The state was set successfully. ERROR_INVALID_VALUE
The stream type value is invalid. ERROR_NOT_SUPPORTED
The selected stream is not supported on this device. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setVolumeControlStream(CustomDeviceManager.VOLUME_CONTROL_STREAM_NOTIFICATION); } 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method turns on/off the volume panel display.
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(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setVolumePanelEnabledState(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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 33
NOTE: This API is not available since android 11.
This method sets the Wi-Fi delay in seconds after connection after which automatic switching can be carried out.
delay | The delay value in seconds. |
---|
SUCCESS
The delay was set successfully. ERROR_INVALID_VALUE
The delay was invalid (<0 or >600). SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setWifiAutoSwitchDelay(20); } 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 33
NOTE: This API is not available since android 11.
This method turns on/off the Wi-Fi auto switching. This feature allows the device to turn to another configured Wi-Fi network before it fully disconnects from the current network. It will only turn after a predetermined time connected to the current network; if the current signal strength drops below a preconfigured level and if there is another configured network within range.
state | true to turn on Wi-Fi automatic switching, 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(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setWifiAutoSwitchState(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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 33
NOTE: This API is not available since android 11.
This method sets the Wi-Fi rssi value that will be used to determine whether to automatically turn to another configured network.
threshold | The threshold value in dBM. |
---|
SUCCESS
The threshold was set successfully. ERROR_INVALID_VALUE
The threshold was invalid (<-200 or >0). SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setWifiAutoSwitchThreshold(-70); } 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_SYSTEM" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 33
NOTE: This API is not available since android 11.
This method turns on/off the device's mobile hotspot.
SUCCESS
The mobile hotspot state was set successfully. ERROR_INVALID_MODE_TYPE
The specified state is invalid. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setWifiHotspotEnabledState(CustomDeviceManager.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_SYSTEM" permission. |
API level 19 |
Version 2.6 |
Global Scope |
This method sets the launcher's zero page state. The zero page is the Upday or Bixby page that is reached by
swiping left from the launcher's first screen. SHOW
means that the page is visible,
HIDE
means that the page is not visible.
The default value is SHOW
.
SUCCESS
The state was set successfully. ERROR_INVALID_MODE_TYPE
The specified state is invalid.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SystemManager kcsm = cdm.getSystemManager(); kcsm.setZeroPageState(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_SYSTEM" permission. |
API level 23 |
Version 2.9 |
Global Scope |