Use AudioSystem::setLowRamDevice() to configure memory

Bug: 9798886
Change-Id: I9321e3f369f1ed9429ae222e3926ebdeb012b8b0
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h
index fb1d631..e7b85c0 100644
--- a/include/media/AudioSystem.h
+++ b/include/media/AudioSystem.h
@@ -246,6 +246,8 @@
     static uint32_t getPrimaryOutputSamplingRate();
     static size_t getPrimaryOutputFrameCount();
 
+    static status_t setLowRamDevice(bool isLowRamDevice);
+
     // Check if hw offload is possible for given format, stream type, sample rate,
     // bit rate, duration, video and streaming or offload property is enabled
     static bool isOffloadSupported(const audio_offload_info_t& info);
diff --git a/include/media/IAudioFlinger.h b/include/media/IAudioFlinger.h
index 0aa5870..de45aa8 100644
--- a/include/media/IAudioFlinger.h
+++ b/include/media/IAudioFlinger.h
@@ -197,6 +197,10 @@
     virtual uint32_t getPrimaryOutputSamplingRate() = 0;
     virtual size_t getPrimaryOutputFrameCount() = 0;
 
+    // Intended for AudioService to inform AudioFlinger of device's low RAM attribute,
+    // and should be called at most once.  For a definition of what "low RAM" means, see
+    // android.app.ActivityManager.isLowRamDevice().
+    virtual status_t setLowRamDevice(bool isLowRamDevice) = 0;
 };