|
|
@ -278,6 +278,7 @@ def thermald_thread(end_event, hw_queue): |
|
|
|
startup_conditions["up_to_date"] = params.get("Offroad_ConnectivityNeeded") is None or params.get_bool("DisableUpdates") or params.get_bool("SnoozeUpdate") |
|
|
|
startup_conditions["up_to_date"] = params.get("Offroad_ConnectivityNeeded") is None or params.get_bool("DisableUpdates") or params.get_bool("SnoozeUpdate") |
|
|
|
startup_conditions["not_uninstalling"] = not params.get_bool("DoUninstall") |
|
|
|
startup_conditions["not_uninstalling"] = not params.get_bool("DoUninstall") |
|
|
|
startup_conditions["accepted_terms"] = params.get("HasAcceptedTerms") == terms_version |
|
|
|
startup_conditions["accepted_terms"] = params.get("HasAcceptedTerms") == terms_version |
|
|
|
|
|
|
|
startup_conditions["offroad_min_time"] = (not started_seen) or ((off_ts is not None) and (sec_since_boot() - off_ts) > 5.) |
|
|
|
|
|
|
|
|
|
|
|
# with 2% left, we killall, otherwise the phone will take a long time to boot |
|
|
|
# with 2% left, we killall, otherwise the phone will take a long time to boot |
|
|
|
startup_conditions["free_space"] = msg.deviceState.freeSpacePercent > 2 |
|
|
|
startup_conditions["free_space"] = msg.deviceState.freeSpacePercent > 2 |
|
|
@ -338,7 +339,8 @@ def thermald_thread(end_event, hw_queue): |
|
|
|
started_seen = True |
|
|
|
started_seen = True |
|
|
|
else: |
|
|
|
else: |
|
|
|
if onroad_conditions["ignition"] and (startup_conditions != startup_conditions_prev): |
|
|
|
if onroad_conditions["ignition"] and (startup_conditions != startup_conditions_prev): |
|
|
|
cloudlog.event("Startup blocked", startup_conditions=startup_conditions, onroad_conditions=onroad_conditions) |
|
|
|
cloudlog.event("Startup blocked", startup_conditions=startup_conditions, onroad_conditions=onroad_conditions, error=True) |
|
|
|
|
|
|
|
startup_conditions_prev = startup_conditions.copy() |
|
|
|
|
|
|
|
|
|
|
|
started_ts = None |
|
|
|
started_ts = None |
|
|
|
if off_ts is None: |
|
|
|
if off_ts is None: |
|
|
@ -372,7 +374,6 @@ def thermald_thread(end_event, hw_queue): |
|
|
|
pm.send("deviceState", msg) |
|
|
|
pm.send("deviceState", msg) |
|
|
|
|
|
|
|
|
|
|
|
should_start_prev = should_start |
|
|
|
should_start_prev = should_start |
|
|
|
startup_conditions_prev = startup_conditions.copy() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Log to statsd |
|
|
|
# Log to statsd |
|
|
|
statlog.gauge("free_space_percent", msg.deviceState.freeSpacePercent) |
|
|
|
statlog.gauge("free_space_percent", msg.deviceState.freeSpacePercent) |
|
|
|