Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ad4600d authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

AudioTrack: offload is not tied to USAGE_MEDIA

Offload support check now supports passing AudioAttributes.
Do not require AudioTrack usage to be USAGE_MEDIA, check of use
  case will be done in AudioSystem.isOffloadSupported().

Bug: 129133576
Test: use offload for USAGE_ASSISTANT
Change-Id: I00065fb936600cfcdf29bc019173699db7ec5a2f
parent 078d4d14
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -975,13 +975,9 @@ public class AudioTrack extends PlayerBase
                    throw new UnsupportedOperationException(
                            "Offload and low latency modes are incompatible");
                }
                if (mAttributes.getUsage() != AudioAttributes.USAGE_MEDIA) {
                    throw new UnsupportedOperationException(
                            "Cannot create AudioTrack, offload requires USAGE_MEDIA");
                }
                if (!AudioSystem.isOffloadSupported(mFormat, mAttributes)) {
                    throw new UnsupportedOperationException(
                            "Cannot create AudioTrack, offload format not supported");
                            "Cannot create AudioTrack, offload format / attributes not supported");
                }
            }