AudioRecord: Allow to share capture history.
Add the possibility for privileged applications to share part of their audio capture history with another app. A privileged app with permission CAPTURE_AUDIO_HOTWORD can share part of its recent capture history on a given AudioRecord with the following steps: 1) Specify the maximum time in the past that will be available for other apps by calling setMaxSharedAudioHistoryMillis() on the AudioRecord.Builder when creating the AudioRecord 2) Start recording and determine where the other app should start capturing in the past. 3) Call AudioRecord.shareAudioHistory() with the package name of the app the history will be shared with and the intended start time for this app's capture relative to this AudioRecord's start time. 4) Communicate the MediaSyncEvent returned by shareAudioHistory() to the other app 5) The other app will use the MediaSyncEvent when creating its AudioRecord by calling setSharedAudioEvent() on the AudioRecord.Builder. 6) Only after the other app has started capturing can this app stop capturing and release its AudioRecord. Bug: 183705547 Test: regression on capture use cases Change-Id: I5beba6c1e489148a14ba86165b8ef2fdc78c802a
Loading
Please register or sign in to comment