diff options
author | cretin45 <cretin45@gmail.com> | 2015-01-26 16:25:28 -0800 |
---|---|---|
committer | cretin45 <cretin45@gmail.com> | 2015-01-26 16:25:28 -0800 |
commit | 8f363092bbcecf34c3751e7b76ac92d387aee80e (patch) | |
tree | 529992c914bd954dfb1540903bad1875210615ff /tests/src | |
parent | 202f9273e02a5ffe73e5f2dbacfd2e6c1155ead3 (diff) | |
download | packages_apps_SetupWizard-8f363092bbcecf34c3751e7b76ac92d387aee80e.zip packages_apps_SetupWizard-8f363092bbcecf34c3751e7b76ac92d387aee80e.tar.gz packages_apps_SetupWizard-8f363092bbcecf34c3751e7b76ac92d387aee80e.tar.bz2 |
SetupWizardTest: Add a test to mark as setup complete
Change-Id: I9d76e66dc68eb85094060548309e948bf91c4eeb
Diffstat (limited to 'tests/src')
-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 |