summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorcretin45 <cretin45@gmail.com>2015-02-06 13:00:30 -0800
committercretin45 <cretin45@gmail.com>2015-02-06 13:00:30 -0800
commitb168a71af0d9459d0216965aa36000c3836ca8d9 (patch)
tree76f4140e660d14622b9da58ca2301a8f6a4e82cf /src
parentc03556f5ae9456e5ecd95d26ce47159fb8e9982e (diff)
downloadpackages_apps_SetupWizard-b168a71af0d9459d0216965aa36000c3836ca8d9.zip
packages_apps_SetupWizard-b168a71af0d9459d0216965aa36000c3836ca8d9.tar.gz
packages_apps_SetupWizard-b168a71af0d9459d0216965aa36000c3836ca8d9.tar.bz2
SetupWizard: Don't broadcast finished if guest user
Change-Id: Id30a52902444769ea48db4cbbd039d31d2abe5d6
Diffstat (limited to 'src')
-rw-r--r--src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java b/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java
index 7c2bc3c..488551d 100644
--- a/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java
+++ b/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java
@@ -25,6 +25,7 @@ import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle;
import android.os.Handler;
+import android.os.UserHandle;
import android.os.UserManager;
import android.provider.Settings;
import android.view.MotionEvent;
@@ -56,6 +57,8 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks
private final Handler mHandler = new Handler();
+ private boolean mIsGuestUser = false;
+
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.setup_main);
@@ -110,7 +113,8 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks
// Continue with setup
}
UserManager userManager = (UserManager) getSystemService(Context.USER_SERVICE);
- if (userManager.isGuestUser()) {
+ mIsGuestUser = userManager.isGuestUser();
+ if (mIsGuestUser) {
finishSetup();
}
registerReceiver(mSetupData, mSetupData.getIntentFilter());
@@ -272,7 +276,10 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks
}
private void finishSetup() {
- getApplication().sendBroadcast(new Intent(SetupWizardApp.ACTION_FINISHED));
+ if (!mIsGuestUser) {
+ getApplication().sendBroadcastAsUser(new Intent(SetupWizardApp.ACTION_FINISHED),
+ UserHandle.getCallingUserHandle());
+ }
mSetupData.finishPages();
Settings.Global.putInt(getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 1);
Settings.Secure.putInt(getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 1);