diff options
| author | Keith Packard <keithp@keithp.com> | 2015-07-11 19:17:40 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2015-07-11 19:17:40 -0700 | 
| commit | b64ab2a8a25b0c22443bc77829c7f35b4f1c2455 (patch) | |
| tree | aa912a6c7d46d4ade47dfa10d6e828c3458aad72 | |
| parent | d015cfc1499a263549f52d46e9e5b934fcb94f53 (diff) | |
altosdroid: Keep speaking even when screen is off
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>
| -rw-r--r-- | altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java | 14 | 
1 files changed, 5 insertions, 9 deletions
| diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java index b87b51b5..3a5026ee 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java @@ -133,7 +133,6 @@ public class AltosDroid extends FragmentActivity implements AltosUnitsListener {  			switch (msg.what) {  			case MSG_STATE: -				AltosDebug.debug("MSG_STATE");  				if (msg.obj == null) {  					AltosDebug.debug("telemetry_state null!");  					return; @@ -141,7 +140,6 @@ public class AltosDroid extends FragmentActivity implements AltosUnitsListener {  				ad.update_state((TelemetryState) msg.obj);  				break;  			case MSG_UPDATE_AGE: -				AltosDebug.debug("MSG_UPDATE_AGE");  				ad.update_age();  				break;  			} @@ -691,12 +689,6 @@ public class AltosDroid extends FragmentActivity implements AltosUnitsListener {  	public void onStop() {  		super.onStop();  		AltosDebug.debug("-- ON STOP --"); - -		doUnbindService(); -		if (mAltosVoice != null) { -			mAltosVoice.stop(); -			mAltosVoice = null; -		}  	}  	@Override @@ -704,7 +696,11 @@ public class AltosDroid extends FragmentActivity implements AltosUnitsListener {  		super.onDestroy();  		AltosDebug.debug("--- ON DESTROY ---"); -		if (mAltosVoice != null) mAltosVoice.stop(); +		doUnbindService(); +		if (mAltosVoice != null) { +			mAltosVoice.stop(); +			mAltosVoice = null; +		}  		stop_timer();  	} | 
