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 launcher at the specified position.
| |||||||||||
This method adds a new browser shortcut linking the specific url with customized icon to the DeX launcher.
| |||||||||||
This method adds a new browser shortcut linking the specific url to the DeX launcher.
| |||||||||||
This method allows/disallows the DeX AutoOpenLastApp that opens the last app you were using automatically when you start or exit Samsung Dex.
| |||||||||||
API to allow or disallow the user changing the screen time out for Dex mode.
| |||||||||||
This method clears the logo that is displayed when the phone is starting Dex and restores the default logo.
| |||||||||||
API to enforce or release the ethernet only mode.
| |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since Android 11. | |||||||||||
This method gets a package whitelist of foreground mode from dex.
| |||||||||||
This method gets the DeX HDMIAutoEnter's state.
| |||||||||||
This method gets the DeX alignment mode.
| |||||||||||
API to get the list of disabled application package names for Dex mode.
| |||||||||||
This method gets the Dex mode screen timeout in seconds.
| |||||||||||
This method gets the ShowIMEWithHardKeyboard's state.
| |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since Android 11. | |||||||||||
This method gets the DeX AutoOpenLastApp's state.
| |||||||||||
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 launcher.
| |||||||||||
This method removes the given shortcut from the DeX launcher.
| |||||||||||
API to enable or disable the Dex mode
| |||||||||||
This method adds, removes, clears a package whitelist for Dex foreground mode.
| |||||||||||
This method sets the DeX HDMIAutoEnter that starts Dex mode automatically when HDMI cable is connected.
| |||||||||||
This method sets the DeX alignment mode.
| |||||||||||
This method sets the logo that is displayed when the phone is starting Dex.
| |||||||||||
This method sets the Dex mode screen timeout to the specified number of seconds.
| |||||||||||
This method shows/hides the on-screen keyboard while a physical keyboard is being used.
| |||||||||||
This method allows the caller to specify which of the supported wallpaper categories to set.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
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 launcher at the specified position.
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 launcher. 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 launcher at the specified position. This API only supports CUSTOM_GRID . ALPHABETIC_GRID and TYPE_GRID are not supported.
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 launcher.
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 launcher.
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 |
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.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 |
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.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 |
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.
HDMI_AUTO_ENTER_RESTORE
This is a value of user's eariler setting. 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 |
This method gets the DeX alignment mode.
CUSTOM_GRID
The custom grid mode is selected. ALPHABETIC_GRID
The alphabetic grid mode is selected.
TYPE_GRID
The type grid mode is selected.
ERROR_FAIL
The error returned from DeX Launcher.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 |
This method gets the ShowIMEWithHardKeyboard's state.
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 |
This method gets the DeX AutoOpenLastApp's state.
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 enabled, false
if disabledAn 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 releasedAn 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 use virtual MAC address, false
if use 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 launcher.
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 launcher. 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 launcher.
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
disabled | true to disable dex, false to enable dex |
---|
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)) { // Dex mode is disabled. } else { // failure restricting Dex mode. } // enable if (dexMgr.setDexDisabled(true)) { // Dex mode is enabled. } 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 |
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. This is an "Auto start when HDMI is connected" option in DeX settings in tablets.
state | HDMI_AUTO_ENTER_RESTORE This is to go back to user's eariler setting. 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_RESTORE; 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 |
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.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 |
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.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. Samsung DeX supports 2 modes: Dual View mode and Standalone Mode For 'StandAlone mode',screen timeout for DeX should be set to the Device settings' value. For 'DualView mode', screen timeout for DeX sholuld be set to SettingsProvider for DeX only, not Settings.
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 |
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 This is a OFF of ShowIMEWithHardKeyboard that does not show soft keyboard. |
---|
SUCCESS
The DeX setShowIMEWithHardKeyboard 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.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 |