public class

SelfshoppingBatteryManager

extends Object
java.lang.Object
   ↳ com.datalogic.extension.selfshopping.power.SelfshoppingBatteryManager

Class Overview

The Battery Manager used in the Selfshopping Extension SDK. It allows to read specific battery parameters related to lifetime, manufacturer information or realtime values. This class is also used to setup the current charging profile between the ones available.

Summary

Constants
String ACTION_LIFETIME_DATA_CHANGED Action for a sticky broadcast containing health information about the battery.
int CHARGING_PROFILE_JOYA_TOUCH_CAPACITY Charging profile on the Joya Touch device with capacity only preference.
int CHARGING_PROFILE_JOYA_TOUCH_CAPACITY_LIFETIME Charging profile on the Joya Touch device with capacity and lifetime preference.
int CHARGING_PROFILE_JOYA_TOUCH_CHARGING_SPEED Charging profile on the Joya Touch device with charging speed only preference.
int CHARGING_PROFILE_JOYA_TOUCH_CHARGING_SPEED_CAPACITY Charging profile on the Joya Touch device with charging speed and capacity preference.
int CHARGING_PROFILE_JOYA_TOUCH_CHARGING_SPEED_LIFETIME Charging profile on the Joya Touch device with charging speed and lifetime preference.
int CHARGING_PROFILE_JOYA_TOUCH_LIFETIME Charging profile on the Joya Touch device with lifetime only preference.
String EXTRA_LIFETIME_CAPACITY_FULL Extra for ACTION_LIFETIME_DATA_CHANGED: integer containing the full battery capacity in mAh.
String EXTRA_LIFETIME_CAPACITY_REMAINING Extra for ACTION_LIFETIME_DATA_CHANGED: integer containing the remaining battery capacity in mAh.
String EXTRA_LIFETIME_CHARGE_CURRENT_MAX Extra for ACTION_LIFETIME_DATA_CHANGED: integer containing the maximum charge current reached by the battery during its life (in mA).
String EXTRA_LIFETIME_DISCHARGE_CURRENT_MAX Extra for ACTION_LIFETIME_DATA_CHANGED: integer containing the maximum discharge current reached by the battery during its life (in mA).
String EXTRA_LIFETIME_STATE_OF_HEALTH Extra for ACTION_LIFETIME_DATA_CHANGED: integer containing the current state of health in percentage.
String EXTRA_LIFETIME_TEMPERATURE_MAX Extra for ACTION_LIFETIME_DATA_CHANGED: integer containing the maximum temperature reached by the battery during its life (in 0.1 °C).
String EXTRA_LIFETIME_TEMPERATURE_MIN Extra for ACTION_LIFETIME_DATA_CHANGED: integer containing the minimum temperature reached by the battery during its life (in 0.1 °C).
String EXTRA_LIFETIME_TOTAL_DISCHARGE Extra for ACTION_LIFETIME_DATA_CHANGED: integer containing the amount of discharge (in 0.1 Ah) taken by the battery during its life.
String EXTRA_LIFETIME_VOLTAGE_MAX Extra for ACTION_LIFETIME_DATA_CHANGED: integer containing the maximum voltage reached by the battery during its life (in mV).
String EXTRA_LIFETIME_VOLTAGE_MIN Extra for ACTION_LIFETIME_DATA_CHANGED: integer containing the minimum voltage reached by the battery during its life (in mV).
int PROPERTY_TIME_TO_EMPTY Integer property representing the estimated remaining battery life (in seconds).
Public Methods
ChargingProfile getCurrentChargingProfile()
Gets the current charging profile setup in this device.
static SelfshoppingBatteryManager getInstance()
Returns an instance of the SelfshoppingBatteryManager.
int getIntProperty(int id)
Reads a specific integer value given its ID.
ManufacturerInfo getManufacturerInfo()
Reads the battery manufacturer info.
List<ChargingProfile> getSupportedChargingProfiles()
Gets the supported charging profiles in this device.
void setCurrentChargingProfile(ChargingProfile chargingProfile)
Sets the current charging profile.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String ACTION_LIFETIME_DATA_CHANGED

Added in revision 3

Action for a sticky broadcast containing health information about the battery. All intent extras are documented in the SelfshoppingBatteryManager class.

Constant Value: "com.datalogic.extension.selfshopping.power.action.LIFETIME_DATA_CHANGED"

public static final int CHARGING_PROFILE_JOYA_TOUCH_CAPACITY

Added in revision 3

Charging profile on the Joya Touch device with capacity only preference.

Constant Value: 2 (0x00000002)

public static final int CHARGING_PROFILE_JOYA_TOUCH_CAPACITY_LIFETIME

Added in revision 3

Charging profile on the Joya Touch device with capacity and lifetime preference.

Constant Value: 6 (0x00000006)

public static final int CHARGING_PROFILE_JOYA_TOUCH_CHARGING_SPEED

Added in revision 3

Charging profile on the Joya Touch device with charging speed only preference.

