Browse Source

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 <[email protected]>
Paul Keith 8 năm trước cách đây
mục cha
commit
2caf62a12b
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  1. 7 0
      build/meta/com/google/android/update-binary

+ 7 - 0
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