diff --git a/Android.bp b/Android.bp
index 51ca78b..18f8fdd 100644
--- a/Android.bp
+++ b/Android.bp
@@ -21,7 +21,6 @@
 
     static_libs: [
         "androidx.activity_activity",
-        "androidx.work_work-runtime-ktx",
         "SettingsLib",
         "setupcompat",
         "setupdesign",
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 69a15f3..e710633 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -324,9 +324,5 @@
                 <category android:name="android.intent.category.DEFAULT" />
             </intent-filter>
         </receiver>
-
-        <service
-            android:name=".SetupWizardExitWorker"
-            android:exported="false" />
     </application>
 </manifest>
diff --git a/res/raw/lineage_wizard_script.xml b/res/raw/lineage_wizard_script.xml
index 0befc2b..ac4f5a8 100644
--- a/res/raw/lineage_wizard_script.xml
+++ b/res/raw/lineage_wizard_script.xml
@@ -16,6 +16,7 @@
     <WizardAction
         wizard:uri="intent:#Intent;action=org.lineageos.setupwizard.LINEAGE_WELCOME;end"
         id="welcome">
+        <result wizard:name="skip" wizard:resultCode="1" />
         <result wizard:action="locale" />
     </WizardAction>
 
diff --git a/res/raw/lineage_wizard_script_managed_profile.xml b/res/raw/lineage_wizard_script_managed_profile.xml
index 6a4d1e5..36f80c6 100644
--- a/res/raw/lineage_wizard_script_managed_profile.xml
+++ b/res/raw/lineage_wizard_script_managed_profile.xml
@@ -11,6 +11,7 @@
     <WizardAction
         wizard:uri="intent:#Intent;action=org.lineageos.setupwizard.LINEAGE_WELCOME;end"
         id="welcome">
+        <result wizard:name="skip" wizard:resultCode="1" />
         <result wizard:action="restore" />
     </WizardAction>
 
diff --git a/res/raw/lineage_wizard_script_user.xml b/res/raw/lineage_wizard_script_user.xml
index aef7f2e..f0ff14e 100644
--- a/res/raw/lineage_wizard_script_user.xml
+++ b/res/raw/lineage_wizard_script_user.xml
@@ -10,6 +10,7 @@
     <WizardAction
         wizard:uri="intent:#Intent;action=org.lineageos.setupwizard.LINEAGE_WELCOME;end"
         id="welcome">
+        <result wizard:name="skip" wizard:resultCode="1" />
         <result wizard:action="restore" />
     </WizardAction>
 
diff --git a/src/org/lineageos/setupwizard/BaseSetupWizardActivity.java b/src/org/lineageos/setupwizard/BaseSetupWizardActivity.java
index b0e52d5..5a64abb 100644
--- a/src/org/lineageos/setupwizard/BaseSetupWizardActivity.java
+++ b/src/org/lineageos/setupwizard/BaseSetupWizardActivity.java
@@ -10,15 +10,11 @@
 
 import static com.google.android.setupcompat.util.ResultCodes.RESULT_SKIP;
 
-import static org.lineageos.setupwizard.SetupWizardApp.ACTION_SETUP_COMPLETE;
 import static org.lineageos.setupwizard.SetupWizardApp.LOGV;
 
 import android.annotation.NonNull;
 import android.annotation.Nullable;
-import android.content.BroadcastReceiver;
-import android.content.Context;
 import android.content.Intent;
-import android.content.IntentFilter;
 import android.graphics.drawable.Drawable;
 import android.net.wifi.WifiManager;
 import android.os.Bundle;
@@ -50,18 +46,6 @@
 
     private NavigationLayout mNavigationBar;
 
-    private final BroadcastReceiver finishReceiver = new BroadcastReceiver() {
-        @Override
-        public void onReceive(Context context, Intent intent) {
-            if (ACTION_SETUP_COMPLETE.equals(intent.getAction())) {
-                if (BaseSetupWizardActivity.this instanceof FinishActivity) return;
-                if (mNavigationBar != null) {
-                    // hide the activity's view, so it does not pop up again
-                    mNavigationBar.getRootView().setVisibility(INVISIBLE);
-                }
-            }
-        }
-    };
     private final ActivityResultLauncher<Intent> activityResultLauncher = registerForActivityResult(
             new ActivityResultContracts.StartActivityForResult(),
             BaseSetupWizardActivity.this::onActivityResult);
@@ -72,7 +56,6 @@
             logActivityState("onCreate savedInstanceState=" + savedInstanceState);
         }
         super.onCreate(savedInstanceState);
