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

Commit ceedc87e authored by Andy Hung's avatar Andy Hung Committed by Android (Google) Code Review
Browse files

Merge "audioserver: impose memory restrictions"

parents 8bdef6aa 21052719
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -15,6 +15,7 @@ LOCAL_SHARED_LIBRARIES := \
	liblog \
	liblog \
	libhidltransport \
	libhidltransport \
	libhwbinder \
	libhwbinder \
	libmedia \
	libmedialogservice \
	libmedialogservice \
	libnbaio \
	libnbaio \
	libsoundtriggerservice \
	libsoundtriggerservice \
@@ -35,6 +36,7 @@ LOCAL_C_INCLUDES := \
	frameworks/av/media/libaaudio/include \
	frameworks/av/media/libaaudio/include \
	frameworks/av/media/libaaudio/src \
	frameworks/av/media/libaaudio/src \
	frameworks/av/media/libaaudio/src/binding \
	frameworks/av/media/libaaudio/src/binding \
	frameworks/av/media/libmedia \
	$(call include-path-for, audio-utils) \
	$(call include-path-for, audio-utils) \
	external/sonic \
	external/sonic \


+7 −0
Original line number Original line Diff line number Diff line
@@ -35,12 +35,19 @@
#include "AAudioService.h"
#include "AAudioService.h"
#include "utility/AAudioUtilities.h"
#include "utility/AAudioUtilities.h"
#include "MediaLogService.h"
#include "MediaLogService.h"
#include "MediaUtils.h"
#include "SoundTriggerHwService.h"
#include "SoundTriggerHwService.h"


using namespace android;
using namespace android;


int main(int argc __unused, char **argv)
int main(int argc __unused, char **argv)
{
{
    // TODO: update with refined parameters
    limitProcessMemory(
        "audio.maxmem", /* "ro.audio.maxmem", property that defines limit */
        (size_t)512 * (1 << 20), /* SIZE_MAX, upper limit in bytes */
        20 /* upper limit as percentage of physical RAM */);

    signal(SIGPIPE, SIG_IGN);
    signal(SIGPIPE, SIG_IGN);


    bool doLog = (bool) property_get_bool("ro.test_harness", 0);
    bool doLog = (bool) property_get_bool("ro.test_harness", 0);