Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9a9d279 authored by Yifan Hong's avatar Yifan Hong
Browse files

charger: Allow to rw /sys/power/[state,wakeup_count]

charger needs to suspend the device when the power goes away
when it doesn't have root. These two files are marked with
group system, user system, mode 0600 in 'on boot', but
it is not executed in charger. Hence, move these actions
to 'on init'.

Test: no failure in libsuspend in charger

Bug: 129138950

Change-Id: I787b935b4ff6177601329aeedccdac361b119ca3
parent 723c4df5
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -280,6 +280,11 @@ on init
    write /dev/cpu_variant:${ro.bionic.2nd_arch} ${ro.bionic.2nd_cpu_variant}
    chmod 0444 /dev/cpu_variant:${ro.bionic.2nd_arch}

    # Allow system processes to read / write power state.
    chown system system /sys/power/state
    chown system system /sys/power/wakeup_count
    chmod 0660 /sys/power/state

    # Start logd before any other services run to ensure we capture all of their logs.
    start logd

@@ -671,11 +676,8 @@ on boot
    chown radio system /sys/android_power/acquire_partial_wake_lock
    chown radio system /sys/android_power/release_wake_lock
    chown system system /sys/power/autosleep
    chown system system /sys/power/state
    chown system system /sys/power/wakeup_count
    chown radio wakelock /sys/power/wake_lock
    chown radio wakelock /sys/power/wake_unlock
    chmod 0660 /sys/power/state
    chmod 0660 /sys/power/wake_lock
    chmod 0660 /sys/power/wake_unlock