handle exception in android service call

pull/2157/head
Adeeb Shihadeh 2020-09-11 13:45:41 -07:00
parent dd6a2b8dc2
commit b857f65de8
1 changed files with 6 additions and 4 deletions

View File

@ -13,12 +13,14 @@ NetworkStrength = log.ThermalData.NetworkStrength
def service_call(call):
ret = subprocess.check_output(["service", "call", *call], encoding='utf8').strip()
if 'Parcel' not in ret:
try:
ret = subprocess.check_output(["service", "call", *call], encoding='utf8').strip()
if 'Parcel' not in ret:
return None
return parse_service_call_bytes(ret)
except subprocess.CalledProcessError:
return None
return parse_service_call_bytes(ret)
def parse_service_call_unpack(r, fmt):
try: