to top
Datalogic APIs
public static class

EnterpriseBatterySaverProfiles.Profile.Builder

extends Object
java.lang.Object
   ↳ com.datalogic.device.configuration.EnterpriseBatterySaverProfiles.Profile.Builder

Class Overview

The builder for the Profile.

Summary

Public Constructors
Builder()
Create a new Builder for the Profile object, with the following default values:
  • `name` unset
  • `disable5G` set to `false`
  • `cpuFrequencyLimit` set to `FREQUENCY_LIMIT_NONE`
  • `gpuFrequencyLimit` set to `FREQUENCY_LIMIT_NONE`
  • `usePowerSaveGovernor` set to `false`
  • `downloadRateLimitKbps` set to `DOWNLOAD_RATE_LIMIT_NONE`
  • `mobileDataAlwaysActive` set to `true`
  • `adaptiveBrightness` set to `false`
  • `disableBluetooth` set to `false`
  • `disableWifi` set to `false`
  • `disableLocation` set to `false`
  • `disableTelephony` set to `false`
  • `disableNfc` set to `false`
  • `halvesBrightnessAdjustment` set to `false``
  • `applicationsBlacklist` set to an empty list
  • `installLocation` set to `USERDATA`
The name must be set before building the Profile object.
Public Methods
EnterpriseBatterySaverProfiles.Profile.Builder addApplicationsBlacklist(String application)
Add an application to the blacklist.
EnterpriseBatterySaverProfiles.Profile build()
Build and return a newly created Profile object.
EnterpriseBatterySaverProfiles.Profile.Builder withAdaptiveBrightness(boolean adaptiveBrightness)
Control if the adaptive brightness is enabled.
EnterpriseBatterySaverProfiles.Profile.Builder withCpuFrequencyLimit(int cpuFrequencyLimit)
Set the CPU frequency limit.
EnterpriseBatterySaverProfiles.Profile.Builder withDisable5G(boolean disable5G)
Control if the 5G is disabled.
EnterpriseBatterySaverProfiles.Profile.Builder withDisableBluetooth(boolean disableBluetooth)
Control if Bluetooth is disabled.
EnterpriseBatterySaverProfiles.Profile.Builder withDisableLocation(boolean disableLocation)
Control if the Location service is disabled.
EnterpriseBatterySaverProfiles.Profile.Builder withDisableNfc(boolean disableNfc)
Control if NFC is disabled.
EnterpriseBatterySaverProfiles.Profile.Builder withDisableTelephony(boolean disableTelephony)
Control if the Telephony service is disabled.
EnterpriseBatterySaverProfiles.Profile.Builder withDisableWifi(boolean disableWifi)
Control if Wi-Fi is disabled.
EnterpriseBatterySaverProfiles.Profile.Builder withDownloadRateLimitKbps(int downloadRateLimitKbps)
Set the download rate limit in Kbps.
EnterpriseBatterySaverProfiles.Profile.Builder withGpuFrequencyLimit(int gpuFrequencyLimit)
Set the GPU frequency limit.
EnterpriseBatterySaverProfiles.Profile.Builder withHalvesBrightnessAdjustment(boolean halvesBrightnessAdjustment)
Control if the halves brightness adjustment is enabled.
EnterpriseBatterySaverProfiles.Profile.Builder withInstallLocation(EnterpriseBatterySaverProfiles.Profile.Location installLocation)
Set the profile's install location.
EnterpriseBatterySaverProfiles.Profile.Builder withMobileDataAlwaysActive(boolean mobileDataAlwaysActive)
Control if the mobile data is always active.
EnterpriseBatterySaverProfiles.Profile.Builder withName(String name)
Set the profile name.
EnterpriseBatterySaverProfiles.Profile.Builder withUsePowerSaveGovernor(boolean usePowerSaveGovernor)
Control if the power save governor is used.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Builder ()

Added in revision 44

Create a new Builder for the Profile object, with the following default values:

  • `name` unset
  • `disable5G` set to `false`
  • `cpuFrequencyLimit` set to `FREQUENCY_LIMIT_NONE`
  • `gpuFrequencyLimit` set to `FREQUENCY_LIMIT_NONE`
  • `usePowerSaveGovernor` set to `false`
  • `downloadRateLimitKbps` set to `DOWNLOAD_RATE_LIMIT_NONE`
  • `mobileDataAlwaysActive` set to `true`
  • `adaptiveBrightness` set to `false`
  • `disableBluetooth` set to `false`
  • `disableWifi` set to `false`
  • `disableLocation` set to `false`
  • `disableTelephony` set to `false`
  • `disableNfc` set to `false`
  • `halvesBrightnessAdjustment` set to `false``
  • `applicationsBlacklist` set to an empty list
  • `installLocation` set to `USERDATA`
The name must be set before building the Profile object.

Public Methods

public EnterpriseBatterySaverProfiles.Profile.Builder addApplicationsBlacklist (String application)

Added in revision 44

