From 2caf62a12b3607be848ff747fde162f61c01918b Mon Sep 17 00:00:00 2001 From: Paul Keith Date: Fri, 5 May 2017 15:03:18 -0500 Subject: [PATCH] update-binary: Selectively remove Google's SuW * This is done based on the total memory as reported by /proc/meminfo * If the memory in the MemTotal field is less than 1572864 kB (1.5 GB), then Google's SuW is removed as a precaution, as it is known to crash on devices that don't have much memory available to use * Thanks to cdesai for the solution idea Change-Id: If0d5b9dff7f9536f78d4069df8665b19209fea52 Signed-off-by: Paul Keith --- build/meta/com/google/android/update-binary | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build/meta/com/google/android/update-binary b/build/meta/com/google/android/update-binary index 5e76f04..fffa165 100644 --- a/build/meta/com/google/android/update-binary +++ b/build/meta/com/google/android/update-binary @@ -53,10 +53,17 @@ if [ -d /system/lib64 ]; then LD_PATH=/system/lib64 fi +LOWMEM=1572864 +MEM=`cat /proc/meminfo | head -1 | sed 's/[^0-9]*//g'` + ui_print "Extracting files" cd /tmp unzip -o "$ZIP" system/* cd system +if [ "$MEM" -lt "$LOWMEM" ]; then + ui_print "Low RAM device detected, removing Google SuW" + exec_util "rm -rf priv-app/SetupWizard" +fi ui_print "Generating addon.d file" cat addon.d/addond_head > addon.d/30-gapps.sh for f in `exec_util "find . -type f"`; do