Add external setParameter to audioflinger dumpsys

Apps are not expected to send any setParameter, system should only send
very few keys. This log can help verify what is bypassing audioflinger
control.

Only the first 1024 characters are logged per SimpleLog limitation
to avoid high memory retention in the privilege audio service
in case very big strings are sent.

Thus in the worst case around 60*1*3=180kB can be consumed in Audioflinger
by those logs (aka: no app memory deny of service).

Test: adb shell dumpsys media.audio_flinger
Change-Id: Ida9c21be9d20528f67a63eddf6ca7a6c962c7cc2
Signed-off-by: Kevin Rocard <krocard@google.com>
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index e9e6e94..cc277c3 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -811,6 +811,9 @@
     status_t    checkStreamType(audio_stream_type_t stream) const;
 
     void        filterReservedParameters(String8& keyValuePairs, uid_t callingUid);
+    void        logFilteredParameters(size_t originalKVPSize, const String8& originalKVPs,
+                                      size_t rejectedKVPSize, const String8& rejectedKVPs,
+                                      uid_t callingUid);
 
 public:
     // These methods read variables atomically without mLock,
@@ -831,7 +834,11 @@
     PatchPanel mPatchPanel;
     sp<EffectsFactoryHalInterface> mEffectsFactoryHal;
 
-    bool        mSystemReady;
+    bool       mSystemReady;
+
+    SimpleLog  mRejectedSetParameterLog;
+    SimpleLog  mAppSetParameterLog;
+    SimpleLog  mSystemSetParameterLog;
 };
 
 #undef INCLUDING_FROM_AUDIOFLINGER_H