sdk: Support breath LED mode
Change-Id: I9ec757a784dc3fb3afcb6f909f10e2eee86502ea
This commit is contained in:
@@ -86,6 +86,9 @@
|
||||
// RGB color values.
|
||||
LIGHTS_ADJUSTABLE_BATTERY_LED_BRIGHTNESS = 128
|
||||
|
||||
// The notification light has non-adjustable pulsing capability.
|
||||
LIGHTS_BREATHING_LED = 256
|
||||
|
||||
For example, a device with notification and battery lights that supports
|
||||
pulsating and RGB control would set this config to 75. -->
|
||||
<integer name="config_deviceLightCapabilities">8</integer>
|
||||
|
||||
@@ -44,6 +44,15 @@ public final class LightsCapabilities {
|
||||
// RGB color values.
|
||||
public static final int LIGHTS_ADJUSTABLE_BATTERY_LED_BRIGHTNESS = 128;
|
||||
|
||||
// The notification light has non-adjustable pulsing capability.
|
||||
public static final int LIGHTS_BREATHING_LED = 256;
|
||||
|
||||
public static boolean blinks(Context context) {
|
||||
final int capabilities = context.getResources().getInteger(
|
||||
org.lineageos.platform.internal.R.integer.config_deviceLightCapabilities);
|
||||
return (capabilities & (LIGHTS_PULSATING_LED | LIGHTS_BREATHING_LED)) != 0;
|
||||
}
|
||||
|
||||
public static boolean supports(Context context, final int capability) {
|
||||
final int capabilities = context.getResources().getInteger(
|
||||
org.lineageos.platform.internal.R.integer.config_deviceLightCapabilities);
|
||||
|
||||
Reference in New Issue
Block a user