summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorcretin45 <cretin45@gmail.com>2015-01-26 16:25:28 -0800
committercretin45 <cretin45@gmail.com>2015-01-26 16:25:28 -0800
commit8f363092bbcecf34c3751e7b76ac92d387aee80e (patch)
tree529992c914bd954dfb1540903bad1875210615ff /tests
parent202f9273e02a5ffe73e5f2dbacfd2e6c1155ead3 (diff)
downloadpackages_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')
-rw-r--r--tests/res/layout/cmaccount_test.xml5
-rw-r--r--tests/res/values/strings.xml1
-rw-r--r--tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java21
3 files changed, 27 insertions, 0 deletions
diff --git a/tests/res/layout/cmaccount_test.xml b/tests/res/layout/cmaccount_test.xml
index 645b8bb..488f691 100644
--- a/tests/res/layout/cmaccount_test.xml
+++ b/tests/res/layout/cmaccount_test.xml
@@ -31,5 +31,10 @@
android:layout_width="match_parent"
android:text="@string/enable_google_setup"/>
+ <Button android:id="@+id/setup_complete_flag"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:text="@string/user_setup_complete"/>
+
</LinearLayout>
</ScrollView>
diff --git a/tests/res/values/strings.xml b/tests/res/values/strings.xml
index b396dd8..0bba372 100644
--- a/tests/res/values/strings.xml
+++ b/tests/res/values/strings.xml
@@ -18,4 +18,5 @@
<string name="app_test">SetupWizard Test</string>
<string name="enable_setup">Enable Setup Wizard</string>
<string name="enable_google_setup">Enable Google Setup Wizard</string>
+ <string name="user_setup_complete">Set SetupWizard complete</string>
</resources>
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