diff options
author | cretin45 <cretin45@gmail.com> | 2015-06-17 13:56:09 -0700 |
---|---|---|
committer | cretin45 <cretin45@gmail.com> | 2015-06-17 13:56:09 -0700 |
commit | c5e926d67f04fa4f8cf769ca37065f2c7cf6787c (patch) | |
tree | ceca4fe9e1826cff15f06fb357bf4cc553521179 /src/com/cyanogenmod/setupwizard/setup | |
parent | 1fc47a0a79ac6bca2b0fad6e8feaffb5a09f3e50 (diff) | |
download | packages_apps_SetupWizard-c5e926d67f04fa4f8cf769ca37065f2c7cf6787c.zip packages_apps_SetupWizard-c5e926d67f04fa4f8cf769ca37065f2c7cf6787c.tar.gz packages_apps_SetupWizard-c5e926d67f04fa4f8cf769ca37065f2c7cf6787c.tar.bz2 |
SetupWizard: Add hook to finish setup for CTS automation
Change-Id: Ifd7edda671fd8011a9b9ed894333c292cd0c3331
Diffstat (limited to 'src/com/cyanogenmod/setupwizard/setup')
-rw-r--r-- | src/com/cyanogenmod/setupwizard/setup/FinishSetupReceiver.java | 29 |
1 files changed, 29 insertions, 0 deletions
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); + } +} |