Optimize kernel-to-userspace battery life across CAMSS, SPI runtime PM, dwm, NeoUI, and plugins
This commit is contained in:
1 parent
f112b6ae72
commit
456d3fbc42
61 files changed
+466
-148
No files matched your search
@@ -2052,6 +2052,12 @@ PY
|
||||
exec python3 - << 'PY'
|
||||
import datetime, os, select, socket, struct, subprocess, sys, time
|
||||
|
||||
try:
|
||||
while os.waitpid(-1, os.WNOHANG)[0] > 0:
|
||||
pass
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
AF_QIPCRTR = 42
|
||||
QRTR_PORT_CTRL = 0xfffffffe
|
||||
QRTR_TYPE_NEW_SERVER = 4
|
||||
@@ -2187,12 +2193,16 @@ def run_user_cmd(cmd_str, extra_env=None):
|
||||
env["PATH"] = "/usr/share/sxmo/default_hooks:/usr/bin:/bin:/usr/sbin:/sbin"
|
||||
if extra_env:
|
||||
env.update(extra_env)
|
||||
subprocess.Popen(
|
||||
["su", "-m", "user", "-c", f"export DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/10000 HOME=/home/user PATH=/usr/share/sxmo/default_hooks:/usr/bin:/bin:/usr/sbin:/sbin; {cmd_str}"],
|
||||
env=env,
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL
|
||||
)
|
||||
try:
|
||||
p = subprocess.Popen(
|
||||
["su", "-m", "user", "-c", f"export DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/10000 HOME=/home/user PATH=/usr/share/sxmo/default_hooks:/usr/bin:/bin:/usr/sbin:/sbin; ({cmd_str}) >/dev/null 2>&1 &"],
|
||||
env=env,
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL
|
||||
)
|
||||
p.wait(timeout=2.0)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def send_fifo(fifo_path, line):
|
||||
try:
|
||||
@@ -2795,8 +2805,10 @@ while True:
|
||||
poll_timeout = 1.0
|
||||
elif multipart_buf:
|
||||
poll_timeout = 2.0
|
||||
elif os.path.exists("/tmp/bananarchy_screen_locked"):
|
||||
poll_timeout = None
|
||||
else:
|
||||
poll_timeout = 300.0
|
||||
poll_timeout = 600.0
|
||||
r, _, _ = select.select([ws, vs], [], [], poll_timeout)
|
||||
got_voice_ind = False
|
||||
events = []
|
||||
|
||||
Reference in new issue
Block a user