public final class

LineageHardwareManager

extends Object
java.lang.Object
   ↳ lineageos.hardware.LineageHardwareManager

Class Overview

Manages access to LineageOS hardware extensions

This manager requires the HARDWARE_ABSTRACTION_ACCESS permission.

To get the instance of this class, utilize LineageHardwareManager#getInstance(Context context)

Summary

Constants
int FEATURE_ADAPTIVE_BACKLIGHT Adaptive backlight support (this refers to technologies like NVIDIA SmartDimmer, QCOM CABL or Samsung CABC)
int FEATURE_AUTO_CONTRAST Auto contrast
int FEATURE_COLOR_BALANCE Color balance
int FEATURE_COLOR_ENHANCEMENT Color enhancement support
int FEATURE_DISPLAY_COLOR_CALIBRATION Display RGB color calibration
int FEATURE_DISPLAY_GAMMA_CALIBRATION Display gamma calibration
int FEATURE_DISPLAY_MODES Display modes
int FEATURE_HIGH_TOUCH_SENSITIVITY High touch sensitivity for touch panels
int FEATURE_KEY_DISABLE Hardware navigation key disablement
int FEATURE_LONG_TERM_ORBITS Long term orbits (LTO)
int FEATURE_PICTURE_ADJUSTMENT HSIC picture adjustment
int FEATURE_SERIAL_NUMBER Serial number other than ro.serialno
int FEATURE_SUNLIGHT_ENHANCEMENT Increased display readability in bright light
int FEATURE_TOUCHSCREEN_GESTURES Touchscreen gesture
int FEATURE_TOUCH_HOVERING Touchscreen hovering
int FEATURE_VIBRATOR Variable vibrator intensity
Public Methods
boolean get(int feature)
Determine if the given feature is enabled or disabled.
int getColorBalance()
Range<Integer> getColorBalanceRange()
DisplayMode getCurrentDisplayMode()
DisplayMode getDefaultDisplayMode()
HSIC getDefaultPictureAdjustment()
Gets the default picture adjustment for the current mode
int[] getDisplayColorCalibration()
int getDisplayColorCalibrationDefault()
int getDisplayColorCalibrationMax()
int getDisplayColorCalibrationMin()
int[] getDisplayGammaCalibration(int idx)
This method was deprecated in API level 8. No replacement.
int getDisplayGammaCalibrationMax()
This method was deprecated in API level 8. No replacement.
int getDisplayGammaCalibrationMin()
This method was deprecated in API level 8. No replacement.
DisplayMode[] getDisplayModes()
static LineageHardwareManager getInstance(Context context)
Get or create an instance of the LineageHardwareManager
String getLtoDestination()
long getLtoDownloadInterval()
String getLtoSource()
int getNumGammaControls()
This method was deprecated in API level 8. No replacement.
HSIC getPictureAdjustment()
Gets the current picture adjustment values
List<Range<Float>> getPictureAdjustmentRanges()
Get a list of ranges valid for picture adjustment.
String getSerialNumber()
int getSupportedFeatures()
TouchscreenGesture[] getTouchscreenGestures()
int getVibratorDefaultIntensity()
int getVibratorIntensity()
int getVibratorMaxIntensity()
int getVibratorMinIntensity()
int getVibratorWarningIntensity()
boolean isSunlightEnhancementSelfManaged()
boolean isSupported(int feature)
Determine if a Lineage Hardware feature is supported on this device
boolean requireAdaptiveBacklightForSunlightEnhancement()
boolean set(int feature, boolean enable)
Enable or disable the given feature Only used for features which have simple enable/disable controls.
boolean setColorBalance(int value)
Sets the desired color balance.
boolean setDisplayColorCalibration(int[] rgb)
Set the display color calibration to the given rgb triplet
boolean setDisplayGammaCalibration(int idx, int[] rgb)
This method was deprecated in API level 8. No replacement.
boolean setDisplayMode(DisplayMode mode, boolean makeDefault)
boolean setPictureAdjustment(HSIC hsic)
Sets the desired hue/saturation/intensity/contrast
boolean setTouchscreenGestureEnabled(TouchscreenGesture gesture, boolean state)
boolean setVibratorIntensity(int intensity)
Set the current vibrator intensity
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int FEATURE_ADAPTIVE_BACKLIGHT

added in API level 8