-        registerReceiver(finishReceiver, new IntentFilter(ACTION_SETUP_COMPLETE));
         initLayout();
         mNavigationBar = getNavigationBar();
         if (mNavigationBar != null) {
@@ -136,7 +119,6 @@
         if (LOGV) {
             logActivityState("onDestroy");
         }
-        unregisterReceiver(finishReceiver);
         super.onDestroy();
     }
 
@@ -253,7 +235,7 @@
         finish();
     }
 
-    protected final void nextAction(int resultCode) {
+    public final void nextAction(int resultCode) {
         nextAction(resultCode, null);
     }
 
diff --git a/src/org/lineageos/setupwizard/FinishActivity.java b/src/org/lineageos/setupwizard/FinishActivity.java
index 0427a4d..71e61ba 100644
--- a/src/org/lineageos/setupwizard/FinishActivity.java
+++ b/src/org/lineageos/setupwizard/FinishActivity.java
@@ -6,86 +6,42 @@
 
 package org.lineageos.setupwizard;
 
-import static android.os.Binder.getCallingUserHandle;
-import static android.os.UserHandle.USER_CURRENT;
-
-import static org.lineageos.setupwizard.Manifest.permission.FINISH_SETUP;
-import static org.lineageos.setupwizard.SetupWizardApp.ACTION_FINISHED;
-import static org.lineageos.setupwizard.SetupWizardApp.ACTION_SETUP_COMPLETE;
-import static org.lineageos.setupwizard.SetupWizardApp.DISABLE_NAV_KEYS;
-import static org.lineageos.setupwizard.SetupWizardApp.ENABLE_RECOVERY_UPDATE;
-import static org.lineageos.setupwizard.SetupWizardApp.KEY_SEND_METRICS;
 import static org.lineageos.setupwizard.SetupWizardApp.LOGV;
-import static org.lineageos.setupwizard.SetupWizardApp.NAVIGATION_OPTION_KEY;
-import static org.lineageos.setupwizard.SetupWizardApp.UPDATE_RECOVERY_PROP;
 
 import android.animation.Animator;
 import android.animation.AnimatorListenerAdapter;
-import android.app.WallpaperManager;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.om.IOverlayManager;
 import android.content.pm.ActivityInfo;
-import android.graphics.Bitmap;
-import android.graphics.Point;
-import android.graphics.Rect;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Looper;
-import android.os.ServiceManager;
-import android.os.SystemProperties;
-import android.os.UserHandle;
 import android.util.Log;
 import android.view.View;
 import android.view.ViewAnimationUtils;
 import android.view.ViewGroup.MarginLayoutParams;
 import android.view.Window;
-import android.widget.ImageView;
 
 import androidx.core.graphics.Insets;
 import androidx.core.view.ViewCompat;
 import androidx.core.view.WindowInsetsCompat;
 
-import lineageos.providers.LineageSettings;
-
 import org.lineageos.setupwizard.util.SetupWizardUtils;
 
 public class FinishActivity extends BaseSetupWizardActivity {
 
     public static final String TAG = FinishActivity.class.getSimpleName();
 
-    private ImageView mBackground;
-
-    private SetupWizardApp mSetupWizardApp;
-
     private final Handler mHandler = new Handler(Looper.getMainLooper());
 
     private boolean mIsFinishing;
 
-    private final BroadcastReceiver mIntentReceiver = new BroadcastReceiver() {
-        @Override
-        public void onReceive(Context context, Intent intent) {
-            if (LOGV) {
-                Log.v(TAG, "onReceive intent=" + intent);
-            }
-            if (intent != null && intent.getAction().equals(ACTION_FINISHED)) {
-                unregisterReceiver(mIntentReceiver);
-                completeSetup();
-            }
-        }
-    };
-
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        overridePendingTransition(R.anim.translucent_enter, R.anim.translucent_exit);
+        overrideActivityTransition(OVERRIDE_TRANSITION_CLOSE, R.anim.translucent_enter,
+                R.anim.translucent_exit);
         if (LOGV) {
             logActivityState("onCreate savedInstanceState=" + savedInstanceState);
         }
-        mSetupWizardApp = (SetupWizardApp) getApplication();
-        mBackground = findViewById(R.id.background);
         setNextText(R.string.start);
 
         // Edge-to-edge. Needed for the background view to fill the full screen.
@@ -126,15 +82,6 @@
         }
         mIsFinishing = true;
 
-        // Listen for completion from the exit service.
-        IntentFilter filter = new IntentFilter();
-        filter.addAction(ACTION_FINISHED);
-        registerReceiver(mIntentReceiver, filter, null, null);
-
-        Intent i = new Intent(ACTION_SETUP_COMPLETE);
-        i.setPackage(getPackageName());
-        sendBroadcastAsUser(i, getCallingUserHandle(), FINISH_SETUP);
-
         setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED);
         hideNextButton();
 
