From ae1ceeacccb476b265ae476379e0d256c7a73410 Mon Sep 17 00:00:00 2001 From: Preetam D'Souza Date: Sat, 8 Sep 2018 19:58:05 -0400 Subject: [PATCH] Remove Provision only if installing SetupWizard On devices with low memory or storage, the update-binary skips installation of SetupWizard, which normally overrides AOSP's Provision app. Unfortunately, the script currently removes the Provision app even when SetupWizard is not installed in the low memory or storage case, which causes the device to remain stuck in an unprovisioned state (Home button doesn't work for example). Tests ----- Tested on Nexus 5 (hammerhead) with LOW_STORAGE and confirmed that the Provision app is not removed since SetupWizard is not installed. Confirmed that the Play store works. Tested on Nexus 5X (bullhead) which is not LOW_STORAGE and confirmed that the Provision app is removed since SetupWizard is installed. Confirmed that the Play store works. --- build/meta/com/google/android/update-binary | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/meta/com/google/android/update-binary b/build/meta/com/google/android/update-binary index fe53057..693288a 100644 --- a/build/meta/com/google/android/update-binary +++ b/build/meta/com/google/android/update-binary @@ -129,7 +129,9 @@ for dirs in $DIRS; do done ui_print "Copying files" exec_util "cp --preserve=a -r ./* /system/" -exec_util "rm -rf /system/priv-app/Provision/" +if [ -e priv-app/SetupWizard ] ; then + exec_util "rm -rf /system/priv-app/Provision/" +fi ui_print "Cleaning up files" cd ../ exec_util "rm -rf system/"