Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9359bfe authored by Oliver Scott's avatar Oliver Scott Committed by Michael Bestas
Browse files

Create managed profile setup flow

Change-Id: I42f8255bea3c7126526430b28c384538fa204c28
parent 8813787d
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>

<!--
     Copyright (C) 2016 The CyanogenMod Project
     Copyright (C) 2021 The Calyx Institute

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<WizardScript xmlns:wizard="http://schemas.android.com/apk/res/com.google.android.setupwizard"
              wizard:firstAction="welcome">

    <WizardAction wizard:uri="intent:#Intent;action=org.lineageos.setupwizard.LINEAGE_WELCOME;end" id="welcome">
        <result wizard:action="restore" />
    </WizardAction>

    <WizardAction wizard:uri="intent:#Intent;action=org.lineageos.setupwizard.LINEAGE_RESTORE_BACKUP;end" id="restore">
        <result wizard:action="finish" />
    </WizardAction>

    <WizardAction wizard:uri="intent:#Intent;action=org.lineageos.setupwizard.LINEAGE_SETUP_COMPLETE;end" id="finish">
        <result wizard:action="exit" />
    </WizardAction>

    <WizardAction wizard:uri="intent:#Intent;action=org.lineageos.setupwizard.EXIT;end" id="exit" />

</WizardScript>
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@

    <string name="lineage_wizard_script_uri" translatable="false">android.resource://org.lineageos.setupwizard/raw/lineage_wizard_script</string>
    <string name="lineage_wizard_script_user_uri" translatable="false">android.resource://org.lineageos.setupwizard/raw/lineage_wizard_script_user</string>
    <string name="lineage_wizard_script_managed_profile_uri" translatable="false">android.resource://org.lineageos.setupwizard/raw/lineage_wizard_script_managed_profile</string>

    <string name="activity_label_empty" />

+4 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import static org.lineageos.setupwizard.SetupWizardApp.LOGV;
import android.annotation.Nullable;
import android.content.Intent;
import android.os.Bundle;
import android.os.UserManager;
import android.util.Log;

import com.google.android.setupcompat.util.WizardManagerHelper;
@@ -54,6 +55,9 @@ public class SetupWizardActivity extends BaseSetupWizardActivity {
            Intent intent = new Intent(ACTION_LOAD);
            if (isPrimaryUser()) {
                intent.putExtra(EXTRA_SCRIPT_URI, getString(R.string.lineage_wizard_script_uri));
            } else if (getSystemService(UserManager.class).isManagedProfile()) {
                intent.putExtra(EXTRA_SCRIPT_URI, getString(
                        R.string.lineage_wizard_script_managed_profile_uri));
            } else {
                intent.putExtra(EXTRA_SCRIPT_URI,
                        getString(R.string.lineage_wizard_script_user_uri));
+4 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import static org.lineageos.setupwizard.SetupWizardApp.LOGV;
import android.annotation.Nullable;
import android.content.Intent;
import android.os.Bundle;
import android.os.UserManager;
import android.util.Log;

import org.lineageos.setupwizard.util.PhoneMonitor;
@@ -41,7 +42,9 @@ public class SetupWizardExitActivity extends BaseSetupWizardActivity {
        }
        SetupWizardUtils.enableCaptivePortalDetection(this);
        PhoneMonitor.onSetupFinished();
        if (!getSystemService(UserManager.class).isManagedProfile()) {
            launchHome();
        }
        finish();
        applyForwardTransition(TRANSITION_ID_FADE);
        Intent i = new Intent();