OSDN Git Service

Remove unnecessary friend declarations
authorGlenn Kasten <gkasten@google.com>
Fri, 9 Mar 2012 20:07:30 +0000 (12:07 -0800)
committerGlenn Kasten <gkasten@google.com>
Fri, 9 Mar 2012 20:18:48 +0000 (12:18 -0800)
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

index 2e259c0..a38d48b 100644 (file)
@@ -64,7 +64,7 @@ class AudioFlinger :
     public BinderService<AudioFlinger>,
     public BnAudioFlinger
 {
-    friend class BinderService<AudioFlinger>;
+    friend class BinderService<AudioFlinger>;   // 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<EffectChain>& 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<PlaybackThread::Track> 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<String16>& 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<String16>& 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