Skip to content

Commit d959880

Browse files
authored
Merge pull request #16 from neochapay/halium-11.0
Fixup charger mode for Halium 11
2 parents c8c8eaa + 789a44a commit d959880

7 files changed

Lines changed: 40 additions & 0 deletions

File tree

BoardConfig.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ TARGET_USERIMAGES_USE_EXT4 := true
4646
# HIDL
4747
DEVICE_FRAMEWORK_MANIFEST_FILE := $(DEVICE_PATH)/framework_manifest.xml
4848

49+
# Offline charging
50+
BOARD_CHARGER_ENABLE_SUSPEND := true
51+
BOARD_CHARGER_DISABLE_INIT_BLANK := true
52+
BOARD_HEALTHD_CUSTOM_CHARGER_RES := true
53+
4954
# Partitions
5055
TARGET_COPY_OUT_VENDOR := vendor
5156
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true

charger/images/battery_fail.png

4.17 KB
Loading

charger/images/battery_scale.png

13.6 KB
Loading

charger/images/main_font.png

10 KB
Loading

charger/values/animation.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# animation: num_cycles, first_frame_repeats, animation_file
2+
animation: 5 1 charger/battery_scale
3+
4+
# fail: animation_file
5+
fail: charger/battery_fail
6+
7+
# percent_display: text_percent_pos_x, text_percent_pos_y, color_b, color_g, color_r, color_a, font_file
8+
percent_display: c c 255 255 255 255 charger/main_font
9+
10+
# frame: disp_time min_level max_level
11+
frame: 750 0 19
12+
frame: 750 0 39
13+
frame: 750 0 59
14+
frame: 750 0 79
15+
frame: 750 80 95
16+
frame: 750 0 100

device.mk

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
# limitations under the License.
1515
#
1616

17+
# Charger
18+
PRODUCT_COPY_FILES += \
19+
$(LOCAL_PATH)/charger/images/battery_fail.png:$(TARGET_COPY_OUT_ROOT)/res/images/charger/battery_fail.png \
20+
$(LOCAL_PATH)/charger/images/battery_scale.png:$(TARGET_COPY_OUT_ROOT)/res/images/charger/battery_scale.png \
21+
$(LOCAL_PATH)/charger/images/main_font.png:$(TARGET_COPY_OUT_ROOT)/res/images/charger/main_font.png \
22+
$(LOCAL_PATH)/charger/values/animation.txt:$(TARGET_COPY_OUT_ROOT)/res/values/charger/animation.txt
23+
1724
# Enable dynamic partition size
1825
PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true
1926

@@ -48,3 +55,7 @@ PRODUCT_PRODUCT_PROPERTIES := ro.apex.updatable=false
4855
# Soong
4956
PRODUCT_SOONG_NAMESPACES += \
5057
$(LOCAL_PATH)
58+
59+
# healthd for chargermode
60+
PRODUCT_PACKAGES += \
61+
healthd

rootdir/etc/init.halium.rc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,11 @@ on post-fs-data
4040
on property:sys.boot_completed=1
4141
write /dev/wcnss_wlan 1
4242
write /sys/module/wlan/parameters/fwpath sta
43+
44+
on charger
45+
start charger
46+
47+
service charger /sbin/charger
48+
class charger
49+
group system graphics wakelock
50+
capabilities BLOCK_SUSPEND SYS_ADMIN SYS_BOOT

0 commit comments

Comments
 (0)