diff options
author | Dibyendu Roy <dibyen@codeaurora.org> | 2015-12-03 12:21:53 +0530 |
---|---|---|
committer | Arne Coucheron <arco68@gmail.com> | 2016-03-22 00:14:17 +0100 |
commit | 10d0ec6f98f1149cd67d760f2198177ee8f8d873 (patch) | |
tree | 39a1570cdbff07424db9dbb6c2d4a1e90595a3a7 /fmapp2 | |
parent | 97cca41851acb2d101f20fc4632cbf6ee476d7a9 (diff) | |
download | android_hardware_qcom_fm-10d0ec6f98f1149cd67d760f2198177ee8f8d873.tar.gz android_hardware_qcom_fm-10d0ec6f98f1149cd67d760f2198177ee8f8d873.tar.bz2 android_hardware_qcom_fm-10d0ec6f98f1149cd67d760f2198177ee8f8d873.zip |
FM: Fix ANR due to incorrect error handling in stopRecording
stopRecording() API gets called from onRecordingStopped() callback
function. As a result, when recording can't be stopped successfully
in error scenarios, stopRecording() gets called in loop.
This fix removes the call stopRecording() from callback function and
does the required UI update.
CRs-Fixed: 943288
Change-Id: I0e2ea2adeb0c603f16541d04a5a244bc1fcd51d7
Diffstat (limited to 'fmapp2')
-rw-r--r-- | fmapp2/src/com/caf/fmradio/FMRadio.java | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/fmapp2/src/com/caf/fmradio/FMRadio.java b/fmapp2/src/com/caf/fmradio/FMRadio.java index 78d3b64..5a9920a 100644 --- a/fmapp2/src/com/caf/fmradio/FMRadio.java +++ b/fmapp2/src/com/caf/fmradio/FMRadio.java @@ -1820,15 +1820,6 @@ public class FMRadio extends Activity } private void stopRecording() { - mRecording = false; - DebugToasts("Stopped Recording", Toast.LENGTH_SHORT); - if(null != mRecordUpdateHandlerThread) { - mRecordUpdateHandlerThread.interrupt(); - } - if(null != mRecordingMsgTV) { - mRecordingMsgTV.setText(""); - setRecordingStartImage(); - } if (mService != null) { try { mService.stopRecording(); @@ -1836,7 +1827,6 @@ public class FMRadio extends Activity e.printStackTrace(); } } - invalidateOptionsMenu(); } private boolean isRecording() { @@ -3220,7 +3210,15 @@ public class FMRadio extends Activity } public void onRecordingStopped() { Log.d(LOGTAG, "mServiceCallbacks.onRecordingStopped:"); - stopRecording(); + mRecording = false; + if(null != mRecordUpdateHandlerThread) { + mRecordUpdateHandlerThread.interrupt(); + } + if(null != mRecordingMsgTV) { + mRecordingMsgTV.setText(""); + setRecordingStartImage(); + } + invalidateOptionsMenu(); } public void onRecordingStarted() { |