Add AudioSystem::getFrameCountHAL()
And add comments about declaring methods in binder opcode order.
Bug: 28117362
Change-Id: I3c4426fa4bb3ce9c4a207a44d3bb1103d7fef160
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index d9a19cd..ca1a0b7 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -746,6 +746,17 @@
return thread->frameCount();
}
+size_t AudioFlinger::frameCountHAL(audio_io_handle_t ioHandle) const
+{
+ Mutex::Autolock _l(mLock);
+ ThreadBase *thread = checkThread_l(ioHandle);
+ if (thread == NULL) {
+ ALOGW("frameCountHAL() unknown thread %d", ioHandle);
+ return 0;
+ }
+ return thread->frameCountHAL();
+}
+
uint32_t AudioFlinger::latency(audio_io_handle_t output) const
{
Mutex::Autolock _l(mLock);