Add an application to the blacklist. The application is identified by its package name. The name must be non empty.

Parameters
application The package name of the application to add to the blacklist.
Throws
IllegalArgumentException if the name is empty or null.

public EnterpriseBatterySaverProfiles.Profile build ()

Added in revision 44

Build and return a newly created Profile object. The created object is guaranteed to be valid and ready to use.

Returns
  • The Profile object.
Throws
IllegalStateException if the name is not set or is empty.

public EnterpriseBatterySaverProfiles.Profile.Builder withAdaptiveBrightness (boolean adaptiveBrightness)

Added in revision 44

Control if the adaptive brightness is enabled.

Parameters
adaptiveBrightness true to enable the adaptive brightness, false otherwise.

public EnterpriseBatterySaverProfiles.Profile.Builder withCpuFrequencyLimit (int cpuFrequencyLimit)

Added in revision 44

Set the CPU frequency limit.

Parameters
cpuFrequencyLimit The CPU frequency limit. Valid values are FREQUENCY_LIMIT_NONE, FREQUENCY_LIMIT_INTERMEDIATE, FREQUENCY_LIMIT_AGGRESSIVE.
Throws
IllegalArgumentException if the value is not one of the above.

public EnterpriseBatterySaverProfiles.Profile.Builder withDisable5G (boolean disable5G)

Added in revision 44

Control if the 5G is disabled.

public EnterpriseBatterySaverProfiles.Profile.Builder withDisableBluetooth (boolean disableBluetooth)

Added in revision 44

Control if Bluetooth is disabled.

Parameters
disableBluetooth true to disable Bluetooth, false otherwise.

public EnterpriseBatterySaverProfiles.Profile.Builder withDisableLocation (boolean disableLocation)

Added in revision 44

Control if the Location service is disabled.

Parameters
disableLocation true to disable the location service, false otherwise.

public EnterpriseBatterySaverProfiles.Profile.Builder withDisableNfc (boolean disableNfc)

Added in revision 44

Control if NFC is disabled.

Parameters
disableNfc true to disable NFC, false otherwise.

public EnterpriseBatterySaverProfiles.Profile.Builder withDisableTelephony (boolean disableTelephony)

Added in revision 44

Control if the Telephony service is disabled.

Parameters
disableTelephony true to disable the telephony service, false otherwise.

public EnterpriseBatterySaverProfiles.Profile.Builder withDisableWifi (boolean disableWifi)

Added in revision 44

Control if Wi-Fi is disabled.

Parameters
disableWifi true to disable Wifi, false otherwise.

public EnterpriseBatterySaverProfiles.Profile.Builder withDownloadRateLimitKbps (int downloadRateLimitKbps)

Added in revision 44

Set the download rate limit in Kbps. Any non negative value is accepted but the following values are recommended:

Parameters
downloadRateLimitKbps The download rate limit in Kbps.
Throws
IllegalArgumentException if the value is negative.

public EnterpriseBatterySaverProfiles.Profile.Builder withGpuFrequencyLimit (int gpuFrequencyLimit)

Added in revision 44

Set the GPU frequency limit.

Parameters
gpuFrequencyLimit The GPU frequency limit. Values are the same as for the CPU frequency limit (see withCpuFrequencyLimit(int)).
Throws
IllegalArgumentException if the value is not one of the above.

public EnterpriseBatterySaverProfiles.Profile.Builder withHalvesBrightnessAdjustment (boolean halvesBrightnessAdjustment)

Added in revision 44

Control if the halves brightness adjustment is enabled.

Parameters
halvesBrightnessAdjustment true to enable the halves brightness adjustment, false otherwise.

public EnterpriseBatterySaverProfiles.Profile.Builder withInstallLocation (EnterpriseBatterySaverProfiles.Profile.Location installLocation)

Added in revision 44

Set the profile's install location.

Parameters
installLocation The install location of the profile (see EnterpriseBatterySaverProfiles.Profile.Location).

public EnterpriseBatterySaverProfiles.Profile.Builder withMobileDataAlwaysActive (boolean mobileDataAlwaysActive)

Added in revision 44

Control if the mobile data is always active.

Parameters
mobileDataAlwaysActive true to keep the mobile data always active, false otherwise.

public EnterpriseBatterySaverProfiles.Profile.Builder withName (String name)

Added in revision 44

Set the profile name. The name must be non empty and unique among all profiles. It is used to identify the profile when creating an `ActivationItem`.

Parameters
name The name of the profile.
Throws
IllegalArgumentException if the name is empty or null.

public EnterpriseBatterySaverProfiles.Profile.Builder withUsePowerSaveGovernor (boolean usePowerSaveGovernor)

Added in revision 44

Control if the power save governor is used. The power save governor is a CPU governor that is optimized for power savings. It sets the CPU statically to the minimum frequency and dynamically changes the CPU frequency based on the CPU load.

Parameters
usePowerSaveGovernor true to use the power save governor, false otherwise.
See Also