summaryrefslogtreecommitdiffstats
path: root/fmapp/src/com/codeaurora/fmradio/FMRadioService.java
diff options
context:
space:
mode:
Diffstat (limited to 'fmapp/src/com/codeaurora/fmradio/FMRadioService.java')
-rw-r--r--fmapp/src/com/codeaurora/fmradio/FMRadioService.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/fmapp/src/com/codeaurora/fmradio/FMRadioService.java b/fmapp/src/com/codeaurora/fmradio/FMRadioService.java
index e15117d..b3a2b42 100644
--- a/fmapp/src/com/codeaurora/fmradio/FMRadioService.java
+++ b/fmapp/src/com/codeaurora/fmradio/FMRadioService.java
@@ -297,6 +297,7 @@ public class FMRadioService extends Service
if (state == RECORD_START) {
Log.d(LOGTAG, "FM Recording started");
mFmRecordingOn = true;
+ mSampleStart = SystemClock.elapsedRealtime();
try {
if ((mServiceInUse) && (mCallbacks != null) ) {
Log.d(LOGTAG, "start recording thread");
@@ -315,6 +316,7 @@ public class FMRadioService extends Service
} catch (RemoteException e) {
e.printStackTrace();
}
+ mSampleStart = 0;
}
}
}
@@ -691,6 +693,14 @@ public class FMRadioService extends Service
private void sendRecordIntent(int action) {
Intent intent = new Intent(ACTION_FM_RECORDING);
intent.putExtra("state", action);
+ if(action == RECORD_START) {
+ int mRecordDuration = -1;
+ if(FmSharedPreferences.getRecordDuration() !=
+ FmSharedPreferences.RECORD_DUR_INDEX_3_VAL) {
+ mRecordDuration = (FmSharedPreferences.getRecordDuration() * 60 * 1000);
+ }
+ intent.putExtra("record_duration", mRecordDuration);
+ }
Log.d(LOGTAG, "Sending Recording intent for = " +action);
getApplicationContext().sendBroadcast(intent);
}
@@ -1470,6 +1480,10 @@ private Runnable mSpeakerDisableTask = new Runnable() {
{
return (mService.get().setRxRepeatCount(count));
}
+ public long getRecordingStartTime()
+ {
+ return (mService.get().getRecordingStartTime());
+ }
}
private final IBinder mBinder = new ServiceStub(this);
@@ -2930,6 +2944,9 @@ private Runnable mSpeakerDisableTask = new Runnable() {
return false;
}
+ public long getRecordingStartTime() {
+ return mSampleStart;
+ }
//handling the sleep and record stop when FM App not in focus
private void delayedStop(long duration, int nType) {
int whatId = (nType == STOP_SERVICE) ? STOPSERVICE_ONSLEEP: STOPRECORD_ONTIMEOUT;