From e83ade5c1862567fa6d7ade37ee24d340f00d076 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 1 Aug 2023 13:38:08 -0700 Subject: [PATCH] rawgpsd: accept alt assistance file (#29202) Co-authored-by: Comma Device old-commit-hash: 42e106dd476b0831048bac9654cb3471911200ca --- system/sensord/rawgps/rawgpsd.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/system/sensord/rawgps/rawgpsd.py b/system/sensord/rawgps/rawgpsd.py index 829d7bed08..54106ca2f9 100755 --- a/system/sensord/rawgps/rawgpsd.py +++ b/system/sensord/rawgps/rawgpsd.py @@ -6,6 +6,7 @@ import itertools import math import time import pycurl +import shutil import subprocess from datetime import datetime from multiprocessing import Process, Event @@ -145,6 +146,10 @@ def downloader_loop(event): if os.path.exists(ASSIST_DATA_FILE): os.remove(ASSIST_DATA_FILE) + alt_path = os.getenv("QCOM_ALT_ASSISTANCE_PATH", None) + if alt_path is not None and os.path.exists(alt_path): + shutil.copyfile(alt_path, ASSIST_DATA_FILE) + try: while not os.path.exists(ASSIST_DATA_FILE) and not event.is_set(): download_assistance()