java.lang.Object | |
↳ | com.samsung.android.knox.dex.DexManager |
This class provides APIs to control the Dex mode. API functions include disabling and enabling Dex mode, making configurations, and querying the current status of Dex mode
API level 25 |
KNOX 3.1 |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | DEX_APP_ALREADY_SET_POLICY | Flag to indicate that API failed because of already set the policy. | |||||||||
int | DEX_APP_NOT_INSTALLED | Flag to Dex application API failed because of application is not installed. | |||||||||
int | DEX_APP_NOT_SET_POLICY | Flag to indicate that API failed because this application has not set a policy. | |||||||||
int | DEX_POLICY_FAIL | Flag to Dex application API failed because any exception. | |||||||||
int | DEX_POLICY_SUCCESS | Flag to Dex application API success. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Deprecated
in API level 33
| |||||||||||
This method adds an application shortcut to the Dex display at the specified position.
| |||||||||||
This method adds a new browser shortcut linking the specific url with customized icon to the DeX Display.
| |||||||||||
This method adds a new browser shortcut linking the specific url to the DeX Display.
| |||||||||||
Deprecated
in API level 36
NOTE: This API is not available since Android 16. | |||||||||||
API to allow or disallow the user changing the screen time out for Dex mode.
| |||||||||||
Deprecated
in API level 36
NOTE: This API is not available since Android 16. | |||||||||||
API to enforce or release the ethernet only mode.
| |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since Android 11. | |||||||||||
Deprecated
in API level 36
NOTE: This API is not available since Android 16. | |||||||||||
This method gets the DeX HDMIAutoEnter's state.
| |||||||||||
Deprecated
in API level 36
NOTE: This API is not available since Android 16. | |||||||||||
API to get the list of disabled application package names for Dex mode.
| |||||||||||
This method gets the Dex mode screen timeout in seconds.
| |||||||||||
Deprecated
in API level 36
NOTE: This API is not available since Android 16. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since Android 11. | |||||||||||
Deprecated
in API level 36
NOTE: This API is not available since Android 16. | |||||||||||
API to check whether Dex mode is activated.
| |||||||||||
API to check whether Dex mode is enabled.
| |||||||||||
API to check whether ethernet only mode is enforced.
| |||||||||||
API to check whether the user is allowed to change the screen time out for Dex mode.
| |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since Android 11. | |||||||||||
Deprecated
in API level 33
| |||||||||||
This method removes an application shortcut from the Dex display.
| |||||||||||
This method removes the given shortcut from the DeX Display.
| |||||||||||
API to enable or disable the Dex mode
NOTE: Starting from Android 16, the behavior of the setDexDisabled API is changed to enforce Mirroring Mode. | |||||||||||
Deprecated
in API level 36
NOTE: This API is not available since Android 16. | |||||||||||
This method sets the DeX HDMIAutoEnter that starts Dex mode automatically when HDMI cable is connected.
| |||||||||||
Deprecated
in API level 36
NOTE: This API is not available since Android 16. | |||||||||||
Deprecated
in API level 36
NOTE: This API is not available since Android 16. | |||||||||||
This method sets the Dex mode screen timeout to the specified number of seconds.
| |||||||||||
Deprecated
in API level 36
NOTE: This API is not available since Android 16. | |||||||||||
This method allows the caller to specify which of the supported wallpaper categories to set.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Flag to indicate that API failed because of already set the policy.
API level 25 |
KNOX 3.1 |
Flag to Dex application API failed because of application is not installed.
API level 25 |
KNOX 3.1 |
Flag to indicate that API failed because this application has not set a policy.
API level 25 |
KNOX 3.1 |
Flag to Dex application API failed because any exception.
API level 25 |
KNOX 3.1 |
Flag to Dex application API success.
API level 25 |
KNOX 3.1 |
Deprecated in API level 33
API to add a application package name to Dex mode disable list.
packageName | The application package name to be added to disable list for Dex mode. |
---|
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to add application package names to Dex mode disable list.
NOTE: This API works only for owner (User 0) space applications.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DexManager dexMgr = edm.getDexManager(); try { int status = dexMgr.addPackageToDisableList("com.test.app"); // status is operation 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_DEX" permission which has a protection level of signature. |
API level 25 |
KNOX 3.1 |
Global Scope |
This method adds an application shortcut to the Dex display at the specified position.
NOTE: Starting from Android 16, only landscape modes (0 deg, 180 deg) are supported. Portrait mode (90 deg, 270 deg) is not supported and may not work as expected
x | The x position of the shortcut and it starts from 0. |
---|---|
y | The y position of the shortcut and it starts from 0. |
component | The component name of the required shortcut. |
SUCCESS
The shortcut was successfully added to the Dex display. ERROR_NOT_SUPPORTED
Adding Shortcut is not supported. ERROR_INVALID_VALUE
The position is out of range. ERROR_INVALID_PACKAGE
The package name is invalid.SecurityException | The calling application does not have the required permission. |
---|
An administrator can use this API to add an application shortcut to the Dex display at the specified position. try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); DexManager dexmanager = cdm.getDexManager(); ComponentName component = new ComponentName("com.android.chrome", com.google.android.apps.chrome.Main"); dexmanager.addShortcut(0, 0, component); } 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_DEX" permission. |
API level 25 |
KNOX 3.1 |
Global Scope |
This method adds a new browser shortcut linking the specific url with customized icon to the DeX Display.
NOTE: Starting from Android 16, only landscape modes (0 deg, 180 deg) are supported. Portrait mode (90 deg, 270 deg) is not supported and may not work as expected
x | The x position of the URL shortcut. |
---|---|
y | The y position of the URL shortcut. |
title | The Title of the URL shortcut. |
url | The URL address of the URL shortcut. |
imgName | The File name of the icon image. |
component | The specific component to launch the URL shortcut. |
imgFD | The File descriptor of the icon image. |
SUCCESS
The DexURLShortcut was set successfully. ERROR_NOT_SUPPORTED
This API is not supported. ERROR_FAIL
An Unexpected internal error is occured. ERROR_NOT_FOUND
'component' is not installed or wrong value. ERROR_INVALID_VALUE
Some parameters are invalid value. ERROR_INVALID_MEDIA
The specified file descriptor is invalid or points to a file that does not exist.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); DexManager dexmanager = cdm.getDexManager(); String url = "http://www.naver.com"; String imgName = "Firefox.bmp"; ComponentName component = new ComponentName("com.android.chrome", "com.google.android.apps.chrome.Main"); ParcelFileDescriptor imgFD = ParcelFileDescriptor.open(new File(logoFile), ParcelFileDescriptor.MODE_READ_ONLY); dexmanager.addURLShortcut( 0, 0, "shortcut", url, imgName, component, imgFD); } 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_DEX" permission. |
API level 26 |
KNOX 3.2 |
Global Scope |
This method adds a new browser shortcut linking the specific url to the DeX Display.
NOTE: Starting from Android 16, only landscape modes (0 deg, 180 deg) are supported. Portrait mode (90 deg, 270 deg) is not supported and may not work as expected
x | The x position of the URL shortcut. |
---|---|
y | The y position of the URL shortcut. |
title | The Title of the URL shortcut. |
url | The URL address of the URL shortcut. |
component | The specific component to launch the URL shortcut. |
SUCCESS
The DexURLShortcut was set successfully. ERROR_NOT_SUPPORTED
This API is not supported. ERROR_FAIL
An Unexpected internal error is occured. ERROR_NOT_FOUND
'component' is not installed or wrong value. ERROR_INVALID_VALUE
Some parameters are invalid value.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); DexManager dexmanager = cdm.getDexManager(); String url = "http://www.naver.com"; ComponentName component = new ComponentName("com.android.chrome", "com.google.android.apps.chrome.Main"); dexmanager.addURLShortcut( 0, 0, "shortcut", url, component); } 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_DEX" permission. |
API level 26 |
KNOX 3.2 |
Global Scope |
Deprecated
in API level 36
NOTE: This API is not available since Android 16.
This method allows/disallows the DeX AutoOpenLastApp that opens the last app you were using automatically when you start or exit Samsung Dex.
state | ALLOW This is a ALLOW for Dex AutoOpenLastApp. DISALLOW This is a DISALLOW which turns off and blocking for Dex AutoOpenLastApp. |
---|
SUCCESS
The allowAutoOpenLastApp was set successfully. ERROR_INVALID_VALUE
The passing integer parameter is invalid. ERROR_NOT_SUPPORTED
This API is not supported.SecurityException | The calling application does not have the required permission. |
---|
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); DexManager dexmanager = cdm.getDexManager(); int state = CustomDeviceManager.ALLOW; dexmanager.allowAutoOpenLastApp(state); |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CUSTOM_DEX" permission. |
API level 28 |
KNOX 3.3 |
Global Scope |
API to allow or disallow the user changing the screen time out for Dex mode.
allow | true to allow, false to disallow |
---|
true
if operation is successful, else false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to allow or disallow the user changing the screen time out for Dex mode.
If not allowed, the user cannot change the screen time out.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DexManager dexMgr = edm.getDexManager(); // disable try { if (dexMgr.allowScreenTimeoutChange(false)) { // Screen time out change is not allowed. } else { // failure restricting Dex mode. } // enable if (dexMgr.allowScreenTimeoutChange(true)) { // Screen time out change is allowed. } else { // failure removing restriction of Dex mode. } } 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_DEX" permission which has a protection level of signature. |
API level 25 |
KNOX 3.1 |
Global Scope |
Deprecated
in API level 36
NOTE: This API is not available since Android 16.
This method clears the logo that is displayed when the phone is starting Dex and restores the default logo.
SUCCESS
The Dex loading logo was successfully restored. ERROR_NOT_SUPPORTED
This API is not supported.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); DexManager dexmanager = cdm.getDexManager(); dexmanager.clearLoadingLogo(); } 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_DEX" permission. |
API level 25 |
KNOX 3.1 |
Global Scope |
API to enforce or release the ethernet only mode.
enforced | true to enforce, false to release. |
---|
true
if operation is successful, else false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to enable ethernet only mode without user interaction.
Cellular data / wifi / tetherings(wifi, bluetooth, usb) are restricted in Dex mode.
NOTE: setCellularData(), setWifiState(), setWifiTethering(), setUsbTethering(), setBluetoothTethering() will return false when device is in Dex mode under ethernet only mode
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DexManager dexMgr = edm.getDexManager(); // enforce try { if (dexMgr.enforceEthernetOnly(true)) { // Ethernet only mode is enabled. } else { // failure restricting ethernet only mode. } // release if (dexMgr.enforceEthernetOnly(false)) { // Ethernet only mode is disabled. } else { // failure removing restriction of ethernet only mode. } } 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_DEX" permission which has a protection level of signature. |
API level 25 |
KNOX 3.1 |
Global Scope |
Deprecated
in API level 33
NOTE: This API is not available since Android 11.
API to set use virtual MAC address for Dex mode.
true
if operation is successful, else false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to use the virtual MAC address for Dex mode.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DexManager dexMgr = edm.getDexManager(); // disable try { if (dexMgr.enforceVirtualMacAddress(false)) { // Use phone MAC address } if (dexMgr.enforceVirtualMacAddress(true)) { // Use virtual MAC addres } } 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_DEX" permission which has a protection level of signature. |
API level 25 |
KNOX 3.1 |
Global Scope |
Deprecated
in API level 36
NOTE: This API is not available since Android 16.
This method gets a package whitelist of foreground mode from dex.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); DexManager dexmanager = cdm.getDexManager(); List |
API level 26 |
KNOX 3.2 |
Global Scope |
This method gets the DeX HDMIAutoEnter's state.
NOTE : Starting from Android 16, HDMI_AUTO_ENTER_RESTORE is deprecated and removed.
HDMI_AUTO_ENTER_ON
This is a ON of Dex HDMIAutoEnterState. HDMI_AUTO_ENTER_RESET
This is a initial value of HDMIAutoEnter.SecurityException | The calling application does not have the required permission. |
---|
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); DexManager dexmanager = cdm.getDexManager(); dexmanager.getHDMIAutoEnterState(); |
API level 28 |
KNOX 3.3 |
Global Scope |
Deprecated
in API level 36
NOTE: This API is not available since Android 16.
This method gets the DeX alignment mode.
ERROR_NOT_SUPPORTED
Adding Shortcut is not supported. SecurityException | The calling application does not have the required permission. |
---|
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); DexManager dexmanager = cdm.getDexManager(); int alignment = dexmanager.getHomeAlignment(); |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CUSTOM_DEX" permission. |
API level 26 |
KNOX 3.2 |
Global Scope |
API to get the list of disabled application package names for Dex mode.
null
An administrator can use this API to get the list of application package names that are disabled from Dex mode disable list.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DexManager dexMgr = edm.getDexManager(); List |
API level 25 |
KNOX 3.1 |
Global Scope |
This method gets the Dex mode screen timeout in seconds.
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); DexManager dexmanager = cdm.getDexManager(); int screenTimeout = dexmanager.getScreenTimeout(); |
API level 25 |
KNOX 3.1 |
Global Scope |
Deprecated
in API level 36
NOTE: This API is not available since Android 16.
This method gets the ShowIMEWithHardKeyboard's state.
ON
This is a ON of ShowIMEWithHardKeyboard that shows soft keyboard. OFF
Hide on-screen keyboard while physical keyboard is in use. ERROR_NOT_SUPPORTED
This API is not supported.SecurityException | The calling application does not have the required permission. |
---|
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); DexManager dexmanager = cdm.getDexManager(); dexmanager.getShowIMEWithHardKeyboard(); |
API level 28 |
KNOX 3.3 |
Global Scope |
Deprecated
in API level 33
NOTE: This API is not available since Android 11.
API to get virtual MAC Address
An administrator can use this API to get virtual MAC Address |
API level 25 |
KNOX 3.1 |
Global Scope |
Deprecated
in API level 36
NOTE: This API is not available since Android 16.
This method gets the DeX AutoOpenLastApp's state.
ALLOW
The current state of Dex AutoOpenLastApp is a ALLOW. DISALLOW
The current state of Dex AutoOpenLastApp is a DISALLOW. ERROR_NOT_SUPPORTED
This API is not supported.SecurityException | The calling application does not have the required permission. |
---|
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); DexManager dexmanager = cdm.getDexManager(); dexmanager.isAutoOpenLastAppAllowed(); |
API level 28 |
KNOX 3.3 |
Global Scope |
API to check whether Dex mode is activated.
true
if activated, false
if deactivatedAn administrator can use this API to check whether the Dex mode is activated or not. |
API level 25 |
KNOX 3.1 |
Global Scope |
API to check whether Dex mode is enabled.
true
if mirroring mode is enforced. , false
if mirroring mode is not enforced. An administrator can use this API to check whether the Dex mode is enabled or not. |
API level 25 |
KNOX 3.1 |
Global Scope |
API to check whether ethernet only mode is enforced.
true
if enforced, false
if released An administrator can use this API to check whether the ethernet only mode is enforced or not. |
API level 25 |
KNOX 3.1 |
Global Scope |
API to check whether the user is allowed to change the screen time out for Dex mode.
true
if enabled, false
if disabledAn administrator can use this API check whether the user is allowed to change the screen time out. If not allowed, the user cannot change the screen time out. |
API level 25 |
KNOX 3.1 |
Global Scope |
Deprecated
in API level 33
NOTE: This API is not available since Android 11.
API to check enforced use of the virtual MAC address for Dex mode.
true
if using virtual MAC address, false
if using phone MAC address. An administrator can use this API to check whether the virtual MAC address is used in Dex mode. |
API level 25 |
KNOX 3.1 |
Global Scope |
Deprecated in API level 33
API to remove the application package name from Dex mode disable list.
packageName | The application package name to be remove from disable list for Dex mode. |
---|
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove disabled application package name from Dex mode disable list.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DexManager dexMgr = edm.getDexManager(); try { int status = dexMgr.removePackageFromDisableList("com.test.app"); // status is operation 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_DEX" permission which has a protection level of signature. |
API level 25 |
KNOX 3.1 |
Global Scope |
This method removes an application shortcut from the Dex display.
NOTE: This method will remove all shortcuts for the specified package.
component | The component name of the shortcut to be removed. |
---|
SUCCESS
The shortcut was successfully removed from the Dex display. ERROR_INVALID_PACKAGE
The package name is invalid.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); DexManager dexmanager = cdm.getDexManager(); ComponentName component = new ComponentName("com.android.chrome", com.google.android.apps.chrome.Main"); dexmanager.removeShortcut(component); } 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_DEX" permission. |
API level 25 |
KNOX 3.1 |
Global Scope |
This method removes the given shortcut from the DeX Display.
url | The URL address of the URL shortcut. |
---|---|
component | The component name of the shortcut to be removed. |
SUCCESS
The DexURLShortcut was set successfully. ERROR_NOT_SUPPORTED
This API is not supported. ERROR_FAIL
An Unexpected internal error is occured. ERROR_NOT_FOUND
'component' is not installed or wrong value. ERROR_INVALID_VALUE
Some parameters are invalid value.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); DexManager dexmanager = cdm.getDexManager(); ComponentName component = new ComponentName("com.android.chrome", "com.google.android.apps.chrome.Main"); dexmanager.removeURLShortcut( "http://www.naver.com", component) } 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_DEX" permission. |
API level 26 |
KNOX 3.2 |
Global Scope |
API to enable or disable the Dex mode
NOTE: Starting from Android 16, the behavior of the setDexDisabled API is changed to enforce Mirroring Mode.
disabled | true to mirroring, false to dex Mode |
---|
true
if operation is successful, else false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to disable Dex mode without user interaction.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DexManager dexMgr = edm.getDexManager(); // disable try { if (dexMgr.setDexDisabled(false)) { // Display set to mirroring mode. } else { // failure restricting Dex mode. } // enable if (dexMgr.setDexDisabled(true)) { // Display set to dex mode. } else { // failure removing restriction of Dex mode. } } 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_DEX" permission which has a protection level of signature. |
API level 25 |
KNOX 3.1 |
Global Scope |
Deprecated
in API level 36
NOTE: This API is not available since Android 16.
This method adds, removes, clears a package whitelist for Dex foreground mode.
state | ADD Specify the package to run as foreground when DeX mode starts. REMOVE Remove the package from the current specificed list. CLEAR Clear the current speficied list. |
---|---|
pkgList | Specific package list. If the package name is wrong or not installed, it will be ignored. |
SUCCESS
The API is successfully returned. ERROR_NOT_SUPPORTED
This API is not supported. ERROR_FAIL
An Unexpected internal error is occured. ERROR_INVALID_MODE_TYPE
'mode' is not a one of the specified mode. ERROR_INVALID_VALUE
'pkgList' is invalid valueSecurityException | The calling application does not have the required permission. |
---|
This API adds, removes, or clears a package whitelist for the DeX foreground mode.
An app that is in the foreground will be automatically launched after the device is connected to a monitor.
NOTE: This API only works for owner (User 0) space applications. To implement this method properly, the should be called in Samsung Dex single view mode. try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); DexManager dexmanager = cdm.getDexManager(); List |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CUSTOM_DEX" permission. |
API level 26 |
KNOX 3.2 |
Global Scope |
This method sets the DeX HDMIAutoEnter that starts Dex mode automatically when HDMI cable is connected.
NOTE : Starting from Android 16, HDMI_AUTO_ENTER_RESTORE is deprecated and removed.
state | HDMI_AUTO_ENTER_ON This is a ON of Dex HDMIAutoEnterState. HDMI_AUTO_ENTER_RESET This is to go back to initial setting. |
---|
SUCCESS
The DeX setHDMIAutoEnterState was set successfully. ERROR_INVALID_VALUE
The passing integer parameter is invalid.SecurityException | The calling application does not have the required permission. |
---|
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); DexManager dexmanager = cdm.getDexManager(); int state = CustomDeviceManager.HDMI_AUTO_ENTER_RESET; dexmanager.setHDMIAutoEnterState(state); |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CUSTOM_DEX" permission. |
API level 28 |
KNOX 3.3 |
Global Scope |
Deprecated
in API level 36
NOTE: This API is not available since Android 16.
This method sets the DeX alignment mode.
mode | CUSTOM_GRID This is the Custom Grid mode for Dex launcher. ALPHABETIC_GRID This is the Alphabetic Grid mode for Dex launcher. TYPE_GRID This is the Type Grid mode for Dex launcher. |
---|
SUCCESS
The DeX alignment was set successfully. ERROR_INVALID_VALUE
The specified DeX alignment mode is invalid. ERROR_NOT_SUPPORTED
This API is not supported.SecurityException | The calling application does not have the required permission. |
---|
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); DexManager dexmanager = cdm.getDexManager(); int mode = CustomDeviceManager.ALPHABETIC_GRID; dexmanager.setHomeAlignment(mode); |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CUSTOM_DEX" permission. |
API level 26 |
KNOX 3.2 |
Global Scope |
Deprecated
in API level 36
NOTE: This API is not available since Android 16.
This method sets the logo that is displayed when the phone is starting Dex.
logoFD | The descriptor of the file to be used as the logo. The logo file must be a png image. |
---|
SUCCESS
The Dex loading logo was successfully set. ERROR_INVALID_VALUE
The logo file is null. ERROR_NOT_SUPPORTED
This API is not supported.SecurityException | The calling application does not have the required permission. |
---|
try { CustomDeviceManager cdm = CustomDeviceManager.getInstance(); DexManager dexmanager = cdm.getDexManager(); ParcelFileDescriptor logoFD = ParcelFileDescriptor.open(new File(logoFile), ParcelFileDescriptor.MODE_READ_ONLY); dexmanager.setLoadingLogo(logoFD); } 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_DEX" permission. |
API level 25 |
KNOX 3.1 |
Global Scope |
This method sets the Dex mode screen timeout to the specified number of seconds.
Screen timeout only applies to the screen timeout setting of the external display.
NOTE: Starting from Android 16 this API is not supported in Tablet Standalone dex mode.
timeout | The new Dex mode 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(); DexManager dexmanager = cdm.getDexManager(); dexmanager.setScreenTimeout(1200); } 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_DEX" permission. |
API level 25 |
KNOX 3.1 |
Global Scope |
Deprecated
in API level 36
NOTE: This API is not available since Android 16.
This method shows/hides the on-screen keyboard while a physical keyboard is being used.
state | ON This is a ON of ShowIMEWithHardKeyboard that shows soft keyboard. OFF Hide on-screen keyboard while physical keyboard is in use. |
---|
SUCCESS
The DeX setShowIMEWithHardKeyboard was set successfully. ERROR_INVALID_VALUE
The passing integer parameter is invalid. ERROR_NOT_SUPPORTED
This API is not supported.SecurityException | The calling application does not have the required permission. |
---|
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); DexManager dexmanager = cdm.getDexManager(); int state = CustomDeviceManager.ON; dexmanager.setShowIMEWithHardKeyboard(state); |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CUSTOM_DEX" permission. |
API level 28 |
KNOX 3.3 |
Global Scope |
This method allows the caller to specify which of the supported wallpaper categories to set.
context | A caller's context to retrieve a instance associated with the given Context. |
---|---|
bitmapData | A stream containing the raw data to install as a wallpaper. This data can be in any format handled by BitmapRegionDecoder. |
visibleCropHint | The rectangular subregion of the streamed image that should be displayed as wallpaper. Passing null for this parameter means that the full image should be displayed if possible given the image's and device's aspect ratios, etc. |
allowBackup | if the OS is permitted to back up this wallpaper image for restore to a future device; false otherwise. |
which | Flags indicating which wallpaper(s) to configure with the new imagery.FLAG_LOCK_DEX Flag: set or retrieve the lock-screen-specific wallpaper on Dex.FLAG_SYSTEM_DEX Flag: set or retrieve the general system wallpaper on Dex. |
SecurityException | The calling application does not have the required permission. |
---|---|
IllegalArgumentException | If the visibleCropHint rectangle is empty or invalid. |
If an error occurs when attempting to set the wallpaper based on the provided image data. |
CustomDeviceManager cdm = CustomDeviceManager.getInstance(); DexManager dexmanager = cdm.getDexManager(); dexmanager.setWallpaper(context, bitmapData, visibleCropHint, allowBackup, which); |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CUSTOM_DEX" permission. |
The use of this API requires the caller to have the "android.Manifest.permission.SET_WALLPAPER" permission. |
API level 28 |
KNOX 3.3 |
Global Scope |