Move the voice and telemetry disabling calls from onStop to onDestroy
so that a stopped application only leaves off updating the screen, and
not the voice bits as well.
Signed-off-by: Keith Packard <keithp@keithp.com>
switch (msg.what) {
case MSG_STATE:
- AltosDebug.debug("MSG_STATE");
if (msg.obj == null) {
AltosDebug.debug("telemetry_state null!");
return;
ad.update_state((TelemetryState) msg.obj);
break;
case MSG_UPDATE_AGE:
- AltosDebug.debug("MSG_UPDATE_AGE");
ad.update_age();
break;
}
public void onStop() {
super.onStop();
AltosDebug.debug("-- ON STOP --");
-
- doUnbindService();
- if (mAltosVoice != null) {
- mAltosVoice.stop();
- mAltosVoice = null;
- }
}
@Override
super.onDestroy();
AltosDebug.debug("--- ON DESTROY ---");
- if (mAltosVoice != null) mAltosVoice.stop();
+ doUnbindService();
+ if (mAltosVoice != null) {
+ mAltosVoice.stop();
+ mAltosVoice = null;
+ }
stop_timer();
}