@@ -163,77 +110,10 @@
                     if (LOGV) {
                         Log.v(TAG, "Animation ended");
                     }
-                    // Start exit procedures, including the exit service.
-                    SetupWizardUtils.startSetupWizardExitProcedure(FinishActivity.this);
+                    SetupWizardUtils.finishSetupWizard(FinishActivity.this);
                 });
             }
         });
         anim.start();
     }
-
-    private void completeSetup() {
-        handleEnableMetrics(mSetupWizardApp);
-        handleNavKeys(mSetupWizardApp);
-        handleRecoveryUpdate(mSetupWizardApp);
-        handleNavigationOption(mSetupWizardApp);
-        final WallpaperManager wallpaperManager =
-                WallpaperManager.getInstance(mSetupWizardApp);
-        wallpaperManager.forgetLoadedWallpaper();
-        finishAffinity();
-        nextAction(RESULT_OK);
-        SetupWizardUtils.enableStatusBar();
-        Log.i(TAG, "Setup complete!");
-    }
-
-    private static void handleEnableMetrics(SetupWizardApp setupWizardApp) {
-        Bundle privacyData = setupWizardApp.getSettingsBundle();
-        if (privacyData != null
-                && privacyData.containsKey(KEY_SEND_METRICS)) {
-            LineageSettings.Secure.putInt(setupWizardApp.getContentResolver(),
-                    LineageSettings.Secure.STATS_COLLECTION,
-                    privacyData.getBoolean(KEY_SEND_METRICS)
-                            ? 1 : 0);
-        }
-    }
-
-    private static void handleNavKeys(SetupWizardApp setupWizardApp) {
-        if (setupWizardApp.getSettingsBundle().containsKey(DISABLE_NAV_KEYS)) {
-            writeDisableNavkeysOption(setupWizardApp,
-                    setupWizardApp.getSettingsBundle().getBoolean(DISABLE_NAV_KEYS));
-        }
-    }
-
-    private static void handleRecoveryUpdate(SetupWizardApp setupWizardApp) {
-        if (setupWizardApp.getSettingsBundle().containsKey(ENABLE_RECOVERY_UPDATE)) {
-            boolean update = setupWizardApp.getSettingsBundle()
-                    .getBoolean(ENABLE_RECOVERY_UPDATE);
-
-            SystemProperties.set(UPDATE_RECOVERY_PROP, String.valueOf(update));
-        }
-    }
-
-    private void handleNavigationOption(Context context) {
-        Bundle settingsBundle = mSetupWizardApp.getSettingsBundle();
-        if (settingsBundle.containsKey(NAVIGATION_OPTION_KEY)) {
-            IOverlayManager overlayManager = IOverlayManager.Stub.asInterface(
-                    ServiceManager.getService(Context.OVERLAY_SERVICE));
-            String selectedNavMode = settingsBundle.getString(NAVIGATION_OPTION_KEY);
-
-            try {
-                overlayManager.setEnabledExclusiveInCategory(selectedNavMode, USER_CURRENT);
-            } catch (Exception ignored) {
-            }
-        }
-    }
-
-    private static void writeDisableNavkeysOption(Context context, boolean enabled) {
-        final boolean virtualKeysEnabled = LineageSettings.System.getIntForUser(
-                context.getContentResolver(), LineageSettings.System.FORCE_SHOW_NAVBAR, 0,
-                UserHandle.USER_CURRENT) != 0;
-        if (enabled != virtualKeysEnabled) {
-            LineageSettings.System.putIntForUser(context.getContentResolver(),
-                    LineageSettings.System.FORCE_SHOW_NAVBAR, enabled ? 1 : 0,
-                    UserHandle.USER_CURRENT);
-        }
-    }
 }
