Skip to content

Commit

Permalink
Recorder: grant read permissions for apps requesting recordings
Browse files Browse the repository at this point in the history
Recorder is already properly handling requests to record audio
and return the file as Uri.

However, we also need to explicitly grand read permissions for the
Uri, otherwise the requesting app can not use the recording.

  E MediaPlayerService: Couldn't open fd for content://0@media/external_primary/audio/media/1000000046
  E MediaPlayerNative: Unable to create media player
  E ByodPresentMediaDialog: Cannot play given audio with media player.
  E ByodPresentMediaDialog: java.io.IOException: setDataSource failed.: status=0x80000000

Test: CTS-Verifier - https://source.android.com/docs/compatibility/cts/verifier
  - BYOD Managed Provisioning
    - Start BYOD provisioning flow
    - Sound recorder support cross profile audio capture
Test: manualTests#com.android.cts.verifier.managedprovisioning.ByodFlowTestActivity
Change-Id: Ic107d21ae309a425842b94eeea11c614e3357bbe
Signed-off-by: Alexander Martinz <[email protected]>
  • Loading branch information
amartinz committed Nov 7, 2024
1 parent ac8a68d commit e223eb3
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ class RecorderActivity : AppCompatActivity(R.layout.activity_main) {

private fun confirmLastResult() {
val resultIntent = Intent().setData(preferencesManager.lastItemUri)
.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
setResult(RESULT_OK, resultIntent)
finish()
}
Expand Down

0 comments on commit e223eb3

Please sign in to comment.