Enable FastTrack timestamps

Bug: 26413951
Change-Id: Id54c32cb0f0be83d443f6cf1007181ebc461c586
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index b719046..536581c 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -596,6 +596,20 @@
     return mAudioTrackServerProxy->framesReleased();
 }
 
+void AudioFlinger::PlaybackThread::Track::onTimestamp(const AudioTimestamp &timestamp)
+{
+    // This call comes from a FastTrack and should be kept lockless.
+    // The server side frames are already translated to client frames.
+
+    ExtendedTimestamp ets;
+    ets.mTimeNs[ExtendedTimestamp::LOCATION_KERNEL] =
+            timestamp.mTime.tv_sec * 1000000000LL + timestamp.mTime.tv_nsec;
+    ets.mPosition[ExtendedTimestamp::LOCATION_KERNEL] = timestamp.mPosition;
+
+    // Caution, this doesn't set the timebase for BOOTTIME properly, but is ignored right now.
+    mAudioTrackServerProxy->setTimestamp(ets);
+}
+
 // Don't call for fast tracks; the framesReady() could result in priority inversion
 bool AudioFlinger::PlaybackThread::Track::isReady() const {
     if (mFillingUpStatus != FS_FILLING || isStopped() || isPausing()) {
@@ -1438,9 +1452,8 @@
         return;
     }
 
-    mAudioRecordServerProxy = new AudioRecordServerProxy(mCblk, mBuffer, frameCount,
+    mServerProxy = new AudioRecordServerProxy(mCblk, mBuffer, frameCount,
             mFrameSize, !isExternalTrack());
-    mServerProxy = mAudioRecordServerProxy;
 
     mResamplerBufferProvider = new ResamplerBufferProvider(this);
 
@@ -1594,7 +1607,7 @@
             local.mPosition[i] = relativeTrackFrames + trackFramesReleased;
         }
     }
-    mAudioRecordServerProxy->setExtendedTimestamp(local);
+    mServerProxy->setTimestamp(local);
 }
 
 AudioFlinger::RecordThread::PatchRecord::PatchRecord(RecordThread *recordThread,