diff --git a/src/org/lineageos/setupwizard/SetupWizardApp.java b/src/org/lineageos/setupwizard/SetupWizardApp.java
index e64d6ed..34b8b1b 100644
--- a/src/org/lineageos/setupwizard/SetupWizardApp.java
+++ b/src/org/lineageos/setupwizard/SetupWizardApp.java
@@ -22,9 +22,6 @@
     // Verbose logging
     public static final boolean LOGV = Log.isLoggable(TAG, Log.VERBOSE);
 
-    public static final String ACTION_FINISHED = "org.lineageos.setupwizard.SETUP_FINISHED";
-    public static final String ACTION_SETUP_COMPLETE =
-            "org.lineageos.setupwizard.LINEAGE_SETUP_COMPLETE";
     public static final String ACTION_RESTORE_FROM_BACKUP =
             "com.stevesoltys.seedvault.RESTORE_BACKUP";
     public static final String ACTION_EMERGENCY_DIAL = "com.android.phone.EmergencyDialer.DIAL";
@@ -53,7 +50,7 @@
     private boolean mIsRadioReady = false;
     private boolean mIgnoreSimLocale = false;
 
-    private final Bundle mSettingsBundle = new Bundle();
+    private static final Bundle mSettingsBundle = new Bundle();
     private final Handler mHandler = new Handler(Looper.getMainLooper());
 
     private final Runnable mRadioTimeoutRunnable = () -> mIsRadioReady = true;
@@ -88,7 +85,7 @@
         mIgnoreSimLocale = ignoreSimLocale;
     }
 
-    public Bundle getSettingsBundle() {
+    public static Bundle getSettingsBundle() {
         return mSettingsBundle;
     }
 }
diff --git a/src/org/lineageos/setupwizard/SetupWizardExitWorker.java b/src/org/lineageos/setupwizard/SetupWizardExitWorker.java
deleted file mode 100644
index ba72173..0000000
--- a/src/org/lineageos/setupwizard/SetupWizardExitWorker.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2024 The LineageOS Project
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package org.lineageos.setupwizard;
-
-import android.content.Context;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.work.CoroutineWorker;
-import androidx.work.WorkerParameters;
-
-import org.lineageos.setupwizard.util.SetupWizardUtils;
-
-import kotlin.coroutines.Continuation;
-
-public class SetupWizardExitWorker extends CoroutineWorker {
-
-    public SetupWizardExitWorker(@NonNull Context appContext,
-            @NonNull WorkerParameters params) {
-        super(appContext, params);
-    }
-
-    @Nullable
-    @Override
-    public Object doWork(@NonNull Continuation<? super Result> continuation) {
-        SetupWizardUtils.finishSetupWizard(getApplicationContext());
-        return Result.success();
-    }
-}
diff --git a/src/org/lineageos/setupwizard/util/SetupWizardUtils.java b/src/org/lineageos/setupwizard/util/SetupWizardUtils.java
index 9dfc5da..7b10a1f 100644
--- a/src/org/lineageos/setupwizard/util/SetupWizardUtils.java
+++ b/src/org/lineageos/setupwizard/util/SetupWizardUtils.java
@@ -11,59 +11,58 @@
 import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
 import static android.content.pm.PackageManager.DONT_KILL_APP;
 import static android.content.pm.PackageManager.GET_ACTIVITIES;
-import static android.content.pm.PackageManager.GET_RECEIVERS;
-import static android.content.pm.PackageManager.GET_SERVICES;
 import static android.telephony.TelephonyManager.PHONE_TYPE_GSM;