Constant Value: 1 (0x00000001)

public static final int CHARGING_PROFILE_JOYA_TOUCH_CHARGING_SPEED_CAPACITY

Added in revision 3

Charging profile on the Joya Touch device with charging speed and capacity preference.

Constant Value: 3 (0x00000003)

public static final int CHARGING_PROFILE_JOYA_TOUCH_CHARGING_SPEED_LIFETIME

Added in revision 3

Charging profile on the Joya Touch device with charging speed and lifetime preference.

Constant Value: 5 (0x00000005)

public static final int CHARGING_PROFILE_JOYA_TOUCH_LIFETIME

Added in revision 3

Charging profile on the Joya Touch device with lifetime only preference.

Constant Value: 4 (0x00000004)

public static final String EXTRA_LIFETIME_CAPACITY_FULL

Added in revision 3

Extra for ACTION_LIFETIME_DATA_CHANGED: integer containing the full battery capacity in mAh.

Constant Value: "lifetime_capacity_full"

public static final String EXTRA_LIFETIME_CAPACITY_REMAINING

Added in revision 3

Extra for ACTION_LIFETIME_DATA_CHANGED: integer containing the remaining battery capacity in mAh.

Constant Value: "lifetime_capacity_remaining"

public static final String EXTRA_LIFETIME_CHARGE_CURRENT_MAX

Added in revision 3

Extra for ACTION_LIFETIME_DATA_CHANGED: integer containing the maximum charge current reached by the battery during its life (in mA).

Constant Value: "lifetime_charge_current_max"

public static final String EXTRA_LIFETIME_DISCHARGE_CURRENT_MAX

Added in revision 3

Extra for ACTION_LIFETIME_DATA_CHANGED: integer containing the maximum discharge current reached by the battery during its life (in mA).

Constant Value: "lifetime_discharge_current_max"

public static final String EXTRA_LIFETIME_STATE_OF_HEALTH

Added in revision 3

Extra for ACTION_LIFETIME_DATA_CHANGED: integer containing the current state of health in percentage.

Constant Value: "lifetime_state_of_health"

public static final String EXTRA_LIFETIME_TEMPERATURE_MAX

Added in revision 3

Extra for ACTION_LIFETIME_DATA_CHANGED: integer containing the maximum temperature reached by the battery during its life (in 0.1 °C).

Constant Value: "lifetime_temperature_max"

public static final String EXTRA_LIFETIME_TEMPERATURE_MIN

Added in revision 3

Extra for ACTION_LIFETIME_DATA_CHANGED: integer containing the minimum temperature reached by the battery during its life (in 0.1 °C).

Constant Value: "lifetime_temperature_min"

public static final String EXTRA_LIFETIME_TOTAL_DISCHARGE

Added in revision 3

Extra for ACTION_LIFETIME_DATA_CHANGED: integer containing the amount of discharge (in 0.1 Ah) taken by the battery during its life.

Constant Value: "lifetime_total_discharge"

public static final String EXTRA_LIFETIME_VOLTAGE_MAX

Added in revision 3

Extra for ACTION_LIFETIME_DATA_CHANGED: integer containing the maximum voltage reached by the battery during its life (in mV).

Constant Value: "lifetime_voltage_max"

public static final String EXTRA_LIFETIME_VOLTAGE_MIN

Added in revision 3

Extra for ACTION_LIFETIME_DATA_CHANGED: integer containing the minimum voltage reached by the battery during its life (in mV).

Constant Value: "lifetime_voltage_min"

public static final int PROPERTY_TIME_TO_EMPTY

Added in revision 3

Integer property representing the estimated remaining battery life (in seconds).

Constant Value: 1 (0x00000001)

Public Methods

public ChargingProfile getCurrentChargingProfile ()

Added in revision 3

Gets the current charging profile setup in this device.

Returns

public static SelfshoppingBatteryManager getInstance ()

Added in revision 3

Returns an instance of the SelfshoppingBatteryManager.

Returns
  • The Selfshopping Battery Manager.

public int getIntProperty (int id)

Added in revision 3

Reads a specific integer value given its ID. This value is present as one of the properties of the SelfshoppingBatteryManager and it must be positive.

Parameters
id The property ID (needs to be one of the supported).
Returns
  • int The value of the specified property, or throws an Exception in case of failure.

public ManufacturerInfo getManufacturerInfo ()

Added in revision 3

Reads the battery manufacturer info.

Returns

public List<ChargingProfile> getSupportedChargingProfiles ()

Added in revision 3

Gets the supported charging profiles in this device. You can use one of the returning objects to setup the desired charging profile.

Returns
  • A list of ChargingProfile objects, each representing one of the supported charging profile. The list can be empty in case no charging profile is supported in the current device.

public void setCurrentChargingProfile (ChargingProfile chargingProfile)

Added in revision 3

Sets the current charging profile. This setting is persistent to device reboots or even factory resets.

Parameters
chargingProfile The ChargingProfile to set.