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.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user