diff options
author | Roman Birg <roman@cyngn.com> | 2016-04-15 13:09:25 -0700 |
---|---|---|
committer | Roman Birg <roman@cyngn.com> | 2016-04-22 08:29:40 -0700 |
commit | fccccda7879d397ed8d8508d23d09a0ef417b1df (patch) | |
tree | 0fe0a74133add602f495dc72b430f25a2157d961 | |
parent | e5c2b92590664cdec422768f04bfb121a3e15bad (diff) | |
download | packages_apps_SetupWizard-fccccda7879d397ed8d8508d23d09a0ef417b1df.zip packages_apps_SetupWizard-fccccda7879d397ed8d8508d23d09a0ef417b1df.tar.gz packages_apps_SetupWizard-fccccda7879d397ed8d8508d23d09a0ef417b1df.tar.bz2 |
SetupWizard: add a CM-specific setup-complete settings key
Android uses Settings.Global.DEVICE_PROVISIONED and
Settings.Secure.USER_SETUP_COMPLETE and the system responds to those
database entries, such as allowing the keyguard to be visible, or maybe
pulling the statusbar down.
Since we still depend on some of Google's setup wizard, it also keys off
the same table rows and it may decide that the device is now provisioned
when we still haven't finished our own setup wizard, so let's add
another key that we have control over to show the real state of OUR
setup wizard.
Ticket: CYNGNOS-2431
Change-Id: Ic21689625f6d80e209161762ace741918b972aba
Signed-off-by: Roman Birg <roman@cyngn.com>
3 files changed, 13 insertions, 0 deletions
diff --git a/src/com/cyanogenmod/setupwizard/SetupWizardApp.java b/src/com/cyanogenmod/setupwizard/SetupWizardApp.java index dca32b7..54df0fc 100644 --- a/src/com/cyanogenmod/setupwizard/SetupWizardApp.java +++ b/src/com/cyanogenmod/setupwizard/SetupWizardApp.java @@ -26,6 +26,8 @@ import android.provider.Settings; import com.cyanogenmod.setupwizard.util.SetupWizardUtils; +import cyanogenmod.providers.CMSettings; + public class SetupWizardApp extends Application { public static final String TAG = SetupWizardApp.class.getSimpleName(); @@ -108,6 +110,8 @@ public class SetupWizardApp extends Application { Settings.Global.putInt(getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 1); Settings.Secure.putInt(getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 1); + CMSettings.Secure.putInt(getContentResolver(), + CMSettings.Secure.CM_SETUP_WIZARD_COMPLETED, 1); SetupWizardUtils.disableGMSSetupWizard(SetupWizardApp.this); SetupWizardUtils.disableSetupWizard(SetupWizardApp.this); if (!isOwner) { diff --git a/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java b/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java index 6005347..908fc2a 100644 --- a/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java +++ b/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java @@ -51,6 +51,7 @@ import com.cyanogenmod.setupwizard.setup.SetupDataCallbacks; import com.cyanogenmod.setupwizard.util.EnableAccessibilityController; import com.cyanogenmod.setupwizard.util.SetupWizardUtils; +import cyanogenmod.providers.CMSettings; import cyanogenmod.themes.ThemeManager; import java.util.ArrayList; @@ -466,6 +467,8 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks, Settings.Global.putInt(getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 1); Settings.Secure.putInt(getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 1); + CMSettings.Secure.putInt(getContentResolver(), + CMSettings.Secure.CM_SETUP_WIZARD_COMPLETED, 1); if (mEnableAccessibilityController != null) { mEnableAccessibilityController.onDestroy(); } diff --git a/tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java b/tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java index 3b4f08b..b9c2312 100644 --- a/tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java +++ b/tests/src/com/cyanogenmod/account/tests/ManualTestActivity.java @@ -30,6 +30,8 @@ import android.provider.Settings; import android.view.View; import android.widget.Toast; +import cyanogenmod.providers.CMSettings; + public class ManualTestActivity extends Activity { public void onCreate(Bundle savedInstanceState) { @@ -59,6 +61,8 @@ public class ManualTestActivity extends Activity { private void enableSetup() { Settings.Global.putInt(getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 0); Settings.Secure.putInt(getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 0); + CMSettings.Secure.putInt(getContentResolver(), + CMSettings.Secure.CM_SETUP_WIZARD_COMPLETED, 0); Intent intent = new Intent("android.intent.action.MAIN"); intent.addCategory("android.intent.category.HOME"); final PackageManager pm = getPackageManager(); @@ -117,6 +121,8 @@ public class ManualTestActivity extends Activity { private void setSetupComplete() { Settings.Secure.putInt(getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 1); + CMSettings.Secure.putInt(getContentResolver(), + CMSettings.Secure.CM_SETUP_WIZARD_COMPLETED, 1); Intent intent = new Intent("android.intent.action.MAIN"); intent.addCategory("android.intent.category.HOME"); final PackageManager pm = getPackageManager(); |