Update src/dev/oxmc/configprovisioner/ProvisioningService.java
This commit is contained in:
@@ -167,15 +167,27 @@ public class ProvisioningService extends Service {
|
||||
private void configureSetupWizard() {
|
||||
boolean enableWizard = VendorConfig.isSetupWizardEnabled();
|
||||
Log.i(TAG, "Configuring Setup Wizard: " + (enableWizard ? "ENABLED" : "DISABLED"));
|
||||
|
||||
if (!enableWizard) {
|
||||
|
||||
if (enableWizard) {
|
||||
// Leave wizard enabled and mark setup as incomplete
|
||||
try {
|
||||
Settings.Secure.putInt(getContentResolver(),
|
||||
Settings.Secure.USER_SETUP_COMPLETE, 0);
|
||||
Settings.Global.putInt(getContentResolver(),
|
||||
Settings.Global.DEVICE_PROVISIONED, 0);
|
||||
Log.d(TAG, "Setup marked as NOT complete (wizard should run)");
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Failed to set setup incomplete flags", e);
|
||||
}
|
||||
} else {
|
||||
// Disable wizard packages
|
||||
disablePackage("com.android.setupwizard");
|
||||
disablePackage("com.google.android.setupwizard");
|
||||
disablePackage("org.lineageos.setupwizard");
|
||||
|
||||
|
||||
// Mark setup as complete
|
||||
try {
|
||||
Settings.Secure.putInt(getContentResolver(),
|
||||
Settings.Secure.putInt(getContentResolver(),
|
||||
Settings.Secure.USER_SETUP_COMPLETE, 1);
|
||||
Settings.Global.putInt(getContentResolver(),
|
||||
Settings.Global.DEVICE_PROVISIONED, 1);
|
||||
|
Reference in New Issue
Block a user