How can I enable my Android app to allow screen recording apps to record it's internal audio?

I’d like my Android app to allow screen recording apps to record it’s internal audio. What steps do I need to take to make this work?

In case someone else finds this.

Constraining capture by other apps
You can configure an app to prevent other apps from capturing its audio. The audio coming from an app can be captured only if the app meets these requirements:

Usage
The player producing the audio must set its usage to USAGE_MEDIA, USAGE_GAME, or USAGE_UNKNOWN.

Capture policy
The player’s capture policy must be AudioAttributes.ALLOW_CAPTURE_BY_ALL, which allows other apps to capture playback. This can be done in a number of ways:

If these prerequisites are met, any audio produced by the player can be captured.

Note: The ability for an app’s audio to be captured also depends on the app’s targetSdkVersion.

  • By default, apps that target versions up to and including to Android 9.0 do not permit playback capture. To enable it, include android:allowAudioPlaybackCapture=“true” in the app’s manifest.xml file.
  • By default, apps that target Android 10 (API level 29) or higher allow their audio to be captured. To disable playback capture, include android:allowAudioPlaybackCapture=“false” in the app’s manifest.xml file.