From 960bccdbe5053de418c3e5b6500c14bd2af82f9d Mon Sep 17 00:00:00 2001 From: oxmc <67136658+oxmc@users.noreply.github.com> Date: Sat, 18 Jul 2026 07:40:22 -0700 Subject: [PATCH] ConfigProvisioner: emit OEM wizard signal from the config APK After applying config-APK settings, check for res/xml/oem_wizard.xml and write Settings.Global pawlet.oem_wizard_pkg (the config APK package when present, empty otherwise). The SetupWizard reads this to decide whether to render OEM-contributed wizard pages. --- .../ProvisioningService.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/dev/oxmc/configprovisioner/ProvisioningService.java b/src/dev/oxmc/configprovisioner/ProvisioningService.java index 84ff0f1..4822fa0 100644 --- a/src/dev/oxmc/configprovisioner/ProvisioningService.java +++ b/src/dev/oxmc/configprovisioner/ProvisioningService.java @@ -226,6 +226,7 @@ public class ProvisioningService extends Service { } xml.close(); Log.i(TAG, "Settings from " + pkg + " applied"); + emitOemWizardSignal(pkg, res); } catch (PackageManager.NameNotFoundException e) { Log.w(TAG, "Config APK not found: " + pkg + " (not yet installed?)"); } catch (Exception e) { @@ -233,6 +234,24 @@ public class ProvisioningService extends Service { } } + /** + * Signal the SetupWizard whether this config APK provides OEM wizard pages. + * Writes the config APK package to Settings.Global "pawlet.oem_wizard_pkg" + * when it contains res/xml/oem_wizard.xml, or an empty string otherwise. The + * wizard reads this (falling back to the default config package) to decide + * whether to render OEM-contributed pages. + */ + private void emitOemWizardSignal(String pkg, Resources res) { + try { + int oemId = res.getIdentifier("oem_wizard", "xml", pkg); + String value = (oemId != 0) ? pkg : ""; + Settings.Global.putString(getContentResolver(), "pawlet.oem_wizard_pkg", value); + Log.i(TAG, "OEM wizard signal: " + (oemId != 0 ? "present (" + pkg + ")" : "none")); + } catch (Exception e) { + Log.w(TAG, "Failed to emit OEM wizard signal", e); + } + } + private void applyApns() { if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) return; String pkg = VendorConfig.getConfigApkPackage();