Fix search logcat error when device time is not synced to server time
properly

Change-Id: Id94748fb107b640dbc6f655380c86572eabeeeed
diff --git a/acts/framework/acts/test_utils/gnss/gnss_test_utils.py b/acts/framework/acts/test_utils/gnss/gnss_test_utils.py
index 31545f3..7fd9c94 100644
--- a/acts/framework/acts/test_utils/gnss/gnss_test_utils.py
+++ b/acts/framework/acts/test_utils/gnss/gnss_test_utils.py
@@ -161,6 +161,8 @@
     set_wifi_and_bt_scanning(ad, True)
     reboot(ad)
     disable_private_dns_mode(ad)
+    utils.sync_device_time(ad)
+    tutils.set_phone_silent_mode(ad.log, ad)
 
 def connect_to_wifi_network(ad, network):
     """Connection logic for open and psk wifi networks.
@@ -425,7 +427,6 @@
     if ad.skip_sl4a:
         return status
     tutils.bring_up_sl4a(ad)
-    set_gnss_qxdm_mask(ad, QXDM_MASKS)
     return status
 
 def clear_aiding_data_by_gtw_gpstool(ad):
@@ -468,8 +469,6 @@
     """
     retries = 3
     for i in range(retries):
-        ad.stop_adb_logcat()
-        ad.start_adb_logcat()
         begin_time = get_current_epoch_time()
         clear_aiding_data_by_gtw_gpstool(ad)
         ad.log.info("Start GNSS on GTW_GPSTool - attempt %d" % (i+1))
@@ -488,8 +487,8 @@
                 start_gnss_by_gtw_gpstool(ad, False)
                 return False
             time.sleep(1)
-            if not ad.is_adb_logcat_on:
-                ad.start_adb_logcat()
+        if not ad.is_adb_logcat_on:
+            ad.start_adb_logcat()
         start_gnss_by_gtw_gpstool(ad, False)
     ad.log.error("Test Abort. DUT can't get location fixed within %d attempts."
                  % retries)
diff --git a/acts/tests/google/gnss/GNSSSanityTest.py b/acts/tests/google/gnss/GNSSSanityTest.py
index 2b28589..5bd6583 100644
--- a/acts/tests/google/gnss/GNSSSanityTest.py
+++ b/acts/tests/google/gnss/GNSSSanityTest.py
@@ -64,6 +64,7 @@
 
     def setup_test(self):
         gutils.clear_logd_gnss_qxdm_log(self.ad)
+        utils.sync_device_time(self.ad)
 
     def teardown_test(self):
         tutils.stop_qxdm_logger(self.ad)
@@ -367,6 +368,7 @@
         begin_time = get_current_epoch_time()
         tutils.start_qxdm_logger(self.ad, begin_time)
         gutils.kill_xtra_daemon(self.ad)
+        self.ad.droid.setMediaVolume(25)
         if not gutils.process_gnss_by_gtw_gpstool(self.ad, self.supl_cs_criteria):
             return False
         gutils.start_ttff_by_gtw_gpstool(self.ad, ttff_mode="cs", iteration=10)