Wait for the ACTION_FINISHED broadcast before finishing the Activity. This prevents the Setup Wizard from being re-launched when it is still set as the default home screen, which it continues to be until the exit worker changes as part of its finishSetupWizard call. Skip SetupWizardExitActivity during the normal finish process, moving common exit operations to SetupWizardUtils. Change-Id: I1c59553e7dcaf934fb81dce9bf901ec0f2bb7b59
21 lines
666 B
Bash
Executable File
21 lines
666 B
Bash
Executable File
#!/bin/bash
|
|
|
|
adb root
|
|
wait ${!}
|
|
has_google_suw=$(adb shell pm list packages com.google.android.setupwizard)
|
|
adb shell pm enable org.lineageos.setupwizard/org.lineageos.setupwizard.FinishActivity || true
|
|
if [[ ! -z "$has_google_suw" ]]
|
|
then
|
|
wait ${!}
|
|
adb shell pm enable com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardExitActivity || true
|
|
wait ${!}
|
|
fi
|
|
sleep 1
|
|
adb shell am start org.lineageos.setupwizard/org.lineageos.setupwizard.FinishActivity || true
|
|
if [[ ! -z "$has_google_suw" ]]
|
|
then
|
|
wait ${!}
|
|
sleep 1
|
|
adb shell am start com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardExitActivity
|
|
fi
|