@Test public void testInvalidBaseAngleData() { DownloadTask task = mock(DownloadMapDataTask.class); Map<String, Collection> data = new HashMap<String, Collection>(); deadReckoning.onDownloadFinished(task, true, data); assertTrue(0 == deadReckoning.baseAngle); deadReckoning.onDownloadFinished(task, false, data); assertTrue(0 == deadReckoning.baseAngle); List<Integer> list = new ArrayList<Integer>(); data.put(OsmParserKeys.NORTH_ANGLE, list); deadReckoning.onDownloadFinished(task, true, data); assertTrue(0 == deadReckoning.baseAngle); list.add(null); data.put(OsmParserKeys.NORTH_ANGLE, list); deadReckoning.onDownloadFinished(task, true, data); assertTrue(0 == deadReckoning.baseAngle); }
@Override public void onDownloadFinished(DownloadTask task, boolean success, Map<String, Collection> data) { if(success){ final List<Integer> northAngleList = (List<Integer>) data.get(OsmParserKeys.NORTH_ANGLE); if ((northAngleList != null) && (!northAngleList.isEmpty()) && (northAngleList.get(0) != null)) { setBaseAngle(northAngleList.get(0)); } } else { Log.e(TAG, "North angle download signals failure, so probably direction will be completely wrong."); } }
DeadReckoning implements SensorEventListener, SensorCollector, DownloadListener<Map<String, Collection>> { @Override public void onDownloadFinished(DownloadTask task, boolean success, Map<String, Collection> data) { if(success){ final List<Integer> northAngleList = (List<Integer>) data.get(OsmParserKeys.NORTH_ANGLE); if ((northAngleList != null) && (!northAngleList.isEmpty()) && (northAngleList.get(0) != null)) { setBaseAngle(northAngleList.get(0)); } } else { Log.e(TAG, "North angle download signals failure, so probably direction will be completely wrong."); } } }
DeadReckoning implements SensorEventListener, SensorCollector, DownloadListener<Map<String, Collection>> { @Override public void onDownloadFinished(DownloadTask task, boolean success, Map<String, Collection> data) { if(success){ final List<Integer> northAngleList = (List<Integer>) data.get(OsmParserKeys.NORTH_ANGLE); if ((northAngleList != null) && (!northAngleList.isEmpty()) && (northAngleList.get(0) != null)) { setBaseAngle(northAngleList.get(0)); } } else { Log.e(TAG, "North angle download signals failure, so probably direction will be completely wrong."); } } DeadReckoning(final Activity activity); }
DeadReckoning implements SensorEventListener, SensorCollector, DownloadListener<Map<String, Collection>> { @Override public void onDownloadFinished(DownloadTask task, boolean success, Map<String, Collection> data) { if(success){ final List<Integer> northAngleList = (List<Integer>) data.get(OsmParserKeys.NORTH_ANGLE); if ((northAngleList != null) && (!northAngleList.isEmpty()) && (northAngleList.get(0) != null)) { setBaseAngle(northAngleList.get(0)); } } else { Log.e(TAG, "North angle download signals failure, so probably direction will be completely wrong."); } } DeadReckoning(final Activity activity); void startSensors(); void stopSensors(); @Override void onDownloadFinished(DownloadTask task, boolean success, Map<String, Collection> data); @Override void onSensorChanged(final SensorEvent event); @Override void onAccuracyChanged(final Sensor sensor, final int accuracy); NicGeoPoint getDelta(); void setCompassFilterEnabled(boolean useLowPassFilter); void setBaseAngle(final double baseAngle); }
DeadReckoning implements SensorEventListener, SensorCollector, DownloadListener<Map<String, Collection>> { @Override public void onDownloadFinished(DownloadTask task, boolean success, Map<String, Collection> data) { if(success){ final List<Integer> northAngleList = (List<Integer>) data.get(OsmParserKeys.NORTH_ANGLE); if ((northAngleList != null) && (!northAngleList.isEmpty()) && (northAngleList.get(0) != null)) { setBaseAngle(northAngleList.get(0)); } } else { Log.e(TAG, "North angle download signals failure, so probably direction will be completely wrong."); } } DeadReckoning(final Activity activity); void startSensors(); void stopSensors(); @Override void onDownloadFinished(DownloadTask task, boolean success, Map<String, Collection> data); @Override void onSensorChanged(final SensorEvent event); @Override void onAccuracyChanged(final Sensor sensor, final int accuracy); NicGeoPoint getDelta(); void setCompassFilterEnabled(boolean useLowPassFilter); void setBaseAngle(final double baseAngle);  }