-import static android.telephony.TelephonyManager.SIM_STATE_ABSENT;
 
 import static com.android.internal.telephony.PhoneConstants.LTE_ON_CDMA_TRUE;
 import static com.android.internal.telephony.PhoneConstants.LTE_ON_CDMA_UNKNOWN;
 
+import static com.google.android.setupcompat.util.ResultCodes.RESULT_SKIP;
+
+import static org.lineageos.setupwizard.SetupWizardApp.DISABLE_NAV_KEYS;
+import static org.lineageos.setupwizard.SetupWizardApp.ENABLE_RECOVERY_UPDATE;
+import static org.lineageos.setupwizard.SetupWizardApp.KEY_SEND_METRICS;
 import static org.lineageos.setupwizard.SetupWizardApp.LOGV;
+import static org.lineageos.setupwizard.SetupWizardApp.NAVIGATION_OPTION_KEY;
+import static org.lineageos.setupwizard.SetupWizardApp.UPDATE_RECOVERY_PROP;
 
 import android.app.StatusBarManager;
+import android.app.WallpaperManager;
 import android.content.ComponentName;
 import android.content.ContentResolver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.SharedPreferences;
-import android.content.pm.ComponentInfo;
-import android.content.pm.PackageInfo;
+import android.content.om.IOverlayManager;
 import android.content.pm.PackageManager;
-import android.content.pm.ServiceInfo;
 import android.content.res.Resources;
 import android.hardware.biometrics.BiometricManager;
 import android.net.ConnectivityManager;
 import android.net.NetworkCapabilities;
-import android.os.Binder;
+import android.os.Bundle;
+import android.os.ServiceManager;
 import android.os.SystemProperties;
 import android.os.UserHandle;
 import android.os.UserManager;
 import android.provider.Settings;
 import android.sysprop.TelephonyProperties;
-import android.telephony.ServiceState;
 import android.telephony.SubscriptionInfo;
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
 import android.util.Log;
 
-import androidx.work.OneTimeWorkRequest;
-import androidx.work.OutOfQuotaPolicy;
-import androidx.work.WorkManager;
-
-import org.lineageos.internal.util.PackageManagerUtils;
+import org.lineageos.setupwizard.BaseSetupWizardActivity;
 import org.lineageos.setupwizard.BiometricActivity;
 import org.lineageos.setupwizard.BluetoothSetupActivity;
 import org.lineageos.setupwizard.NetworkSetupActivity;
 import org.lineageos.setupwizard.ScreenLockActivity;
 import org.lineageos.setupwizard.SetupWizardApp;
-import org.lineageos.setupwizard.SetupWizardExitWorker;
 import org.lineageos.setupwizard.SimMissingActivity;
 
 import java.io.File;
-import java.util.ArrayList;
 import java.util.List;
 
