public final class

DLSecondDisplayManager

extends Object
java.lang.Object
   ↳ com.datalogic.device.display.DLSecondDisplayManager

Class Overview

2nd Display is the LED display panel on the top of Datalogic Memor20 device, near to the ScanEngine. It allows to show incoming call and App notifications. The DLSecondDisplayManager allows to configure and manage the 2nd Display, in order to enable/disable the whole feature or to restrict only to allowed Apps to show notifications on 2nd Display.

In order to show a notification on the 2nd Display, an App shall be allowed with addPackage(String), that adds the given installed App in the list of allowed Apps. After that, when that App sends an Android notification, it will be shown on 2nd Display. The removePackage(String), on the contrary, allows to remove an installed App from the list of allowed Apps. By default, all installed Apps are allowed to show notifications on 2nd Display. So, the setNewAppEnabled(boolean) API allows to change the default behavior for the Apps installed at a later stage, while the current configuration for the installed Apps is preserved.

Android documentation Create a Notification and Create and Manage Notification Channels provide helpful information to create and manage notifications.

Moreover, to have a better understanding of 2nd Display and notification management, the 2nd Display Sample is highly recommended.

Summary

Public Methods
boolean addPackage(String packageName)
Allows a package to show its own content on the 2nd Display.
List<String> getAllowedPackages()
Returns the list of allowed packages to show own Android notifications on the 2nd Display.
int getBrightness()
Return an integer value that represents the brightness percentage level on 2nd display
static DLSecondDisplayManager getInstance()
Returns an instance of the DLSecondDisplayManager.
boolean getNewAppEnabled()
Return a boolean value that represents if new Apps will show notifications on 2nd display
boolean getRotateEnabled()
Return a boolean value that represents if rotation is enabled on 2nd display
RotationSpeed getRotationSpeed()
Return an enum that represents 2nd display rotation speed
TimeoutSleep getSwitchOffTimeout()
Return an enum that represents 2nd display switch-off timeout
boolean isPackageAllowed(String packageName)
Returns the allowed/disallowed configuration for the given package to show its own content ont the 2nd Display.
boolean isSecondDisplayAvailable()
Returns the availability of the 2nd Display feature.
boolean isSecondDisplayEnabled()
Returns the enabled/disabled status of the 2nd Display.
boolean removePackage(String packageName)
Disable the given package to show its own content on the 2nd Display.
boolean setBrightness(int brightness)
Set brightness level on 2nd display
boolean setNewAppEnabled(boolean isEnabled)
Enable or disable notifications on 2nd display for all the new Apps
boolean setRotateEnabled(boolean enable)
Set rotation on 2nd display
boolean setRotationSpeed(RotationSpeed speed)
Set 2nd display rotation speed
boolean setSecondDisplayEnabled(boolean enable)
Enables or disables the 2nd Display.
boolean setSwitchOffTimeout(TimeoutSleep timeout)
Set switch-off timeout on 2nd display
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public boolean addPackage (String packageName)

Added in revision 22

Allows a package to show its own content on the 2nd Display. This method allows Android notifications sent by the given package to be shown on the 2nd Display.

Parameters
packageName Name of the package to be added to the list of packages allowed to show notifications on the 2nd display.
Returns
  • boolean True if the operation complete successfully, False otherwise (eg. package not found).
Throws
in case of error, when exceptions are enabled through the ErrorManager singleton.

public List<String> getAllowedPackages ()

Added in revision 22

Returns the list of allowed packages to show own Android notifications on the 2nd Display.

Returns
  • List List of allowed packages, passed as Strings.
Throws
in case of error, when exceptions are enabled through the ErrorManager singleton.

public int getBrightness ()

Added in revision 24

Return an integer value that represents the brightness percentage level on 2nd display

Returns
  • integer Integer value that represents the brightness percentage level on 2nd display, -1 in case of error.
Throws
in case of error, when exceptions are enabled through the ErrorManager singleton.

public static DLSecondDisplayManager getInstance ()

Added in revision 20

Returns an instance of the DLSecondDisplayManager. This method provides the reference to the unique instance of 2nd Display Manager.

Returns
  • The 2nd Display Manager.
Throws
in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean getNewAppEnabled ()