Adaptive backlight support (this refers to technologies like NVIDIA SmartDimmer, QCOM CABL or Samsung CABC)

Constant Value: 1 (0x00000001)

public static final int FEATURE_AUTO_CONTRAST

added in API level 8

Auto contrast

Constant Value: 4096 (0x00001000)

public static final int FEATURE_COLOR_BALANCE

added in API level 8

Color balance

Constant Value: 131072 (0x00020000)

public static final int FEATURE_COLOR_ENHANCEMENT

added in API level 8

Color enhancement support

Constant Value: 2 (0x00000002)

public static final int FEATURE_DISPLAY_COLOR_CALIBRATION

added in API level 8

Display RGB color calibration

Constant Value: 4 (0x00000004)

public static final int FEATURE_DISPLAY_GAMMA_CALIBRATION

added in API level 8

Display gamma calibration

Constant Value: 8 (0x00000008)

public static final int FEATURE_DISPLAY_MODES

added in API level 8

Display modes

Constant Value: 8192 (0x00002000)

public static final int FEATURE_HIGH_TOUCH_SENSITIVITY

added in API level 8

High touch sensitivity for touch panels

Constant Value: 16 (0x00000010)

public static final int FEATURE_KEY_DISABLE

added in API level 8

Hardware navigation key disablement

Constant Value: 32 (0x00000020)

public static final int FEATURE_LONG_TERM_ORBITS

added in API level 8

Long term orbits (LTO)

Constant Value: 64 (0x00000040)

public static final int FEATURE_PICTURE_ADJUSTMENT

added in API level 8

HSIC picture adjustment

Constant Value: 262144 (0x00040000)

public static final int FEATURE_SERIAL_NUMBER

added in API level 8

Serial number other than ro.serialno

Constant Value: 128 (0x00000080)

public static final int FEATURE_SUNLIGHT_ENHANCEMENT

added in API level 8

Increased display readability in bright light

Constant Value: 256 (0x00000100)

public static final int FEATURE_TOUCHSCREEN_GESTURES

added in API level 8

Touchscreen gesture

Constant Value: 524288 (0x00080000)

public static final int FEATURE_TOUCH_HOVERING

added in API level 8

Touchscreen hovering

Constant Value: 2048 (0x00000800)

public static final int FEATURE_VIBRATOR

added in API level 8

Variable vibrator intensity

Constant Value: 1024 (0x00000400)

Public Methods

public boolean get (int feature)

added in API level 8

Determine if the given feature is enabled or disabled. Only used for features which have simple enable/disable controls.

Parameters
feature int: the Lineage Hardware feature to query
Returns
boolean true if the feature is enabled, false otherwise.

public int getColorBalance ()

added in API level 8

Returns
int the current color balance value

public Range<Integer> getColorBalanceRange ()

added in API level 8

Returns
Range<Integer> the available range for color temperature adjustments

public DisplayMode getCurrentDisplayMode ()

added in API level 8

Returns
DisplayMode the currently active display mode

public DisplayMode getDefaultDisplayMode ()

added in API level 8

Returns
DisplayMode the default display mode to be set on boot

public HSIC getDefaultPictureAdjustment ()

added in API level 8

Gets the default picture adjustment for the current mode

Returns
HSIC HSIC object with default settings

public int[] getDisplayColorCalibration ()

added in API level 8

Returns
int[] the current RGB calibration, where int[0] = R, int[1] = G, int[2] = B.

public int getDisplayColorCalibrationDefault ()

added in API level 8

Returns
int the default value for all colors

public int getDisplayColorCalibrationMax ()

added in API level 8

Returns
int The minimum value for all colors

public int getDisplayColorCalibrationMin ()

added in API level 8

Returns
int The minimum value for all colors

public int[] getDisplayGammaCalibration (int idx)

added in API level 8

This method was deprecated in API level 8.
No replacement.

Parameters
idx int: the control to query
Returns
int[] the current RGB gamma calibration for the given control

public int getDisplayGammaCalibrationMax ()

added in API level 8

This method was deprecated in API level 8.
No replacement.

Returns
int the maximum value for all colors

public int getDisplayGammaCalibrationMin ()

added in API level 8

This method was deprecated in API level 8.
No replacement.

Returns
int the minimum value for all colors

public DisplayMode[] getDisplayModes ()

added in API level 8

Returns
DisplayMode[] a list of available display modes on the devices

public static LineageHardwareManager getInstance (Context context)

