Fix SoundPool.play() looping

This is done by configuring SoundPool for shared memory and fast track.
Previously SoundPool used a streaming track, and looping in streaming
mode relied on the ability to loop the most recently enqueued data.
That 'feature' was lost in the new implementation of streaming, so we're
now switching from streaming mode to shared memory mode.  Shared memory
mode had always been desired, but was blocked by bug 2801375 which is fixed now.

Bug: 10171337
Change-Id: I2a938e3ffafa2a74d5210b4198b50db20ad5da0e
diff --git a/media/libmedia/SoundPool.cpp b/media/libmedia/SoundPool.cpp
index 7f10e05..0985164 100644
--- a/media/libmedia/SoundPool.cpp
+++ b/media/libmedia/SoundPool.cpp
@@ -18,7 +18,7 @@
 #define LOG_TAG "SoundPool"
 #include <utils/Log.h>
 
-//#define USE_SHARED_MEM_BUFFER
+#define USE_SHARED_MEM_BUFFER
 
 #include <media/AudioTrack.h>
 #include <media/mediaplayer.h>
@@ -602,7 +602,7 @@
         // do not create a new audio track if current track is compatible with sample parameters
 #ifdef USE_SHARED_MEM_BUFFER
         newTrack = new AudioTrack(streamType, sampleRate, sample->format(),
-                channels, sample->getIMemory(), AUDIO_OUTPUT_FLAG_NONE, callback, userData);
+                channels, sample->getIMemory(), AUDIO_OUTPUT_FLAG_FAST, callback, userData);
 #else
         newTrack = new AudioTrack(streamType, sampleRate, sample->format(),
                 channels, frameCount, AUDIO_OUTPUT_FLAG_FAST, callback, userData,