diff options
author | Ayaz Ahmad <aahmad@codeaurora.org> | 2013-07-30 16:43:36 +0530 |
---|---|---|
committer | Ayaz Ahmad <aahmad@codeaurora.org> | 2013-07-31 16:56:12 +0530 |
commit | 4b4d145e75a858339af75f556e8b3a6bbacf5831 (patch) | |
tree | 0810d013fa9b19283652937471a8442250048879 /FMRecord | |
parent | f8ed8d21eccd947913cde7a86701257ae46ba806 (diff) | |
download | android_hardware_qcom_fm-4b4d145e75a858339af75f556e8b3a6bbacf5831.tar.gz android_hardware_qcom_fm-4b4d145e75a858339af75f556e8b3a6bbacf5831.tar.bz2 android_hardware_qcom_fm-4b4d145e75a858339af75f556e8b3a6bbacf5831.zip |
FM: Added recording option on RF Stats activity
- Added recording button on action bar to start/stop
recording from RF Stats activity
Change-Id: I81b614d3731be47ff794c67622adb08fe81bff43
Diffstat (limited to 'FMRecord')
-rw-r--r-- | FMRecord/src/com/codeaurora/fmrecording/FMRecordingService.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/FMRecord/src/com/codeaurora/fmrecording/FMRecordingService.java b/FMRecord/src/com/codeaurora/fmrecording/FMRecordingService.java index 2b0d00a..4657e36 100644 --- a/FMRecord/src/com/codeaurora/fmrecording/FMRecordingService.java +++ b/FMRecord/src/com/codeaurora/fmrecording/FMRecordingService.java @@ -75,10 +75,10 @@ public class FMRecordingService extends Service { private File mSampleFile = null; private MediaRecorder mRecorder = null; - long mSampleStart = 0; + private long mSampleStart = 0; static final int START = 1; static final int STOP = 0; - + private int mRecordDuration = -1; public void onCreate() { super.onCreate(); @@ -220,6 +220,8 @@ public class FMRecordingService extends Service { mRecorder = new MediaRecorder(); try { mRecorder.setMaxFileSize(maxFileSize); + if(mRecordDuration >= 0) + mRecorder.setMaxDuration(mRecordDuration); } catch (RuntimeException exception) { } @@ -459,6 +461,7 @@ public class FMRecordingService extends Service { Log.d(TAG, "ACTION_FM_RECORDING Intent received" +state); if (state == START) { Log.d(TAG, "Recording start"); + mRecordDuration = intent.getIntExtra("record_duration", mRecordDuration); startRecord(); } else if (state == STOP) { Log.d(TAG, "Stop recording"); |