SetupWizard: Don't broadcast finished if guest user
Change-Id: Id30a52902444769ea48db4cbbd039d31d2abe5d6
This commit is contained in:
parent
c03556f5ae
commit
b168a71af0
@ -25,6 +25,7 @@ import android.content.res.Configuration;
|
|||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
import android.os.UserHandle;
|
||||||
import android.os.UserManager;
|
import android.os.UserManager;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
@ -56,6 +57,8 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks
|
|||||||
|
|
||||||
private final Handler mHandler = new Handler();
|
private final Handler mHandler = new Handler();
|
||||||
|
|
||||||
|
private boolean mIsGuestUser = false;
|
||||||
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.setup_main);
|
setContentView(R.layout.setup_main);
|
||||||
@ -110,7 +113,8 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks
|
|||||||
// Continue with setup
|
// Continue with setup
|
||||||
}
|
}
|
||||||
UserManager userManager = (UserManager) getSystemService(Context.USER_SERVICE);
|
UserManager userManager = (UserManager) getSystemService(Context.USER_SERVICE);
|
||||||
if (userManager.isGuestUser()) {
|
mIsGuestUser = userManager.isGuestUser();
|
||||||
|
if (mIsGuestUser) {
|
||||||
finishSetup();
|
finishSetup();
|
||||||
}
|
}
|
||||||
registerReceiver(mSetupData, mSetupData.getIntentFilter());
|
registerReceiver(mSetupData, mSetupData.getIntentFilter());
|
||||||
@ -272,7 +276,10 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void finishSetup() {
|
private void finishSetup() {
|
||||||
getApplication().sendBroadcast(new Intent(SetupWizardApp.ACTION_FINISHED));
|
if (!mIsGuestUser) {
|
||||||
|
getApplication().sendBroadcastAsUser(new Intent(SetupWizardApp.ACTION_FINISHED),
|
||||||
|
UserHandle.getCallingUserHandle());
|
||||||
|
}
|
||||||
mSetupData.finishPages();
|
mSetupData.finishPages();
|
||||||
Settings.Global.putInt(getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 1);
|
Settings.Global.putInt(getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 1);
|
||||||
Settings.Secure.putInt(getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 1);
|
Settings.Secure.putInt(getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user