|
|
|
@ -52,25 +52,26 @@ def main(): |
|
|
|
|
cloudlog.event("android service pid changed", proc=p, cur=cur[p], prev=procs[p]) |
|
|
|
|
procs.update(cur) |
|
|
|
|
|
|
|
|
|
# check modem state |
|
|
|
|
state = get_modem_state() |
|
|
|
|
if state != modem_state and not modem_killed: |
|
|
|
|
cloudlog.event("modem state changed", state=state) |
|
|
|
|
modem_state = state |
|
|
|
|
if os.path.exists(MODEM_PATH): |
|
|
|
|
# check modem state |
|
|
|
|
state = get_modem_state() |
|
|
|
|
if state != modem_state and not modem_killed: |
|
|
|
|
cloudlog.event("modem state changed", state=state) |
|
|
|
|
modem_state = state |
|
|
|
|
|
|
|
|
|
# check modem crashes |
|
|
|
|
cnt = get_modem_crash_count() |
|
|
|
|
if cnt is not None: |
|
|
|
|
if cnt > crash_count: |
|
|
|
|
cloudlog.event("modem crash", count=cnt) |
|
|
|
|
crash_count = cnt |
|
|
|
|
# check modem crashes |
|
|
|
|
cnt = get_modem_crash_count() |
|
|
|
|
if cnt is not None: |
|
|
|
|
if cnt > crash_count: |
|
|
|
|
cloudlog.event("modem crash", count=cnt) |
|
|
|
|
crash_count = cnt |
|
|
|
|
|
|
|
|
|
# handle excessive modem crashes |
|
|
|
|
if crash_count > MAX_MODEM_CRASHES and not modem_killed: |
|
|
|
|
cloudlog.event("killing modem") |
|
|
|
|
with open("/sys/kernel/debug/msm_subsys/modem", "w") as f: |
|
|
|
|
f.write("put") |
|
|
|
|
modem_killed = True |
|
|
|
|
# handle excessive modem crashes |
|
|
|
|
if crash_count > MAX_MODEM_CRASHES and not modem_killed: |
|
|
|
|
cloudlog.event("killing modem") |
|
|
|
|
with open("/sys/kernel/debug/msm_subsys/modem", "w") as f: |
|
|
|
|
f.write("put") |
|
|
|
|
modem_killed = True |
|
|
|
|
|
|
|
|
|
time.sleep(1) |
|
|
|
|
|
|
|
|
|