Skip to content

Commit

Permalink
Add plugin for tracking battery state via statefs
Browse files Browse the repository at this point in the history
Performs similar task as existing battery_bme and battery_upower plugins,
but gets the battery data from files maintained by the statefs service.

Checks presense of required propery files in /run/state/namespaces/Battery
directory on mce startup. If files are not present, or become not available
later on due to stopping and/or restarting of statefs service, periodic
checks are made to detect when they come available again.

While the files available, the battery level, status and charging activity
state changes are tracked and pushed to datapipes in the form existing mce
logic is expecting.

[mce] Add plugin for tracking battery state via statefs. Contributes to JB#6273
  • Loading branch information
spiiroin committed Jan 25, 2015
1 parent 9bba2ff commit 1bcdf97
Show file tree
Hide file tree
Showing 3 changed files with 1,343 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .depend
Expand Up @@ -392,6 +392,18 @@ modules/battery-bme.pic.o:\
mce-log.h\
mce.h\

modules/battery-statefs.o:\
modules/battery-statefs.c\
datapipe.h\
mce-log.h\
mce.h\

modules/battery-statefs.pic.o:\
modules/battery-statefs.c\
datapipe.h\
mce-log.h\
mce.h\

modules/battery-upower.o:\
modules/battery-upower.c\
builtin-gconf.h\
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Expand Up @@ -152,6 +152,7 @@ MODULES += $(MODULE_DIR)/memnotify.so
MODULES += $(MODULE_DIR)/battery-bme.so
MODULES += $(MODULE_DIR)/battery-upower.so
MODULES += $(MODULE_DIR)/bluetooth.so
MODULES += $(MODULE_DIR)/battery-statefs.so
MODULES += $(MODULE_DIR)/display.so
MODULES += $(MODULE_DIR)/usbmode.so
MODULES += $(MODULE_DIR)/doubletap.so
Expand Down Expand Up @@ -551,6 +552,7 @@ NORMALIZE_USES_SPC =\
modetransition.h\
modules/audiorouting.c\
modules/battery-upower.c\
modules/battery-statefs.c\
modules/bluetooth.c\
modules/callstate.c\
modules/callstate.h\
Expand Down

0 comments on commit 1bcdf97

Please sign in to comment.