From c1e5307e926b73e331fe775153cc5cb600433248 Mon Sep 17 00:00:00 2001 From: sonora Date: Fri, 1 Mar 2019 02:32:59 +0100 Subject: [PATCH] Issue 6410: Test not forcing cold start --- OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java | 7 ++++--- .../samples/android/sample1/SampleLocationProvider.java | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java b/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java index 53ef5455ac..dbf7fb8d03 100644 --- a/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java +++ b/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java @@ -282,10 +282,11 @@ public class OsmAndLocationProvider implements SensorEventListener { public void redownloadAGPS() { try { final LocationManager service = (LocationManager) app.getSystemService(Context.LOCATION_SERVICE); - service.sendExtraCommand(LocationManager.GPS_PROVIDER,"delete_aiding_data", null); + // Issue 6410: Test not forcing cold start here + //service.sendExtraCommand(LocationManager.GPS_PROVIDER,"delete_aiding_data", null); Bundle bundle = new Bundle(); - service.sendExtraCommand("gps", "force_xtra_injection", bundle); - service.sendExtraCommand("gps", "force_time_injection", bundle); + service.sendExtraCommand(LocationManager.GPS_PROVIDER, "force_xtra_injection", bundle); + service.sendExtraCommand(LocationManager.GPS_PROVIDER, "force_time_injection", bundle); app.getSettings().AGPS_DATA_LAST_TIME_DOWNLOADED.set(System.currentTimeMillis()); } catch (Exception e) { app.getSettings().AGPS_DATA_LAST_TIME_DOWNLOADED.set(0L); diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/SampleLocationProvider.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/SampleLocationProvider.java index 1c0eda2642..aa64927726 100644 --- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/SampleLocationProvider.java +++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/SampleLocationProvider.java @@ -135,10 +135,11 @@ public class SampleLocationProvider implements SensorEventListener { public void redownloadAGPS() { try { final LocationManager service = (LocationManager) app.getSystemService(Context.LOCATION_SERVICE); - service.sendExtraCommand(LocationManager.GPS_PROVIDER, "delete_aiding_data", null); + // Issue 6410: Test not forcing cold start here + //service.sendExtraCommand(LocationManager.GPS_PROVIDER, "delete_aiding_data", null); Bundle bundle = new Bundle(); - service.sendExtraCommand("gps", "force_xtra_injection", bundle); - service.sendExtraCommand("gps", "force_time_injection", bundle); + service.sendExtraCommand(LocationManager.GPS_PROVIDER, "force_xtra_injection", bundle); + service.sendExtraCommand(LocationManager.GPS_PROVIDER, "force_time_injection", bundle); agpsDataLastTimeDownloaded = System.currentTimeMillis(); } catch (Exception e) { agpsDataLastTimeDownloaded = 0L;