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();