AudioFlinger: Create Client callback

Test: atest AudioTrackTest AudioRecordTest
Test: Camera YouTube
Bug: 291319167
Merged-In: I09328a818726b2dcf6c68247643eae4ec4cb48b8
Change-Id: I09328a818726b2dcf6c68247643eae4ec4cb48b8
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index 84cceb6..3cfb87d 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -276,7 +276,7 @@
     mCblkMemory.clear();    // free the shared memory before releasing the heap it belongs to
     if (mClient != 0) {
         // Client destructor must run with AudioFlinger client mutex locked
-        Mutex::Autolock _l(mClient->audioFlinger()->mClientLock);
+        Mutex::Autolock _l(mClient->afClientCallback()->clientMutex());
         // If the client's reference count drops to zero, the associated destructor
         // must run with AudioFlinger lock held. Thus the explicit clear() rather than
         // relying on the automatic clear() at end of scope.
@@ -1680,7 +1680,7 @@
     auto dstThread = thread->asIAfPlaybackThread();
     // srcThread is initialized by call to moveAuxEffectToIo()
     sp<IAfPlaybackThread> srcThread;
-    sp<AudioFlinger> af = mClient->audioFlinger();
+    const auto& af = mClient->afClientCallback();
     status_t status = af->moveAuxEffectToIo(EffectId, dstThread, &srcThread);
 
     if (EffectId != 0 && status == NO_ERROR) {