SetupWizard: Ensure UI doesn't show when user is guest

Issue-id: CYNGNOS-1736

Change-Id: Ibcd85ca3f90a6ab35a3ae6da622f59786ddcbcd3
This commit is contained in:
cretin45
2016-02-01 15:16:05 -08:00
parent 5b276ea335
commit 1b1b991da5
2 changed files with 29 additions and 12 deletions

View File

@@ -99,14 +99,20 @@ public class SetupWizardApp extends Application {
if (!isOwner
|| Settings.Secure.getInt(getContentResolver(),
Settings.Secure.USER_SETUP_COMPLETE) == 1) {
Settings.Global.putInt(getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 1);
Settings.Secure.putInt(getContentResolver(),
Settings.Secure.USER_SETUP_COMPLETE, 1);
SetupWizardUtils.disableGMSSetupWizard(this);
SetupWizardUtils.disableSetupWizard(this);
if (!isOwner) {
disableThemeComponentsForSecondaryUser();
}
Thread t = new Thread(){
@Override
public void run() {
Settings.Global.putInt(getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 1);
Settings.Secure.putInt(getContentResolver(),
Settings.Secure.USER_SETUP_COMPLETE, 1);
SetupWizardUtils.disableGMSSetupWizard(SetupWizardApp.this);
SetupWizardUtils.disableSetupWizard(SetupWizardApp.this);
if (!isOwner) {
disableThemeComponentsForSecondaryUser();
}
}
};
t.run();
} else {
disableCaptivePortalDetection();
}