Skip to content

Commit

Permalink
wahoo: enable battery led and multicolor notif/battery leds
Browse files Browse the repository at this point in the history
* Updated comments with latest lights capabilities.

Change-Id: I445277aeebccd8bf6b0897d51d6a0c29d173828c
  • Loading branch information
Beanstown authored and Eamo5 committed Aug 5, 2020
1 parent 742bd41 commit 2381073
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
2 changes: 1 addition & 1 deletion liblight/lights.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
/*
* Change this to 1 to support battery notifications via BatteryService
*/
#define LIGHTS_SUPPORT_BATTERY 0
#define LIGHTS_SUPPORT_BATTERY 1
#define CG_COLOR_ID_PROPERTY "ro.boot.hardware.color"

static pthread_once_t g_init = PTHREAD_ONCE_INIT;
Expand Down
66 changes: 66 additions & 0 deletions overlay-lineage/lineage-sdk/lineage/res/res/values/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright (C) 2016 The CyanogenMod Project
** Copyright (C) 2017-2018 The LineageOS Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->

<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

<!-- All the capabilities of the LEDs on this device, stored as a bit field.
This integer should equal the sum of the corresponding value for each
of the following capabilities present:
// Device has a color adjustable battery light.
LIGHTS_RGB_NOTIFICATION_LED = 1
// Device has a color adjustable notification light.
LIGHTS_RGB_BATTERY_LED = 2
LIGHTS_MULTIPLE_NOTIFICATION_LED = 4 (deprecated)
// The notification light has adjustable pulsing capability.
LIGHTS_PULSATING_LED = 8
// Device has a multi-segment battery light that is able to
// use the light brightness value to determine how many
// segments to show (in order to represent battery level).
LIGHTS_SEGMENTED_BATTERY_LED = 16
// The notification light supports HAL adjustable brightness
// via the alpha channel.
// Note: if a device notification light supports LIGHTS_RGB_NOTIFICATION_LED
// then HAL support is not necessary for brightness control. In this case,
// brightness support will be provided by lineage-sdk through the scaling of
// RGB color values.
LIGHTS_ADJUSTABLE_NOTIFICATION_LED_BRIGHTNESS = 32
// Device has a battery light.
LIGHTS_BATTERY_LED = 64
// The battery light supports HAL adjustable brightness via
// the alpha channel.
// Note: if a device battery light supports LIGHTS_RGB_BATTERY_LED then HAL
// support is not necessary for brightness control. In this case,
// brightness support will be provided by lineage-sdk through the scaling of
// RGB color values.
LIGHTS_ADJUSTABLE_BATTERY_LED_BRIGHTNESS = 128
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">75</integer>

</resources>

0 comments on commit 2381073

Please sign in to comment.