summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AndroidManifest.xml7
-rw-r--r--src/com/cyanogenmod/setupwizard/SetupWizardApp.java2
-rw-r--r--src/com/cyanogenmod/setupwizard/setup/FinishSetupReceiver.java29
-rw-r--r--src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java2
-rw-r--r--tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java4
5 files changed, 43 insertions, 1 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 69f8501..ec6bbee 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -93,5 +93,12 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
+
+ <receiver android:name=".setup.FinishSetupReceiver"
+ android:exported="true">
+ <intent-filter>
+ <action android:name="com.cyanogenmod.setupwizard.ACTION_FINISH_SETUPWIZARD" />
+ </intent-filter>
+ </receiver>
</application>
</manifest>
diff --git a/src/com/cyanogenmod/setupwizard/SetupWizardApp.java b/src/com/cyanogenmod/setupwizard/SetupWizardApp.java
index acad204..33b005a 100644
--- a/src/com/cyanogenmod/setupwizard/SetupWizardApp.java
+++ b/src/com/cyanogenmod/setupwizard/SetupWizardApp.java
@@ -50,7 +50,7 @@ public class SetupWizardApp extends Application {
public static final String EXTRA_CKSOP = "cksOp";
public static final String EXTRA_LOGIN_FOR_KILL_SWITCH = "authCks";
- private static final String KEY_DETECT_CAPTIVE_PORTAL = "captive_portal_detection_enabled";
+ public static final String KEY_DETECT_CAPTIVE_PORTAL = "captive_portal_detection_enabled";
private static final String[] THEME_PACKAGES = {
"org.cyanogenmod.theme.chooser",
diff --git a/src/com/cyanogenmod/setupwizard/setup/FinishSetupReceiver.java b/src/com/cyanogenmod/setupwizard/setup/FinishSetupReceiver.java
new file mode 100644
index 0000000..fdd77a2
--- /dev/null
+++ b/src/com/cyanogenmod/setupwizard/setup/FinishSetupReceiver.java
@@ -0,0 +1,29 @@
+package com.cyanogenmod.setupwizard.setup;
+
+import android.app.StatusBarManager;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.provider.Settings;
+
+import com.cyanogenmod.setupwizard.SetupWizardApp;
+import com.cyanogenmod.setupwizard.util.SetupWizardUtils;
+
+public class FinishSetupReceiver extends BroadcastReceiver {
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (SetupWizardUtils.isDeviceLocked()) {
+ return;
+ }
+ Settings.Global.putInt(context.getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 1);
+ Settings.Secure.putInt(context.getContentResolver(),
+ Settings.Secure.USER_SETUP_COMPLETE, 1);
+ ((StatusBarManager)context.getSystemService(Context.STATUS_BAR_SERVICE)).disable(
+ StatusBarManager.DISABLE_NONE);
+ Settings.Global.putInt(context.getContentResolver(),
+ SetupWizardApp.KEY_DETECT_CAPTIVE_PORTAL, 1);
+ SetupWizardUtils.disableGMSSetupWizard(context);
+ SetupWizardUtils.disableSetupWizard(context);
+ }
+}
diff --git a/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java b/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java
index 113e204..e16379d 100644
--- a/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java
+++ b/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java
@@ -192,6 +192,8 @@ public class SetupWizardUtils {
public static void disableSetupWizard(Context context) {
disableComponent(context, context.getPackageName(),
"com.cyanogenmod.setupwizard.ui.SetupWizardActivity");
+ disableComponent(context, context.getPackageName(),
+ "com.cyanogenmod.setupwizard.setup.FinishSetupReceiver");
}
public static void disableGMSSetupWizard(Context context) {
diff --git a/tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java b/tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java
index dd293a9..3b4f08b 100644
--- a/tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java
+++ b/tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java
@@ -66,6 +66,10 @@ public class ManualTestActivity extends Activity {
"com.cyanogenmod.setupwizard.ui.SetupWizardActivity");
pm.setComponentEnabledSetting(componentName, PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
PackageManager.DONT_KILL_APP);
+ componentName = new ComponentName("com.cyanogenmod.setupwizard",
+ "com.cyanogenmod.setupwizard.setup.FinishSetupReceiver");
+ 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");