added in API level 8

Get or create an instance of the LineageHardwareManager

Returns
LineageHardwareManager LineageHardwareManager

public String getLtoDestination ()

added in API level 8

Returns
String the destination location of LTO data, or null on failure

public long getLtoDownloadInterval ()

added in API level 8

Returns
long the interval, in milliseconds, to trigger LTO data download

public String getLtoSource ()

added in API level 8

Returns
String the source location of LTO data, or null on failure

public int getNumGammaControls ()

added in API level 8

This method was deprecated in API level 8.
No replacement.

Returns
int the number of RGB controls the device supports

public HSIC getPictureAdjustment ()

added in API level 8

Gets the current picture adjustment values

Returns
HSIC HSIC object with current settings

public List<Range<Float>> getPictureAdjustmentRanges ()

added in API level 8

Get a list of ranges valid for picture adjustment.

Returns
List<Range<Float>> range list

public String getSerialNumber ()

added in API level 8

Returns
String the serial number to display instead of ro.serialno, or null on failure

public int getSupportedFeatures ()

added in API level 8

Returns
int the supported features bitmask

public TouchscreenGesture[] getTouchscreenGestures ()

added in API level 8

Returns
TouchscreenGesture[] a list of available touchscreen gestures on the devices

public int getVibratorDefaultIntensity ()

added in API level 8

Returns
int The default vibrator intensity.

public int getVibratorIntensity ()

added in API level 8

Returns
int The current vibrator intensity.

public int getVibratorMaxIntensity ()

added in API level 8

Returns
int The maximum vibrator intensity.

public int getVibratorMinIntensity ()

added in API level 8

Returns
int The minimum vibrator intensity.

public int getVibratorWarningIntensity ()

added in API level 8

Returns
int The warning threshold vibrator intensity.

public boolean isSunlightEnhancementSelfManaged ()

added in API level 8

Returns
boolean true if this implementation does it's own lux metering

public boolean isSupported (int feature)

added in API level 8

Determine if a Lineage Hardware feature is supported on this device

Parameters
feature int: The Lineage Hardware feature to query
Returns
boolean true if the feature is supported, false otherwise.

public boolean requireAdaptiveBacklightForSunlightEnhancement ()

added in API level 8

Returns
boolean true if adaptive backlight should be enabled when sunlight enhancement is enabled.

public boolean set (int feature, boolean enable)

added in API level 8

Enable or disable the given feature Only used for features which have simple enable/disable controls.

Parameters
feature int: the Lineage Hardware feature to set
enable boolean: true to enable, false to disale
Returns
boolean true if the feature is enabled, false otherwise.

public boolean setColorBalance (int value)

added in API level 8

Sets the desired color balance. Must fall within the range obtained from getColorBalanceRange()

Returns
boolean true if success

public boolean setDisplayColorCalibration (int[] rgb)

added in API level 8

Set the display color calibration to the given rgb triplet

Parameters
rgb int: RGB color calibration. Each value must be between getDisplayColorCalibrationMin() and getDisplayColorCalibrationMax(), inclusive.
Returns
boolean true on success, false otherwise.

public boolean setDisplayGammaCalibration (int idx, int[] rgb)

added in API level 8

This method was deprecated in API level 8.
No replacement.

Set the display gamma calibration for a specific control

Parameters
idx int: the control to set
rgb int: RGB color calibration. Each value must be between getDisplayGammaCalibrationMin() and getDisplayGammaCalibrationMax(), inclusive.
Returns
boolean true on success, false otherwise.

public boolean setDisplayMode (DisplayMode mode, boolean makeDefault)

added in API level 8

Parameters
mode DisplayMode
makeDefault boolean
Returns
boolean true if setting the mode was successful

public boolean setPictureAdjustment (HSIC hsic)

added in API level 8

Sets the desired hue/saturation/intensity/contrast

Returns
boolean true if success

public boolean setTouchscreenGestureEnabled (TouchscreenGesture gesture, boolean state)

added in API level 8

Parameters
gesture TouchscreenGesture
state boolean
Returns
boolean true if setting the activation status was successful

public boolean setVibratorIntensity (int intensity)

added in API level 8

Set the current vibrator intensity

Parameters
intensity int: the intensity to set, between getVibratorMinIntensity() and getVibratorMaxIntensity() inclusive.
Returns
boolean true on success, false otherwise.