diff options
Diffstat (limited to 'main/src/cgeo/geocaching/speech/SpeechService.java')
-rw-r--r-- | main/src/cgeo/geocaching/speech/SpeechService.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/main/src/cgeo/geocaching/speech/SpeechService.java b/main/src/cgeo/geocaching/speech/SpeechService.java index fbd2d7e..b22e061 100644 --- a/main/src/cgeo/geocaching/speech/SpeechService.java +++ b/main/src/cgeo/geocaching/speech/SpeechService.java @@ -1,10 +1,11 @@ package cgeo.geocaching.speech; +import cgeo.geocaching.Intents; import cgeo.geocaching.R; import cgeo.geocaching.activity.ActivityMixin; -import cgeo.geocaching.geopoint.Geopoint; +import cgeo.geocaching.location.Geopoint; +import cgeo.geocaching.sensors.GeoData; import cgeo.geocaching.sensors.GeoDirHandler; -import cgeo.geocaching.sensors.IGeoData; import cgeo.geocaching.settings.Settings; import cgeo.geocaching.utils.Log; @@ -31,7 +32,6 @@ public class SpeechService extends Service implements OnInitListener { private static final int SPEECH_MINPAUSE_SECONDS = 5; private static final int SPEECH_MAXPAUSE_SECONDS = 30; - private static final String EXTRA_TARGET_COORDS = "target"; private static Activity startingActivity; private static boolean isRunning = false; /** @@ -47,7 +47,7 @@ public class SpeechService extends Service implements OnInitListener { final GeoDirHandler geoDirHandler = new GeoDirHandler() { @Override - public void updateGeoDir(final IGeoData newGeo, final float newDirection) { + public void updateGeoDir(final GeoData newGeo, final float newDirection) { position = newGeo.getCoords(); direction = newDirection; // avoid any calculation, if the delay since the last output is not long enough @@ -152,11 +152,12 @@ public class SpeechService extends Service implements OnInitListener { @Override public int onStartCommand(final Intent intent, final int flags, final int startId) { if (intent != null) { - target = intent.getParcelableExtra(EXTRA_TARGET_COORDS); + target = intent.getParcelableExtra(Intents.EXTRA_COORDS); } return START_NOT_STICKY; // service can be stopped by system, if under memory pressure } + @SuppressWarnings("deprecation") private void speak(final String text) { if (!initialized) { return; @@ -168,7 +169,7 @@ public class SpeechService extends Service implements OnInitListener { isRunning = true; startingActivity = activity; final Intent talkingService = new Intent(activity, SpeechService.class); - talkingService.putExtra(EXTRA_TARGET_COORDS, dstCoords); + talkingService.putExtra(Intents.EXTRA_COORDS, dstCoords); activity.startService(talkingService); } |