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) {
|
||||||
Settings.Global.putInt(getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 1);
|
Thread t = new Thread(){
|
||||||
Settings.Secure.putInt(getContentResolver(),
|
@Override
|
||||||
Settings.Secure.USER_SETUP_COMPLETE, 1);
|
public void run() {
|
||||||
SetupWizardUtils.disableGMSSetupWizard(this);
|
Settings.Global.putInt(getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 1);
|
||||||
SetupWizardUtils.disableSetupWizard(this);
|
Settings.Secure.putInt(getContentResolver(),
|
||||||
if (!isOwner) {
|
Settings.Secure.USER_SETUP_COMPLETE, 1);
|
||||||
disableThemeComponentsForSecondaryUser();
|
SetupWizardUtils.disableGMSSetupWizard(SetupWizardApp.this);
|
||||||
}
|
SetupWizardUtils.disableSetupWizard(SetupWizardApp.this);
|
||||||
|
if (!isOwner) {
|
||||||
|
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,15 +181,19 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks,
|
|||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
mSetupData.onPause();
|
if (mSetupData != null) {
|
||||||
|
mSetupData.onPause();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
mSetupData.onDestroy();
|
if (mSetupData != null) {
|
||||||
mSetupData.unregisterListener(this);
|
mSetupData.onDestroy();
|
||||||
unregisterReceiver(mSetupData);
|
mSetupData.unregisterListener(this);
|
||||||
|
unregisterReceiver(mSetupData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user