diff options
Diffstat (limited to 'tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java')
-rw-r--r-- | tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java b/tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java index 9caf5a1..d7fa3ed 100644 --- a/tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java +++ b/tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java @@ -43,6 +43,12 @@ public class ManualTestActivity extends Activity { enableGoogleSetup(); } }); + findViewById(R.id.setup_complete_flag).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + setSetupComplete(); + } + }); } private void enableSetup() { @@ -73,4 +79,19 @@ public class ManualTestActivity extends Activity { finish(); } + private void setSetupComplete() { + Settings.Secure.putInt(getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 1); + Settings.Secure.putInt(getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 0); + Intent intent = new Intent("android.intent.action.MAIN"); + intent.addCategory("android.intent.category.HOME"); + final PackageManager pm = getPackageManager(); + ComponentName componentName = new ComponentName("com.cyanogenmod.setupwizard", "com.cyanogenmod.setupwizard.ui.SetupWizardActivity"); + pm.setComponentEnabledSetting(componentName, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); + componentName = new ComponentName("com.google.android.setupwizard", "com.google.android.setupwizard.SetupWizardActivity"); + pm.setComponentEnabledSetting(componentName, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); + intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | intent.getFlags()); + startActivity(intent); + finish(); + } + }
\ No newline at end of file |