AudioFlinger: Move vibration methods to afutils

Test: atest AudioRecordTest AudioTrackTest
Test: Camera YouTube
Bug: 182392769
Bug: 292018229
Merged-In: Ifeda24e9f887db48642ce4230c08a4acefa4330c
Change-Id: Ifeda24e9f887db48642ce4230c08a4acefa4330c
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index eb6b4f3..1d4767b 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -97,6 +97,7 @@
 #include <afutils/DumpTryLock.h>
 #include <afutils/Permission.h>
 #include <afutils/TypedLogger.h>
+#include <afutils/Vibrator.h>
 
 // ----------------------------------------------------------------------------
 
@@ -2816,7 +2817,7 @@
             // Unlock due to VibratorService will lock for this call and will
             // call Tracks.mute/unmute which also require thread's lock.
             mLock.unlock();
-            const os::HapticScale intensity = AudioFlinger::onExternalVibrationStart(
+            const os::HapticScale intensity = afutils::onExternalVibrationStart(
                     track->getExternalVibration());
             std::optional<media::AudioVibratorInfo> vibratorInfo;
             {
@@ -4633,7 +4634,7 @@
             mLock.unlock();
             // Unlock due to VibratorService will lock for this call and will
             // call Tracks.mute/unmute which also require thread's lock.
-            AudioFlinger::onExternalVibrationStop(track->getExternalVibration());
+            afutils::onExternalVibrationStop(track->getExternalVibration());
             mLock.lock();
 
             // When the track is stop, set the haptic intensity as MUTE