SetupWizard: Ensure UI doesn't show when user is guest
Issue-id: CYNGNOS-1736 Change-Id: Ibcd85ca3f90a6ab35a3ae6da622f59786ddcbcd3
This commit is contained in:
parent
5b276ea335
commit
1b1b991da5
@ -99,14 +99,20 @@ public class SetupWizardApp extends Application {
|
|||||||
if (!isOwner
|
if (!isOwner
|
||||||
|| Settings.Secure.getInt(getContentResolver(),
|
|| Settings.Secure.getInt(getContentResolver(),
|
||||||
Settings.Secure.USER_SETUP_COMPLETE) == 1) {
|
Settings.Secure.USER_SETUP_COMPLETE) == 1) {
|
||||||
|
Thread t = new Thread(){
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
Settings.Global.putInt(getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 1);
|
Settings.Global.putInt(getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 1);
|
||||||
Settings.Secure.putInt(getContentResolver(),
|
Settings.Secure.putInt(getContentResolver(),
|
||||||
Settings.Secure.USER_SETUP_COMPLETE, 1);
|
Settings.Secure.USER_SETUP_COMPLETE, 1);
|
||||||
SetupWizardUtils.disableGMSSetupWizard(this);
|
SetupWizardUtils.disableGMSSetupWizard(SetupWizardApp.this);
|
||||||
SetupWizardUtils.disableSetupWizard(this);
|
SetupWizardUtils.disableSetupWizard(SetupWizardApp.this);
|
||||||
if (!isOwner) {
|
if (!isOwner) {
|
||||||
disableThemeComponentsForSecondaryUser();
|
disableThemeComponentsForSecondaryUser();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
t.run();
|
||||||
} else {
|
} else {
|
||||||
disableCaptivePortalDetection();
|
disableCaptivePortalDetection();
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,10 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks,
|
|||||||
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
final boolean isOwner = SetupWizardUtils.isOwner();
|
||||||
|
if (!isOwner) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
final View decorView = getWindow().getDecorView();
|
final View decorView = getWindow().getDecorView();
|
||||||
decorView.setSystemUiVisibility(UI_FLAGS);
|
decorView.setSystemUiVisibility(UI_FLAGS);
|
||||||
decorView.setOnSystemUiVisibilityChangeListener(
|
decorView.setOnSystemUiVisibilityChangeListener(
|
||||||
@ -157,6 +161,9 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks,
|
|||||||
final View decorView = getWindow().getDecorView();
|
final View decorView = getWindow().getDecorView();
|
||||||
decorView.setSystemUiVisibility(UI_FLAGS);
|
decorView.setSystemUiVisibility(UI_FLAGS);
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
if (isFinishing()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (mSetupData.isFinished()) {
|
if (mSetupData.isFinished()) {
|
||||||
mHandler.postDelayed(new Runnable() {
|
mHandler.postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@ -174,16 +181,20 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks,
|
|||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
|
if (mSetupData != null) {
|
||||||
mSetupData.onPause();
|
mSetupData.onPause();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
if (mSetupData != null) {
|
||||||
mSetupData.onDestroy();
|
mSetupData.onDestroy();
|
||||||
mSetupData.unregisterListener(this);
|
mSetupData.unregisterListener(this);
|
||||||
unregisterReceiver(mSetupData);
|
unregisterReceiver(mSetupData);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object onRetainNonConfigurationInstance() {
|
public Object onRetainNonConfigurationInstance() {
|
||||||
|
Loading…
Reference in New Issue
Block a user