Added in revision 22

Return a boolean value that represents if new Apps will show notifications on 2nd display

Returns
  • boolean True if Apps can show notification, false otherwise.
Throws
in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean getRotateEnabled ()

Added in revision 24

Return a boolean value that represents if rotation is enabled on 2nd display

Returns
  • boolean Boolean value that represents if rotation is enabled on 2nd display.
Throws
in case of error, when exceptions are enabled through the ErrorManager singleton.

public RotationSpeed getRotationSpeed ()

Added in revision 24

Return an enum that represents 2nd display rotation speed

Returns
  • enum Enum that represents 2nd display rotation speed, null in case of error.
Throws
in case of error, when exceptions are enabled through the ErrorManager singleton.

public TimeoutSleep getSwitchOffTimeout ()

Added in revision 24

Return an enum that represents 2nd display switch-off timeout

Returns
  • enum enum value that represents 2nd display switch-off timeout, null in case of error.
Throws
in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean isPackageAllowed (String packageName)

Added in revision 22

Returns the allowed/disallowed configuration for the given package to show its own content ont the 2nd Display. This method can be used to check if Android notifications sent by the given package are allowed or disallowed to be shown on the 2nd Display.

Parameters
packageName Name of the package to be checked.
Returns
  • boolean True if the package is allowed, False otherwise (eg. package not found).
Throws
in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean isSecondDisplayAvailable ()

Added in revision 20

Returns the availability of the 2nd Display feature. This method can be used to know if the device supports the 2nd Display feature.

Returns
  • boolean True if the device supports the 2nd Display, False otherwise, or throws anException in case of failure.

public boolean isSecondDisplayEnabled ()

Added in revision 20

Returns the enabled/disabled status of the 2nd Display. This method can be used to know the current enabled/disabled status of the whole 2nd Display feature. When 2nd Display is enabled, it works according to its configuration.

Returns
  • boolean True if the 2nd Display is enabled, False otherwise.
Throws
in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean removePackage (String packageName)

Added in revision 22

Disable the given package to show its own content on the 2nd Display. This method disallows Android notifications sent by the given package to be shown on the 2nd Display.

Parameters
packageName Name of the package to be removed to the list of packages allowed to show notifications on the 2nd display.
Returns
  • boolean True if the operation complete successfully, False otherwise (eg. package not found).
Throws
in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean setBrightness (int brightness)

Added in revision 24

Set brightness level on 2nd display

Parameters
brightness Brightness percentage level for 2nd display: Values lower than 0 or higher than 100 will be cropped respectevely to 0 and 100.
Returns
  • boolean True if Apps can show notification, false otherwise.
Throws
in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean setNewAppEnabled (boolean isEnabled)

Added in revision 22

Enable or disable notifications on 2nd display for all the new Apps

Parameters
isEnabled Boolean parameter that represents if new Apps should show notifications on 2nd display
Returns
  • boolean True if Apps can show notification, false otherwise.
Throws
in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean setRotateEnabled (boolean enable)

Added in revision 24

Set rotation on 2nd display

Parameters
enable Boolean parameter that represents if rotation is enabled on 2nd display
Returns
  • boolean True if Apps can set rotation, false otherwise.
Throws
in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean setRotationSpeed (RotationSpeed speed)

Added in revision 24

Set 2nd display rotation speed

Parameters
speed Enum that represents the desired 2nd display rotation speed.
Returns
  • boolean True if Apps can set the rotation speed, false otherwise.
Throws
in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean setSecondDisplayEnabled (boolean enable)

Added in revision 20

Enables or disables the 2nd Display. This method can be used to enable or disable the whole 2nd Display feature.

Parameters
enable True to enable the 2nd Display, False to disable it.
Returns
  • boolean True if the operation complete successfully, False otherwise.
Throws
in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean setSwitchOffTimeout (TimeoutSleep timeout)

Added in revision 24

Set switch-off timeout on 2nd display

Parameters
timeout Enum that represents 2nd display rotation speed.
Returns
  • boolean True if Apps can set the switch-off timeout, false otherwise.
Throws
in case of error, when exceptions are enabled through the ErrorManager singleton.