Refresh the charge icon immediately on charger plug/unplug
This commit is contained in:
1 parent
6a6222c198
commit
eaf08abcd4
9 files changed
+159
-6
No files matched your search
@@ -1180,6 +1180,31 @@ if command -v g++ >/dev/null 2>&1 && \
|
||||
fail "host Bluetooth scan parser test failed"
|
||||
fi
|
||||
|
||||
echo "[check] Charger plug/unplug charge icon..."
|
||||
BATTERY_RULES="$BASE_DIR/overlay/rootfs/etc/udev/rules.d/85-bananarchy-battery.rules"
|
||||
CHARGE_EVENT="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-battery-charge-event.sh"
|
||||
if [ ! -x "$CHARGE_EVENT" ] || ! sh -n "$CHARGE_EVENT" 2>/dev/null; then
|
||||
fail "bananarchy-battery-charge-event.sh is missing or has bad syntax"
|
||||
fi
|
||||
if ! grep -q 'bananarchy-battery-charge-event.sh' "$BATTERY_RULES" || \
|
||||
! grep -q 'KERNEL=="pm8916-lbc-chgr"' "$BATTERY_RULES" || \
|
||||
! grep -q 'POWER_SUPPLY_ONLINE' "$BATTERY_RULES"; then
|
||||
fail "battery udev rules no longer force a charge icon refresh on VBUS events"
|
||||
fi
|
||||
if ! grep -q '"$HOOK" force' "$CHARGE_EVENT" || \
|
||||
! grep -q 'flock -n 9' "$CHARGE_EVENT"; then
|
||||
fail "charger event helper no longer forces and coalesces icon refreshes"
|
||||
fi
|
||||
if ! grep -q 'bananarchy-battery-charge-event.sh' \
|
||||
"$BASE_DIR/scripts/apply-bananarchy-overlay.sh"; then
|
||||
fail "apply-bananarchy-overlay.sh no longer installs the charger event helper"
|
||||
fi
|
||||
if [ -x "$BASE_DIR/scripts/test-battery-charge-event.py" ] && \
|
||||
command -v python3 >/dev/null 2>&1 && \
|
||||
! "$BASE_DIR/scripts/test-battery-charge-event.py" >/dev/null 2>&1; then
|
||||
fail "host charger plug/unplug event test failed"
|
||||
fi
|
||||
|
||||
if [ "$FAILURES" -ne 0 ]; then
|
||||
echo "[check] $FAILURES check(s) failed."
|
||||
exit 1
|
||||
|
||||
Reference in new issue
Block a user