summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorcretin45 <cretin45@gmail.com>2015-03-09 14:49:31 -0700
committercretin45 <cretin45@gmail.com>2015-03-09 14:49:31 -0700
commit0d31b31aac79be0d9ffd3fb2d8045be0fa236505 (patch)
tree3ff5445639f1fd992a6e5ad776d9b88fed812232 /tests
parent7732b7485d9dc145ca9093d22cb08259203719d0 (diff)
downloadpackages_apps_SetupWizard-0d31b31aac79be0d9ffd3fb2d8045be0fa236505.zip
packages_apps_SetupWizard-0d31b31aac79be0d9ffd3fb2d8045be0fa236505.tar.gz
packages_apps_SetupWizard-0d31b31aac79be0d9ffd3fb2d8045be0fa236505.tar.bz2
SetupWizard: Refactor for better transitions out of OOBE
Change-Id: If91da3f44dbc5383236b54da529953d48a475250
Diffstat (limited to 'tests')
-rw-r--r--tests/AndroidManifest.xml1
-rw-r--r--tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java6
2 files changed, 6 insertions, 1 deletions
diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml
index fdb837f..a8ed7ec 100644
--- a/tests/AndroidManifest.xml
+++ b/tests/AndroidManifest.xml
@@ -30,6 +30,7 @@
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" />
<uses-permission android:name="android.permission.CLEAR_APP_USER_DATA" />
+ <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
<application android:icon="@drawable/icon">
<uses-library android:name="android.test.runner" />
diff --git a/tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java b/tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java
index dfa493a..dd293a9 100644
--- a/tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java
+++ b/tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java
@@ -18,6 +18,7 @@ package com.cyanogenmod.setupwizard.tests;
import android.app.Activity;
+import android.app.ActivityManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -66,6 +67,8 @@ public class ManualTestActivity extends Activity {
pm.setComponentEnabledSetting(componentName, PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
PackageManager.DONT_KILL_APP);
pm.clearApplicationUserData("com.cyanogenmod.setupwizard", null);
+ ActivityManager am = (ActivityManager) getSystemService(Activity.ACTIVITY_SERVICE);
+ am.killBackgroundProcesses("com.cyanogenmod.setupwizard");
try {
PackageInfo packageInfo = getPackageManager()
.getPackageInfo("com.google.android.setupwizard",
@@ -110,7 +113,6 @@ public class ManualTestActivity extends Activity {
private void setSetupComplete() {
Settings.Secure.putInt(getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 1);
- Settings.Global.putInt(getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 0);
Intent intent = new Intent("android.intent.action.MAIN");
intent.addCategory("android.intent.category.HOME");
final PackageManager pm = getPackageManager();
@@ -118,6 +120,8 @@ public class ManualTestActivity extends Activity {
"com.cyanogenmod.setupwizard.ui.SetupWizardActivity");
pm.setComponentEnabledSetting(componentName,
PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
+ ActivityManager am = (ActivityManager) getSystemService(Activity.ACTIVITY_SERVICE);
+ am.killBackgroundProcesses("com.cyanogenmod.setupwizard");
try {
PackageInfo packageInfo = this.getPackageManager()
.getPackageInfo("com.google.android.setupwizard",