mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-11 20:32:13 +08:00
handle exception in android service call
old-commit-hash: b857f65de873d94a91aaeac8f16dda5aa3854409
This commit is contained in:
+6
-4
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user