diff options
author | Svet Ganov <svetoslavganov@google.com> | 2018-01-16 07:37:58 -0800 |
---|---|---|
committer | Svet Ganov <svetoslavganov@google.com> | 2018-01-18 00:17:52 -0800 |
commit | f4ddfefc8ba59a8486d91826154cc9447821409e (patch) | |
tree | b24bb43846003ef5523f0d470e49389086138679 /services/audioflinger/RecordTracks.h | |
parent | d6be64a3f22be3eceb0d6209c88dcad573c08191 (diff) | |
download | frameworks_av-f4ddfefc8ba59a8486d91826154cc9447821409e.tar.gz frameworks_av-f4ddfefc8ba59a8486d91826154cc9447821409e.tar.bz2 frameworks_av-f4ddfefc8ba59a8486d91826154cc9447821409e.zip |
Don't record audio if UID is idle - media framework
To protect user's privacy if a UID is in an idle state we allow
recording but report silence (all zeros in the byte array) and once
the process goes in an active state we report the real mic data.
This avoids the race between the app being notified aboout its
lifecycle and the audio system being notified about the state
of a UID.
Test: Added - AudioRecordTest#testRecordNoDataForIdleUids
Passing - cts-tradefed run cts-dev -m CtsMediaTestCases
-t android.media.cts.AudioRecordTest
bug:63938985
Change-Id: I1442a9dda1553e9ea7a4a654c50555ac1ec06aa0
Diffstat (limited to 'services/audioflinger/RecordTracks.h')
-rw-r--r-- | services/audioflinger/RecordTracks.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/services/audioflinger/RecordTracks.h b/services/audioflinger/RecordTracks.h index f8da7805d2..63a3d9882d 100644 --- a/services/audioflinger/RecordTracks.h +++ b/services/audioflinger/RecordTracks.h @@ -63,6 +63,9 @@ public: virtual bool isFastTrack() const { return (mFlags & AUDIO_INPUT_FLAG_FAST) != 0; } + void setSilenced(bool silenced) { mSilenced = silenced; } + bool isSilenced() const { return mSilenced; } + private: friend class AudioFlinger; // for mState @@ -91,6 +94,8 @@ private: // used by the record thread to convert frames to proper destination format RecordBufferConverter *mRecordBufferConverter; audio_input_flags_t mFlags; + + bool mSilenced; }; // playback track, used by PatchPanel |