AudioTrack: Fix timestamp startup condition

Suppress timestamps without valid kernel information or
a server update.

Update timing of server timestamp location to better indicate
when the server pull occurs.

Update write timing logic to suppress unneeded time calls
and to ensure proper throttling.

Bug: 28771691
Change-Id: I2cd25dad638ca1d0b1355d87d175d908f3bddb26
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index f206f5c..1963da3 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -2390,6 +2390,9 @@
                     } else {
                         timestamp.mPosition = (uint32_t)(ets.mPosition[location] - frames);
                     }
+                } else if (location == ExtendedTimestamp::LOCATION_KERNEL) {
+                    ALOGV_IF(mPreviousLocation == ExtendedTimestamp::LOCATION_SERVER,
+                            "getTimestamp() location moved from server to kernel");
                 }
                 mPreviousLocation = location;
             } else {