summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/TrackBase.h
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2019-08-20 15:42:04 -0700
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-10-11 18:50:35 +0000
commit59ec67efa6b0941113f5a160aed00529e612d0fe (patch)
tree90e0f48fde7d3f07367b62be0c2f98527fc327d6 /services/audioflinger/TrackBase.h
parentbcb57f62b0f75630a5c1199c78f5af311934b6ce (diff)
downloadframeworks_av-59ec67efa6b0941113f5a160aed00529e612d0fe.tar.gz
frameworks_av-59ec67efa6b0941113f5a160aed00529e612d0fe.tar.bz2
frameworks_av-59ec67efa6b0941113f5a160aed00529e612d0fe.zip
AudioFlinger: enforce OP_RECORD_AUDIO during recording
Fix issue where RecordTrack silencing didn't silence the full buffer: the memset to 0 was using the RecordThread frame size, not the RecordTrack frame size. OP_RECORD_AUDIO was only enforced at the start of a recording which would fail if not granted. This patch silences the recording (i.e. silence is recorded instead) when it is lost, and undoes that when granted again. This requires: - propagating the package name of the client to the RecordTrack class - registering an appOp callback in RecordTrack (through a new OpRecordAudioMonitor class) to (un)silence the recording - update the isSilenced() method to take into account the appOp. Bug: 138968594 Bug: 138636979 Test: run app that records audio, then "adb shell appops __pack_name__ 27 2" and verify recording is silent after that. Change-Id: Ib33f5b592185a67204997213bab1ac2594d90d37 (cherry picked from commit ddf87effa4d80f413a80fde861f73877ccd80599) Merged-In: Ib33f5b592185a67204997213bab1ac2594d90d37 (cherry picked from commit 7307293e8befafa12b244b74cd3c8cb84b27997c)
Diffstat (limited to 'services/audioflinger/TrackBase.h')
-rw-r--r--services/audioflinger/TrackBase.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/services/audioflinger/TrackBase.h b/services/audioflinger/TrackBase.h
index 8f720b58d5..65589e2dda 100644
--- a/services/audioflinger/TrackBase.h
+++ b/services/audioflinger/TrackBase.h
@@ -215,6 +215,8 @@ protected:
uint32_t channelCount() const { return mChannelCount; }
+ size_t frameSize() const { return mFrameSize; }
+
audio_channel_mask_t channelMask() const { return mChannelMask; }
virtual uint32_t sampleRate() const { return mSampleRate; }