| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -2,6 +2,7 @@ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import os | 
					 | 
					 | 
					 | 
					import os | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import datetime | 
					 | 
					 | 
					 | 
					import datetime | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import psutil | 
					 | 
					 | 
					 | 
					import psutil | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					import time | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					from smbus2 import SMBus | 
					 | 
					 | 
					 | 
					from smbus2 import SMBus | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					from cereal import log | 
					 | 
					 | 
					 | 
					from cereal import log | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					from common.android import ANDROID, get_network_type, get_network_strength | 
					 | 
					 | 
					 | 
					from common.android import ANDROID, get_network_type, get_network_strength | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -409,7 +410,9 @@ def thermald_thread(): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    # Check if we need to shut down | 
					 | 
					 | 
					 | 
					    # Check if we need to shut down | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if pm.should_shutdown(health, off_ts, started_seen, LEON): | 
					 | 
					 | 
					 | 
					    if pm.should_shutdown(health, off_ts, started_seen, LEON): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      cloudlog.info(f"shutting device down, offroad for {off_ts}") | 
					 | 
					 | 
					 | 
					      cloudlog.info(f"shutting device down, offroad since {off_ts}") | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      # TODO: add function for blocking cloudlog instead of sleep | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      time.sleep(10) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      os.system('LD_LIBRARY_PATH="" svc power shutdown') | 
					 | 
					 | 
					 | 
					      os.system('LD_LIBRARY_PATH="" svc power shutdown') | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    msg.thermal.chargingError = current_filter.x > 0. and msg.thermal.batteryPercent < 90  # if current is positive, then battery is being discharged | 
					 | 
					 | 
					 | 
					    msg.thermal.chargingError = current_filter.x > 0. and msg.thermal.batteryPercent < 90  # if current is positive, then battery is being discharged | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |