From 1998661fdb6b0b5ae103e047e3d653c5da1b99e3 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Fri, 9 Mar 2012 12:07:30 -0800 Subject: [PATCH] Remove unnecessary friend declarations Add comments to the remaining friends, so we know what is left if we decide to remove them later. Change-Id: I1de929257dc4700960f77902cda3d303177c72cf --- services/audioflinger/AudioFlinger.h | 52 +++++++----------------------------- 1 file changed, 10 insertions(+), 42 deletions(-) diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h index 2e259c0623..a38d48b241 100644 --- a/services/audioflinger/AudioFlinger.h +++ b/services/audioflinger/AudioFlinger.h @@ -64,7 +64,7 @@ class AudioFlinger : public BinderService, public BnAudioFlinger { - friend class BinderService; + friend class BinderService; // for AudioFlinger() public: static const char* getServiceName() { return "media.audio_flinger"; } @@ -331,13 +331,6 @@ private: int sessionId() const { return mSessionId; } protected: - friend class ThreadBase; - friend class RecordHandle; - friend class PlaybackThread; - friend class RecordThread; - friend class MixerThread; - friend class DirectOutputThread; - TrackBase(const TrackBase&); TrackBase& operator = (const TrackBase&); @@ -523,15 +516,7 @@ private: // check if some effects must be suspended when an effect chain is added void checkSuspendOnAddEffectChain_l(const sp& chain); - friend class AudioFlinger; - friend class Track; - friend class TrackBase; - friend class PlaybackThread; - friend class MixerThread; - friend class DirectOutputThread; - friend class DuplicatingThread; - friend class RecordThread; - friend class RecordTrack; + friend class AudioFlinger; // for mEffectChains const type_t mType; @@ -646,8 +631,7 @@ private: int auxEffectId() const { return mAuxEffectId; } protected: - friend class ThreadBase; - friend class TrackHandle; + // for numerous friend class PlaybackThread; friend class MixerThread; friend class DirectOutputThread; @@ -676,7 +660,9 @@ private: return (mStreamType == AUDIO_STREAM_CNT); } + public: virtual bool isTimedTrack() const { return false; } + protected: // we don't really need a lock for these volatile bool mMute; @@ -922,13 +908,7 @@ public: private: - friend class AudioFlinger; - friend class OutputTrack; - friend class Track; - friend class TrackBase; - friend class MixerThread; - friend class DirectOutputThread; - friend class DuplicatingThread; + friend class AudioFlinger; // for numerous PlaybackThread(const Client&); PlaybackThread& operator = (const PlaybackThread&); @@ -1100,8 +1080,6 @@ private: PlaybackThread *primaryPlaybackThread_l() const; uint32_t primaryOutputDevice_l() const; - friend class AudioBuffer; - // server side of the client's IAudioTrack class TrackHandle : public android::BnAudioTrack { public: @@ -1126,10 +1104,6 @@ private: const sp mTrack; }; - friend class Client; - friend class PlaybackThread::Track; - - void removeClient_l(pid_t pid); void removeNotificationClient(pid_t pid); @@ -1160,8 +1134,7 @@ private: void dump(char* buffer, size_t size); private: - friend class AudioFlinger; - friend class RecordThread; + friend class AudioFlinger; // for mState RecordTrack(const RecordTrack&); RecordTrack& operator = (const RecordTrack&); @@ -1343,8 +1316,7 @@ private: status_t dump(int fd, const Vector& args); protected: - friend class EffectHandle; - friend class AudioFlinger; + friend class AudioFlinger; // for mHandles bool mPinned; // Maximum time allocated to effect engines to complete the turn off sequence @@ -1428,8 +1400,7 @@ mutable Mutex mLock; // mutex for process, commands and handl void dump(char* buffer, size_t size); protected: - friend class AudioFlinger; - friend class EffectModule; + friend class AudioFlinger; // for mEffect, mHasControl, mEnabled EffectHandle(const EffectHandle&); EffectHandle& operator =(const EffectHandle&); @@ -1527,7 +1498,7 @@ mutable Mutex mLock; // mutex for process, commands and handl status_t dump(int fd, const Vector& args); protected: - friend class AudioFlinger; + friend class AudioFlinger; // for mThread, mEffects EffectChain(const EffectChain&); EffectChain& operator =(const EffectChain&); @@ -1603,9 +1574,6 @@ mutable Mutex mLock; // mutex for process, commands and handl int mCnt; }; - friend class RecordThread; - friend class PlaybackThread; - enum master_volume_support { // MVS_NONE: // Audio HAL has no support for master volume, either setting or -- 2.11.0