java.lang.Object | |
↳ | com.samsung.android.knox.custom.SettingsManager |
This class provides APIs to allow secure system settings to be changed.
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 sets the default display size and density.
| |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 27
| |||||||||||
Deprecated
in API level 27
| |||||||||||
Deprecated
in API level 36
NOTE: This API is not available since android 13. | |||||||||||
Deprecated
in API level 36
NOTE: This API is not available since android 13. | |||||||||||
This method gets the state of the Force Single View.
| |||||||||||
Deprecated
in API level 27
| |||||||||||
Deprecated
in API level 30
| |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since android 11. | |||||||||||
This method gets the current power saving mode.
| |||||||||||
Deprecated
in API level 37
| |||||||||||
This method gets the currently HIDDEN UI elements in the Settings app on the device.
| |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 27
| |||||||||||
This method turns on/off USB debugging, allowing ADB connection to the device.
| |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 27
| |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since android 14. | |||||||||||
This method sets the screen brightness level.
| |||||||||||
Deprecated
in API level 27
| |||||||||||
This method hides the Developer options menu item in the Settings menu if it is turned on
by the user by clicking multiple times on Build number in Settings menu.
| |||||||||||
Deprecated
in API level 36
NOTE: This API is not available since android 13. | |||||||||||
Deprecated
in API level 36
NOTE: This API is not available since android 13. | |||||||||||
This method turns flight mode on and off.
| |||||||||||
This method sets the Setting view as a single view.
| |||||||||||
This method sets the display size and density.
| |||||||||||
Deprecated
in API level 27
NOTE: This API is not available since android 14. | |||||||||||
This method sets the input method to the specified class.
| |||||||||||
Deprecated
in API level 27
| |||||||||||
This method turns on/off mobile data roaming.
| |||||||||||
This method turns mobile data on or off.
| |||||||||||
Deprecated
in API level 30
| |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since android 11. | |||||||||||
This method turns on/off the power saving option of the device.
| |||||||||||
Deprecated
in API level 37
| |||||||||||
This method hides or shows UI elements in the Settings app on the device.
| |||||||||||
Deprecated
in API level 37
| |||||||||||
This method sets the default language and region for the device.
| |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 37
| |||||||||||
Deprecated
in API level 27
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
This method starts the smart view.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
This method sets the default display size and density.
You might need to set different defaults to change display resolution.
NOTE: This method is supported only in tablet devices.
SUCCESS
The display size was set successfully. ERROR_NOT_SUPPORTED
Device is not a tablet.try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.clearForcedDisplaySizeDensity(); } 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_SETTING" permission. |
API level 33 |
Version 3.7 |
Global Scope |
Deprecated in API level 37
This method gets the Air Command or Air View state.
mode | Gesture mode - GESTURE_AIR_COMMAND / GESTURE_AIR_VIEW . |
---|
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); if (kcsm.getAirGestureOptionState(CustomDeviceManager.GESTURE_AIR_COMMAND)) { Log.d(TAG, "Air Command is on"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 27
This method gets the state of backup and restore.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); if (kcsm.getBackupRestoreState(CustomDeviceManager.BACKUP)) { Log.d(TAG, "Backup is on"); } |
API level 17 |
Version 2.0 |
Global Scope |
Deprecated in API level 27
This method gets the state of the Charging LED.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); if (kcsm.getChargingLEDState()) { Log.d(TAG, "Charging LED 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 type of Ethernet configuration.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); if (kcsm.getEthernetConfigurationType() == CustomDeviceManager.ETHERNET_DHCP) { Log.d(TAG, "Ethernet is using DHCP configuration"); } |
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 state of Ethernet.
true
if ethernet is on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); if (kcsm.getEthernetState()) { Log.d(TAG, "Ethernet is on"); } |
API level 17 |
Version 2.5 |
Global Scope |
This method gets the state of the Force Single View. NOTE: This method is supported only in tablet and fold devices.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); if (kcsm.getForceSingleView()) { Log.d(TAG, "Force Single View is on"); } |
API level 37 |
Version 3.10 |
Global Scope |
Deprecated in API level 27
This method gets the state of the "LTE Only" menu option in Settings.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); if (kcsm.getLTESettingState()) { Log.d(TAG, "LTE-only setting is on"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 30
This method gets the selected motion control state.
type | the control type: MOTION or PALM_MOTION . |
---|
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); if (kcsm.getMotionControlState(CustomDeviceManager.MOTION)) { Log.d(TAG, "General motion is on"); } |
API level 17 |
Version 2.0 |
Global Scope |
Deprecated
in API level 33
NOTE: This API is not available since android 11.
This method gets the state of the Google package verifier.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); if (kcsm.getPackageVerifierState()) { Log.d(TAG, "Google package verifier is on"); } |
API level 17 |
Version 2.0 |
Global Scope |
This method gets the current power saving mode.
POWER_SAVING_OFF
Power saving is turned off POWER_SAVING_ON
Power saving is turned on. CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); if (kcsm.getPowerSavingMode() == CustomDeviceManager.POWER_SAVING_ON) { Log.d(TAG, "Power saving is on"); } |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 37
This method gets the state of whether screen is turned on when power is connected to device.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); if (kcsm.getScreenWakeupOnPowerState()) { Log.d(TAG, "Screen wakeup on power is on"); } |
API level 17 |
Version 2.5 |
Global Scope |
This method gets the currently HIDDEN UI elements in the Settings app on the device.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); int elements = kcsm.getSettingsHiddenState(); Log.d("Wi-Fi setting: " + (((elements & CustomDeviceManager.SETTINGS_WIFI) != 0) ? "hidden" : "shown")); Log.d("Bluetooth setting: " + (((elements & CustomDeviceManager.SETTINGS_BLUETOOTH) != 0) ? "hidden" : "shown")); // etc. |
API level 17 |
Version 2.0 |
Global Scope |
Deprecated in API level 37
This method gets the state of the Wi-Fi connection monitor.
true
if on, false
if off.CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); if (kcsm.getWifiConnectionMonitorState()) { Log.d(TAG, "Wi-Fi connection monitor is on"); } |
API level 17 |
Global Scope |
Deprecated in API level 27
This method gets the current Wi-Fi frequency band.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); if (kcsm.getWifiFrequencyBand() == CustomDeviceManager.WIFI_FREQUENCY_BAND_AUTO) { Log.d(TAG, "Wi-Fi frequency band is Auto"); } |
API level 17 |
Version 2.5 |
Global Scope |
This method turns on/off USB debugging, allowing ADB connection to the device.
state | true to turn on ADB, false to turn it off . |
---|
SUCCESS
The ADB state was set successfully. ERROR_POLICY_RESTRICTED
USB debugging has been disabled through the Knox Standard SDK setUsbDebuggingEnabled(boolean)
method.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setAdbState(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_SETTING" permission. |
API level 17 |
Version 1.0 |
Global Scope |
Deprecated in API level 37
This method turns on/off the air gesture functionality.
mode | Gesture option to set - GESTURE_AIR_COMMAND / GESTURE_AIR_VIEW . |
---|---|
state | true to turn on, false to turn off. |
SUCCESS
Air gesture state was set successfully. ERROR_INVALID_VALUE
The mode type was invalid.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setAirGestureOptionState(CustomDeviceManager.GESTURE_AIR_COMMAND, 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_SETTING" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 27
This method turns on/off backup and/or restore.
SUCCESS
The state was set successfully. ERROR_INVALID_VALUE
The type was not valid. ERROR_POLICY_RESTRICTED
Backup has been disabled through the Knox Standard SDK setBackup(boolean)
method.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setBackupRestoreState(CustomDeviceManager.BACKUP, 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_SETTING" permission. |
API level 17 |
Version 2.0 |
Global Scope |
Deprecated
in API level 30
NOTE: This API is not available since android 14.
This method turns Bluetooth on or off.
state | true to turn Bluetooth on, false to turn it off. |
---|
SUCCESS
The Bluetooth state was set successfully. ERROR_POLICY_RESTRICTED
Bluetooth has been disabled through the Knox Standard SDK allowBluetooth(boolean)
method.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setBluetoothState(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_SETTING", "android.permission.BLUETOOTH" and, "android.permission.BLUETOOTH_ADMIN" permissions. |
API level 17 |
Version 1.0 |
Global Scope |
This method sets the screen brightness level.
level | The screen brightness level as a value between 0 and 255, or USE_AUTO for auto brightness |
---|
SUCCESS
The brightness level was set successfully. ERROR_INVALID_VALUE
The value was out of range. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setBrightness(128); } 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_SETTING" permission. |
API level 22 |
Version 2.8 |
Global Scope |
Deprecated in API level 27
This method turns on/off the LED when the screen is off and the device is charging.
state | true to turn on Charging LED, false to turn it off . |
---|
SUCCESS
The state was set successfully. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setChargingLEDState(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_SETTING" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method hides the Developer options menu item in the Settings menu if it is turned on by the user by clicking multiple times on Build number in Settings menu.
SUCCESS
The Developer Options menu item was hidden successfully.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setDeveloperOptionsHidden(); } 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_SETTING" permission. |
API level 17 |
Version 2.0 |
Global Scope |
Deprecated
in API level 36
NOTE: This API is not available since android 13.
This method sets up the Ethernet configuration to either use DHCP or Static IP.
If Static IP is configured, then the relevant parameters need to be provided
connectionType | ETHERNET_DHCP or ETHERNET_STATIC_IP . |
---|---|
staticIpAddress | IP Address for Static IP Config. |
staticNetmask | Netmask for Static IP Config. |
staticDnsAddress | DNS Address for Static IP Config. |
staticDefaultRouter | Default Router for Static IP Config. |
SUCCESS
The Ethernet configuration was set successfully. ERROR_INVALID_VALUE
Static IP configuration invalid. ERROR_NOT_SUPPORTED
Device does not support EthernetSecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setEthernetConfiguration(CustomDeviceManager.ETHERNET_DHCP, null, null, null, null); } 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_SETTING" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated
in API level 36
NOTE: This API is not available since android 13.
This will allow the device to use Ethernet networking via USB. The configuration required depends on the network settings but if you require, you can specify a static IP address which will be used. NOTE: Sometimes the ethernet module takes time to update ethernet state. It is advised to wait before getting the current state.
state | true to turn Ethernet on, false to turn it off. |
---|
SUCCESS
The Ethernet state was set successfully. ERROR_NOT_SUPPORTED
Device does not support EthernetSecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setEthernetState(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_SETTING" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method turns flight mode on and off.
SUCCESS
The flight mode state was set successfully. ERROR_POLICY_RESTRICTED
The ability to alter the flight mode state has been removed through the Knox Standard SDK allowAirplaneMode(boolean)
method. ERROR_INVALID_MODE_TYPE
The specified state is invalid. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setFlightModeState(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_SETTING" permission. |
API level 19 |
Version 2.6 |
Global Scope |
This method sets the Setting view as a single view. NOTE: This method is supported only in tablet and fold devices.
state | true to turn on force single view, false to turn it off |
---|
SUCCESS
The state was set successfully. SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setForceSingleView(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_SETTING" permission. |
API level 37 |
Version 3.10 |
Global Scope |
This method sets the display size and density.
You might need to customize the display appearance to change display resolution.
NOTE: If a value is entered as -1, it is set to default specified by #setForcedDisplaySizeDensity.
NOTE: This method is supported only in tablet devices.
width | the width of display, in pixels |
---|---|
height | the height of display, in pixels |
density | the density of display, in pixels per inch (ppi) |
SUCCESS
The display was set successfully. ERROR_NOT_SUPPORTED
Device is not a tablet.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setForcedDisplaySizeDensity(1200, 1920, -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_SETTING" permission. |
API level 34 |
Version 3.7.1 |
Global Scope |
Deprecated
in API level 27
NOTE: This API is not available since android 14.
This method turns GPS on and off.
state | true to turn GPS on, false to turn it off. |
---|
SUCCESS
The GPS state was set successfully. ERROR_POLICY_RESTRICTED
The ability to alter the GPS state has been removed through the Knox Standard SDK setGPSStateChangeAllowed(boolean)
method.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setGpsState(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_SETTING" permission. |
API level 17 |
Version 1.0 |
Global Scope |
This method sets the input method to the specified class. The input type can be added to the
list of input types if it does not already exist by setting the force parameter to true
.
inputMethodClassName | The class name of the keyboard/input type to be used. |
---|---|
force | true if the new input method should be added to the list of available input types if it doesnt already exist. false if the method should fail if an non-existent input type is specified. |
SUCCESS
The input method was set successfully. ERROR_INVALID_INPUT_TYPE
The input method was invalid or not already registered.SecurityException | The calling application does not have the required permission. |
---|
try { String inputMethodClassName = "com.example.input/.CustomKeypad"; CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setInputMethod(inputMethodClassName, 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_SETTING" permission. |
API level 17 |
Version 1.0 |
Global Scope |
Deprecated in API level 27
This method turns on/off the "LTE Only" menu option in Settings.
NOTE: The device must be rebooted for this change to take effect.
state | true to turn on LTE-only option, false to turn it off . |
---|
SUCCESS
The state was set successfully.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setLTESettingState(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_SETTING" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method turns on/off mobile data roaming.
state | true to turn on, false to turn off. |
---|
SUCCESS
The 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(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setMobileDataRoamingState(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_SETTING" permission. |
API level 17 |
Version 2.0 |
Global Scope |
This method turns mobile data on or off.
state | true to turn mobile data on, false to turn it off. |
---|
SUCCESS
The mobile data state was set successfully.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setMobileDataState(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_SETTING" permission. |
API level 17 |
Version 1.0 |
Global Scope |
Deprecated in API level 30
This method turns on/off the selected motion control.
type | the control type(s): MOTION and/or PALM_MOTION . |
---|---|
state | true to turn on, false to turn off. |
SUCCESS
The state was set successfully. ERROR_INVALID_VALUE
The type was not valid.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setMotionControlState(CustomDeviceManager.MOTION, 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_SETTING" permission. |
API level 17 |
Version 2.0 |
Global Scope |
Deprecated
in API level 33
NOTE: This API is not available since android 11.
This method turns on/off the Google package verifier.
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(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setPackageVerifierState(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_SETTING" permission. |
API level 17 |
Version 2.0 |
Global Scope |
This method turns on/off the power saving option of the device.
Ultra power saving mode can also be turned on or turned off.
When Ultra power saving mode is turned off then device previous power state will be restored.
mode | One of the following modes: POWER_SAVING_OFF POWER_SAVING_ON |
---|
SUCCESS
The power saving mode was set successfully. ERROR_INVALID_VALUE
The specified mode is invalid.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setPowerSavingMode(CustomDeviceManager.POWER_SAVING_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_SETTING" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 37
This method turns on/off whether screen is turned on when power is connected to device.
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(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setScreenWakeupOnPowerState(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_SETTING" permission. |
API level 17 |
Version 2.5 |
Global Scope |
This method hides or shows UI elements in the Settings app on the device.
state | true to hide the specified UI elements, false to show them. |
---|---|
elements | The specified elements as a mask, or SETTINGS_ALL to hide (or show) all available elements. |
SUCCESS
The state was set successfully. ERROR_INVALID_VALUE
One or more of the specified elements is invalid.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setSettingsHiddenState(true, CustomDeviceManager.SETTINGS_WIFI | CustomDeviceManager.SETTINGS_BLUETOOTH); } catch(SecurityException e) { Log.w(TAG, "SecurityException:" + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CUSTOM_SETTING" permission. |
API level 17 |
Version 2.0 |
Global Scope |
Deprecated in API level 37
This method turns on/off Stay Awake (screen always on when plugged in).
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(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setStayAwakeState(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_SETTING" permission. |
API level 17 |
Version 2.0 |
Global Scope |
This method sets the default language and region for the device.
localeLanguage | Two character lower case language code as defined in ISO 639-1. |
---|---|
localeCountry | Two character upper case country code as defined in ISO 3166-1. This can be optionally followed by a hash (#) and a four character script code as defined in ISO 15924. |
SUCCESS
The language and country was set successfully. ERROR_INVALID_LOCALE
The specified locale is invalid or null
.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setSystemLocale("zn", "CH#Hans"); } 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_SETTING" permission. |
API level 17 |
Version 1.0 |
Global Scope |
Deprecated in API level 37
This method sets the default application that is to be notified when a USB device is connected.
This prevents the user from being shown the prompt which gives permission for the application to
use the USB Device.
NOTE: This method needs to be called for each USB device that may be inserted.
usbDevice | The USB device to be assigned a default application. |
---|---|
applicationPackage | The package name of default application allowed to use the USB device. |
applicationUid | The UID of the default application allowed to use the USB device. |
SUCCESS
The default package for the USB device was set successfully. ERROR_INVALID_PACKAGE
The specified package is invalid or null
. ERROR_INVALID_UID
The specified UID is invalid. ERROR_INVALID_DEVICE
The specified USB Device is invalid.SecurityException | The calling application does not have the required permission. |
---|
try { UsbDevice usbDevice; // Assign usbDevice to correct USB device connected to phone/tablet String applicationPackage = "com.example.default.packagename"; int uid = getApplicationInfo().uid; CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setUsbDeviceDefaultPackage(usbDevice, applicationPackage, uid); } 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_SETTING" permission. |
API level 17 |
Version 1.0 |
Global Scope |
Deprecated in API level 37
This method turns on/off the Wi-Fi connection monitor.
That is whether a Wi-Fi network is checked for quality of internet connection.
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(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setWifiConnectionMonitorState(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_SETTING" permission. |
API level 17 |
Version 2.0 |
Global Scope |
Deprecated in API level 27
This method sets the Wi-Fi frequency band.
If the device does not support dual band, only WIFI_FREQUENCY_BAND_AUTO
value is valid and it is set as 2GHZ,
it is not possible to use WIFI_FREQUENCY_BAND_2GHZ
.
NOTE: The Broadcom BCM4361 chipset used in some devices does not currently support this feature.
band | One of the following bands: WIFI_FREQUENCY_BAND_AUTO WIFI_FREQUENCY_BAND_5GHZ WIFI_FREQUENCY_BAND_2GHZ |
---|
SUCCESS
The Wi-Fi frequency band was set successfully. ERROR_INVALID_VALUE
The specified band is invalid.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setWifiFrequencyBand(CustomDeviceManager.WIFI_FREQUENCY_BAND_AUTO); } 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_SETTING" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 35
This method turns Wi-Fi on or off; and optionally configures a connection to an access point.
If the AP credentials are not required, the parameters should be set to null
.
state | true to turn Wi-Fi on, false to turn it off. |
---|
SUCCESS
The Wi-Fi state was set successfully. ERROR_INVALID_STRING
The specified SSID string is null
. ERROR_POLICY_RESTRICTED
Wi-Fi has been disabled through the Knox Standard SDK allowWiFi(boolean)
method.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setWifiState(true, ssid, username, password); } 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_SETTING" permission. |
API level 17 |
Version 2.5 |
Global Scope |
Deprecated in API level 35
This method turns Wi-Fi on or off; and optionally configures a connection to an access point.
If the AP credentials are not required, the parameters should be set to null
.
state | true to turn Wi-Fi on, false to turn it off. |
---|
SUCCESS
The Wi-Fi state was set successfully. ERROR_INVALID_STRING
The specified SSID string is null
. ERROR_POLICY_RESTRICTED
Wi-Fi has been disabled through the Knox Standard SDK allowWiFi(boolean)
method.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.setWifiState(true, ssid, password); } 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_SETTING" permission. |
API level 17 |
Version 1.0 |
Global Scope |
This method starts the smart view.
SUCCESS
The smart view started successfully. ERROR_NOT_SUPPORTED
Device does not support smart view.try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); SettingsManager kcsm = cdm.getSettingsManager(); kcsm.startSmartView(); } 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_SETTING" permission. |
API level 36 |
Version 3.9 |
Global Scope |