SetupWizard: exit_wizard.sh: Don't throw errors

* Instead of showing an exception when exiting the SuW via the script,
  check if we have to enable and run the Google SuW stuff and only do
  it then

Change-Id: I628e1ee40a97db9af1975825f059227446a9ee18
This commit is contained in:
Michael W
2022-03-20 13:42:50 +01:00
parent 08d08bed26
commit 563a38c121

View File

@@ -2,12 +2,19 @@
adb root adb root
wait ${!} wait ${!}
has_google_suw=$(adb shell pm list packages com.google.android.setupwizard)
adb shell pm enable org.lineageos.setupwizard/org.lineageos.setupwizard.SetupWizardExitActivity || true adb shell pm enable org.lineageos.setupwizard/org.lineageos.setupwizard.SetupWizardExitActivity || true
if [[ ! -z "$has_google_suw" ]]
then
wait ${!} wait ${!}
adb shell pm enable com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardExitActivity || true adb shell pm enable com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardExitActivity || true
wait ${!} wait ${!}
fi
sleep 1 sleep 1
adb shell am start org.lineageos.setupwizard/org.lineageos.setupwizard.SetupWizardExitActivity || true adb shell am start org.lineageos.setupwizard/org.lineageos.setupwizard.SetupWizardExitActivity || true
if [[ ! -z "$has_google_suw" ]]
then
wait ${!} wait ${!}
sleep 1 sleep 1
adb shell am start com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardExitActivity adb shell am start com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardExitActivity
fi