SoundPool: fix fcntl argument

Fixes flakiness introduced by commit 77eb2bda0e

Test: android.media.cts.SoundPoolAacTest
Test: android.media.cts.SoundPoolHapticTest
Test: android.media.cts.SoundPoolMidiTest
Test: android.media.cts.SoundPoolOggTest
Test: android.media.cts.AudioManagerTest#testSoundEffects
Bug: 157924783
Change-Id: I8371c93337852424e2b47a17e5a19a1caaf2600f
This commit is contained in:
Andy Hung
2020-06-01 14:49:26 -07:00
parent 7360685765
commit 09e865b694

View File

@@ -31,7 +31,7 @@ constexpr size_t kDefaultHeapSize = 1024 * 1024; // 1MB (compatible with low m
Sound::Sound(int32_t soundID, int fd, int64_t offset, int64_t length)
: mSoundID(soundID)
, mFd(fcntl(fd, F_DUPFD_CLOEXEC)) // like dup(fd) but closes on exec to prevent leaks.
, mFd(fcntl(fd, F_DUPFD_CLOEXEC, (int)0 /* arg */)) // dup(fd) + close on exec to prevent leaks.
, mOffset(offset)
, mLength(length)
{