summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioFlinger.h
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-07-15 14:45:07 -0700
committerGlenn Kasten <gkasten@google.com>2013-07-19 09:30:37 -0700
commit4182c4e2a07e2441fcd5c22eaff0ddfe7f826f61 (patch)
treec7ed5d9b71f919bf664dd0cb6cbdd1c3de2f9241 /services/audioflinger/AudioFlinger.h
parent0d61251648b5110bfc33ef5b3d19bbf65db0a7b5 (diff)
downloadframeworks_av-4182c4e2a07e2441fcd5c22eaff0ddfe7f826f61.zip
frameworks_av-4182c4e2a07e2441fcd5c22eaff0ddfe7f826f61.tar.gz
frameworks_av-4182c4e2a07e2441fcd5c22eaff0ddfe7f826f61.tar.bz2
Use AudioSystem::setLowRamDevice() to configure memory
Bug: 9798886 Change-Id: I9321e3f369f1ed9429ae222e3926ebdeb012b8b0
Diffstat (limited to 'services/audioflinger/AudioFlinger.h')
-rw-r--r--services/audioflinger/AudioFlinger.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 2df9173..f31619b 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -220,6 +220,8 @@ public:
virtual uint32_t getPrimaryOutputSamplingRate();
virtual size_t getPrimaryOutputFrameCount();
+ virtual status_t setLowRamDevice(bool isLowRamDevice);
+
virtual status_t onTransact(
uint32_t code,
const Parcel& data,
@@ -623,6 +625,15 @@ public:
static const size_t kTeeSinkTrackFramesDefault = 0x1000;
#endif
+ // This method reads from a variable without mLock, but the variable is updated under mLock. So
+ // we might read a stale value, or a value that's inconsistent with respect to other variables.
+ // In this case, it's safe because the return value isn't used for making an important decision.
+ // The reason we don't want to take mLock is because it could block the caller for a long time.
+ bool isLowRamDevice() const { return mIsLowRamDevice; }
+
+private:
+ bool mIsLowRamDevice;
+ bool mIsDeviceTypeKnown;
};
#undef INCLUDING_FROM_AUDIOFLINGER_H