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>
This commit is contained in:
parent
e5c2b92590
commit
fccccda787
@ -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) {
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user