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.
This commit is contained in:
Preetam D'Souza 2018-09-08 19:58:05 -04:00 committed by Paul Keith
parent 22c6cfbee8
commit ae1ceeaccc

View File

@ -129,7 +129,9 @@ for dirs in $DIRS; do
done
ui_print "Copying files"
exec_util "cp --preserve=a -r ./* /system/"
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/"