Issue 6410: Test not forcing cold start

This commit is contained in:
sonora 2019-03-01 02:32:59 +01:00
parent 75eda9d559
commit c1e5307e92
2 changed files with 8 additions and 6 deletions

View file

@ -282,10 +282,11 @@ public class OsmAndLocationProvider implements SensorEventListener {
public void redownloadAGPS() { public void redownloadAGPS() {
try { try {
final LocationManager service = (LocationManager) app.getSystemService(Context.LOCATION_SERVICE); 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(); Bundle bundle = new Bundle();
service.sendExtraCommand("gps", "force_xtra_injection", bundle); service.sendExtraCommand(LocationManager.GPS_PROVIDER, "force_xtra_injection", bundle);
service.sendExtraCommand("gps", "force_time_injection", bundle); service.sendExtraCommand(LocationManager.GPS_PROVIDER, "force_time_injection", bundle);
app.getSettings().AGPS_DATA_LAST_TIME_DOWNLOADED.set(System.currentTimeMillis()); app.getSettings().AGPS_DATA_LAST_TIME_DOWNLOADED.set(System.currentTimeMillis());
} catch (Exception e) { } catch (Exception e) {
app.getSettings().AGPS_DATA_LAST_TIME_DOWNLOADED.set(0L); app.getSettings().AGPS_DATA_LAST_TIME_DOWNLOADED.set(0L);

View file

@ -135,10 +135,11 @@ public class SampleLocationProvider implements SensorEventListener {
public void redownloadAGPS() { public void redownloadAGPS() {
try { try {
final LocationManager service = (LocationManager) app.getSystemService(Context.LOCATION_SERVICE); 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(); Bundle bundle = new Bundle();
service.sendExtraCommand("gps", "force_xtra_injection", bundle); service.sendExtraCommand(LocationManager.GPS_PROVIDER, "force_xtra_injection", bundle);
service.sendExtraCommand("gps", "force_time_injection", bundle); service.sendExtraCommand(LocationManager.GPS_PROVIDER, "force_time_injection", bundle);
agpsDataLastTimeDownloaded = System.currentTimeMillis(); agpsDataLastTimeDownloaded = System.currentTimeMillis();
} catch (Exception e) { } catch (Exception e) {
agpsDataLastTimeDownloaded = 0L; agpsDataLastTimeDownloaded = 0L;