+import lineageos.providers.LineageSettings;
+
 public class SetupWizardUtils {
 
     private static final String TAG = SetupWizardUtils.class.getSimpleName();
@@ -153,8 +152,8 @@
     public static boolean hasGMS(Context context) {
         String gmsSuwPackage = hasLeanback(context) ? GMS_TV_SUW_PACKAGE : GMS_SUW_PACKAGE;
 
-        if (PackageManagerUtils.isAppInstalled(context, GMS_PACKAGE) &&
-                PackageManagerUtils.isAppInstalled(context, gmsSuwPackage)) {
+        if (isPackageInstalled(context, GMS_PACKAGE) &&
+                isPackageInstalled(context, gmsSuwPackage)) {
             PackageManager packageManager = context.getPackageManager();
             if (LOGV) {
                 Log.v(TAG, GMS_SUW_PACKAGE + " state = " +
@@ -176,21 +175,7 @@
         }
     }
 
-    public static void startSetupWizardExitProcedure(Context context) {
-        try {
-            WorkManager.getInstance(context).enqueue(new OneTimeWorkRequest.Builder(
-                    SetupWizardExitWorker.class).setExpedited(
-                    OutOfQuotaPolicy.RUN_AS_NON_EXPEDITED_WORK_REQUEST).build());
-        } catch (IllegalArgumentException e) {
-            // finishSetupWizard -- called by the exit worker -- disables components at the end,
-            // including the WorkManager component required here, so this is likely an error finding
-            // that component. The worker only needs to run once. We can assume it already has.
-            Log.w(TAG, "Could not start SetupWizardExitWorker. It has likely already run.", e);
-            return;
-        }
-    }
-
-    public static void finishSetupWizard(Context context) {
+    public static void finishSetupWizard(BaseSetupWizardActivity context) {
         if (LOGV) {
             Log.v(TAG, "finishSetupWizard");
         }
@@ -210,20 +195,16 @@
                     Settings.Secure.TV_USER_SETUP_COMPLETE, 1);
         }
 
-        disableComponentsAndSendFinishedBroadcast(context);
-    }
-
-    private static void disableComponentsAndSendFinishedBroadcast(Context context) {
-        if (LOGV) {
-            Log.v(TAG, "Disabling Setup Wizard components and sending FINISHED broadcast.");
-        }
+        handleEnableMetrics(context);
+        handleNavKeys(context);
+        handleRecoveryUpdate();
+        handleNavigationOption();
+        WallpaperManager.getInstance(context).forgetLoadedWallpaper();
         disableHome(context);
-        context.sendStickyBroadcastAsUser(
-                new Intent(SetupWizardApp.ACTION_FINISHED),
-                Binder.getCallingUserHandle());
-        disableComponentSets(context, GET_RECEIVERS | GET_SERVICES);
-        // Note: The WizardManager component is disabled when the WizardManager exits,
-        // which happens when FinishActivity calls nextAction while completing.
+        enableStatusBar();
+        context.finishAffinity();
+        context.nextAction(RESULT_SKIP);
+        Log.i(TAG, "Setup complete!");
     }
 
     public static boolean isBluetoothDisabled() {
@@ -273,6 +254,9 @@
         }
     }
 
+    /**
+     * Disable the Home component, which is presumably SetupWizardActivity at this time.
+     */
     public static void disableHome(Context context) {
         ComponentName homeComponent = getHomeComponent(context);
         if (homeComponent != null) {
@@ -282,7 +266,7 @@
         }
     }
 
-    public static ComponentName getHomeComponent(Context context) {
+    private static ComponentName getHomeComponent(Context context) {
         Intent intent = new Intent("android.intent.action.MAIN");
         intent.addCategory("android.intent.category.HOME");
         intent.setPackage(context.getPackageName());
@@ -293,11 +277,6 @@
         return comp;
     }
 
-    public static void disableComponentSets(Context context, int flags) {
-        setComponentListEnabledState(context, getComponentSets(context, flags),
-                COMPONENT_ENABLED_STATE_DISABLED);
-    }
-
     public static void disableComponent(Context context, Class<?> cls) {
         setComponentEnabledState(context, new ComponentName(context, cls),
                 COMPONENT_ENABLED_STATE_DISABLED);
@@ -314,42 +293,57 @@
                 enabledState, DONT_KILL_APP);
     }
 
-    public static void setComponentListEnabledState(Context context,
-            List<ComponentName> componentNames, int enabledState) {
-        for (ComponentName componentName : componentNames) {
-            setComponentEnabledState(context, componentName, enabledState);
+    private static void handleEnableMetrics(Context context) {
+        Bundle privacyData = SetupWizardApp.getSettingsBundle();
+        if (privacyData != null
+                && privacyData.containsKey(KEY_SEND_METRICS)) {
+            LineageSettings.Secure.putInt(context.getContentResolver(),
+                    LineageSettings.Secure.STATS_COLLECTION,
+                    privacyData.getBoolean(KEY_SEND_METRICS)
+                            ? 1 : 0);
         }
     }
 
-    public static List<ComponentName> getComponentSets(Context context, int flags) {
-        int i = 0;
-        List<ComponentName> componentNames = new ArrayList<>();
-        try {
-            PackageInfo allInfo = context.getPackageManager()
-                    .getPackageInfo(context.getPackageName(), flags);
-            if (allInfo != null) {
-                if (allInfo.activities != null && (flags & GET_ACTIVITIES) != 0) {
-                    for (ComponentInfo info : allInfo.activities) {
-                        componentNames.add(new ComponentName(context, info.name));
-                    }
-                }
-                if (allInfo.receivers != null && (flags & GET_RECEIVERS) != 0) {
-                    for (ComponentInfo info2 : allInfo.receivers) {
-                        componentNames.add(new ComponentName(context, info2.name));
-                    }
-                }
-                if (allInfo.services != null && (flags & GET_SERVICES) != 0) {
-                    ServiceInfo[] serviceInfoArr = allInfo.services;
-                    int length = serviceInfoArr.length;
-                    while (i < length) {
-                        componentNames.add(new ComponentName(context, serviceInfoArr[i].name));
-                        i++;
-                    }
-                }
-            }
-        } catch (PackageManager.NameNotFoundException ignored) {
+    private static void handleNavKeys(Context context) {
+        if (SetupWizardApp.getSettingsBundle().containsKey(DISABLE_NAV_KEYS)) {
+            writeDisableNavkeysOption(context,
+                    SetupWizardApp.getSettingsBundle().getBoolean(DISABLE_NAV_KEYS));
         }
-        return componentNames;
+    }
+
+    private static void handleRecoveryUpdate() {
+        if (SetupWizardApp.getSettingsBundle().containsKey(ENABLE_RECOVERY_UPDATE)) {
+            boolean update = SetupWizardApp.getSettingsBundle()
+                    .getBoolean(ENABLE_RECOVERY_UPDATE);
+
+            SystemProperties.set(UPDATE_RECOVERY_PROP, String.valueOf(update));
+        }
+    }
+
+    private static void handleNavigationOption() {
+        Bundle settingsBundle = SetupWizardApp.getSettingsBundle();
+        if (settingsBundle.containsKey(NAVIGATION_OPTION_KEY)) {
+            IOverlayManager overlayManager = IOverlayManager.Stub.asInterface(
+                    ServiceManager.getService(Context.OVERLAY_SERVICE));
+            String selectedNavMode = settingsBundle.getString(NAVIGATION_OPTION_KEY);
+
+            try {
+                overlayManager.setEnabledExclusiveInCategory(selectedNavMode,
+                        UserHandle.USER_CURRENT);
+            } catch (Exception ignored) {
+            }
+        }
+    }
+
+    private static void writeDisableNavkeysOption(Context context, boolean enabled) {
+        final boolean virtualKeysEnabled = LineageSettings.System.getIntForUser(
+                context.getContentResolver(), LineageSettings.System.FORCE_SHOW_NAVBAR, 0,
+                UserHandle.USER_CURRENT) != 0;
+        if (enabled != virtualKeysEnabled) {
+            LineageSettings.System.putIntForUser(context.getContentResolver(),
+                    LineageSettings.System.FORCE_SHOW_NAVBAR, enabled ? 1 : 0,
+                    UserHandle.USER_CURRENT);
+        }
     }
 
     public static long getBuildDateTimestamp() {
diff --git a/src/org/lineageos/setupwizard/wizardmanager/WizardManager.java b/src/org/lineageos/setupwizard/wizardmanager/WizardManager.java
index 44deb57..b1d3848 100644
--- a/src/org/lineageos/setupwizard/wizardmanager/WizardManager.java
+++ b/src/org/lineageos/setupwizard/wizardmanager/WizardManager.java
@@ -23,7 +23,6 @@
 import android.util.Log;
 
 import com.google.android.setupcompat.util.ResultCodes;
-import com.google.android.setupcompat.util.WizardManagerHelper;
 
 import org.lineageos.setupwizard.util.SetupWizardUtils;
 
@@ -71,10 +70,6 @@
         finish();
     }
 
-    private void addExtras(Intent intent) {
-        intent.putExtra(WizardManagerHelper.EXTRA_IS_FIRST_RUN, true);
-    }
-
     private void doAction(String scriptUri, WizardAction action, Intent extras) {
         Intent intent = action.getIntent();
         intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
@@ -83,7 +78,6 @@
                     + " intent=" + intent + " extras2=" + intent.getExtras() + " action=" + action);
         }
 
-        addExtras(intent);
         if (extras != null) {
             intent.putExtras(extras);
         }
