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

Commit d4cea55d authored by cretin45's avatar cretin45
Browse files

SetupWizard: Part 2: Implement new OOBE using custom wizard manager

Change-Id: Ie6beb6395c5a4936384e78d57c95262e302220f9
parent 3593f035
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -5,9 +5,10 @@ LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_MODULE_TAGS := optional

LOCAL_PACKAGE_NAME := CyanogenSetupWizard
LOCAL_PACKAGE_NAME := LineageSetupWizard
LOCAL_CERTIFICATE := platform
LOCAL_PRIVILEGED_MODULE := true
LOCAL_OVERRIDES_PACKAGES := Provision

LOCAL_PROGUARD_FLAG_FILES := proguard.flags

+188 −20
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2013 The CyanogenMod Project
     Copyright (C) 2017 The LineageOS Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
@@ -65,26 +66,54 @@
                 android:taskAffinity="com.android.wizard"
                 android:name=".SetupWizardApp">

        <activity android:name=".ui.SetupWizardActivity"
                  android:label="@string/product_name"
                  android:launchMode="singleInstance"

        <activity android:theme="@style/NoDisplay"
                  android:label="@string/activity_label_empty"
                  android:name=".wizardmanager.WizardManager"
                  android:exported="true"
                  android:excludeFromRecents="true"
                  android:configChanges="mcc|mnc"
                  android:immersive="true"
                  android:windowSoftInputMode="stateAlwaysHidden">
                  android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize"
                  android:immersive="true">
            <intent-filter>
                <action android:name="com.android.wizard.LOAD" />
                <action android:name="com.android.wizard.NEXT" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <!--  <intent-filter android:priority="9">
        <activity android:name=".SetupWizardActivity"
                  android:label="@string/activity_label_empty"
                  android:lockTaskMode="normal"
                  android:launchMode="singleTask"
                  android:excludeFromRecents="true"
                  android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize"
                  android:immersive="true"
                  android:windowSoftInputMode="stateAlwaysHidden"
                  android:theme="@style/NoDisplay">

            <intent-filter android:priority="9">
                <action android:name="android.intent.action.MAIN" />
                <action android:name="android.intent.action.DEVICE_INITIALIZATION_WIZARD" />

                <category android:name="android.intent.category.HOME" />
                <category android:name="android.intent.category.DEFAULT" />
         </intent-filter> -->
                <category android:name="android.intent.category.SETUP_WIZARD"/>
            </intent-filter>
        </activity>

        <activity android:name=".ui.WelcomeActivity"
                  android:label="@string/product_name"
        <activity android:name=".BluetoothSetupActivity"
                  android:label="@string/activity_label_empty"
                  android:excludeFromRecents="true"
                  android:configChanges="mcc|mnc"
                  android:immersive="true"
                  android:windowSoftInputMode="stateAlwaysHidden">
            <intent-filter>
                <action android:name="com.cyanogenmod.setupwizard.LINEAGE_BLUETOOTH_SETUP" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <activity android:name=".WelcomeActivity"
                  android:label="@string/activity_label_empty"
                  android:excludeFromRecents="true"
                  android:configChanges="mcc|mnc"
                  android:immersive="true"
@@ -95,8 +124,8 @@
            </intent-filter>
        </activity>

        <activity android:name=".ui.LocaleActivity"
                  android:label="@string/product_name"
        <activity android:name=".LocaleActivity"
                  android:label="@string/activity_label_empty"
                  android:excludeFromRecents="true"
                  android:configChanges="mcc|mnc"
                  android:immersive="true"
@@ -107,8 +136,98 @@
            </intent-filter>
        </activity>

        <activity android:name=".ui.LineageSettingsActivity"
                  android:label="@string/product_name"
        <activity android:name=".DateTimeActivity"
                  android:label="@string/activity_label_empty"
                  android:excludeFromRecents="true"
                  android:configChanges="mcc|mnc"
                  android:immersive="true"
                  android:windowSoftInputMode="stateAlwaysHidden">
            <intent-filter>
                <action android:name="com.cyanogenmod.setupwizard.LINEAGE_DATETIME" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <activity android:name=".WifiSetupActivity"
                  android:label="@string/activity_label_empty"
                  android:excludeFromRecents="true"
                  android:configChanges="mcc|mnc"
                  android:immersive="true"
                  android:exported="false"
                  android:windowSoftInputMode="stateAlwaysHidden">
            <intent-filter>
                <action android:name="com.cyanogenmod.setupwizard.LINEAGE_WIFI_SETUP" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <activity android:name=".CaptivePortalSetupActivity"
                  android:label="@string/activity_label_empty"
                  android:excludeFromRecents="true"
                  android:configChanges="mcc|mnc"
                  android:immersive="true"
                  android:exported="false"
                  android:windowSoftInputMode="stateAlwaysHidden">
            <intent-filter>
                <action android:name="com.cyanogenmod.setupwizard.LINEAGE_CAPTIVE_PORTAL_SETUP" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <activity android:name=".SimMissingActivity"
                  android:label="@string/activity_label_empty"
                  android:excludeFromRecents="true"
                  android:configChanges="mcc|mnc"
                  android:immersive="true"
                  android:exported="false"
                  android:windowSoftInputMode="stateAlwaysHidden">
            <intent-filter>
                <action android:name="com.cyanogenmod.setupwizard.LINEAGE_SIM_MISSING" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <activity android:name=".ChooseDataSimActivity"
                  android:label="@string/activity_label_empty"
                  android:excludeFromRecents="true"
                  android:configChanges="mcc|mnc"
                  android:immersive="true"
                  android:exported="false"
                  android:windowSoftInputMode="stateAlwaysHidden">
            <intent-filter>
                <action android:name="com.cyanogenmod.setupwizard.LINEAGE_CHOOSE_DATA_SIM" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <activity android:name=".MobileDataActivity"
                  android:label="@string/activity_label_empty"
                  android:excludeFromRecents="true"
                  android:configChanges="mcc|mnc"
                  android:immersive="true"
                  android:exported="false"
                  android:windowSoftInputMode="stateAlwaysHidden">
            <intent-filter>
                <action android:name="com.cyanogenmod.setupwizard.LINEAGE_ENABLE_MOBILE_DATA" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <activity android:name=".LocationSettingsActivity"
                  android:label="@string/activity_label_empty"
                  android:excludeFromRecents="true"
                  android:configChanges="mcc|mnc"
                  android:immersive="true"
                  android:exported="false"
                  android:windowSoftInputMode="stateAlwaysHidden">
            <intent-filter>
                <action android:name="com.cyanogenmod.setupwizard.LINEAGE_LOCATION_SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <activity android:name=".LineageSettingsActivity"
                  android:label="@string/activity_label_empty"
                  android:excludeFromRecents="true"
                  android:configChanges="mcc|mnc"
                  android:immersive="true"
@@ -119,8 +238,34 @@
            </intent-filter>
        </activity>

        <activity android:name=".ui.FinishActivity"
                  android:label="@string/product_name"
        <activity android:name=".FingerprintActivity"
                  android:label="@string/activity_label_empty"
                  android:excludeFromRecents="true"
                  android:configChanges="mcc|mnc"
                  android:immersive="true"
                  android:exported="false"
                  android:windowSoftInputMode="stateAlwaysHidden">
            <intent-filter>
                <action android:name="com.cyanogenmod.setupwizard.LINEAGE_FINGERPRINT_SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <activity android:name=".ScreenLockActivity"
                  android:label="@string/activity_label_empty"
                  android:excludeFromRecents="true"
                  android:configChanges="mcc|mnc"
                  android:immersive="true"
                  android:exported="false"
                  android:windowSoftInputMode="stateAlwaysHidden">
            <intent-filter>
                <action android:name="com.cyanogenmod.setupwizard.LINEAGE_LOCKSCREEN_SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <activity android:name=".FinishActivity"
                  android:label="@string/activity_label_empty"
                  android:excludeFromRecents="true"
                  android:configChanges="mcc|mnc"
                  android:immersive="true"
@@ -131,10 +276,33 @@
            </intent-filter>
        </activity>

        <activity android:name=".SetupWizardExitActivity"
                  android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize"
                  android:excludeFromRecents="true"
                  android:immersive="true"
                  android:label="@@string/activity_label_empty"
                  android:theme="@style/NoDisplay">
            <intent-filter>
                <action android:name="com.cyanogenmod.setupwizard.EXIT"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>

        <activity android:name=".SetupWizardTestActivity"
                  android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize"
                  android:exported="false"
                  android:immersive="true"
                  android:label="@string/activity_label_empty"
                  android:launchMode="singleInstance"
                  android:theme="@style/NoDisplay"/>

        <receiver android:name=".PartnerReceiver">
            <intent-filter>
                <action android:name="com.android.setupwizard.action.PARTNER_CUSTOMIZATION" />
            </intent-filter>
        </receiver>

        <service android:name=".SetupWizardExitService"
                 android:exported="false"/>
    </application>
</manifest>

exit_wizard.sh

0 → 100755
+13 −0
Original line number Diff line number Diff line
#!/bin/bash

adb root
wait ${!}
adb shell pm enable com.cyanogenmod.setupwizard/com.cyanogenmod.setupwizard.SetupWizardExitActivity || true
wait ${!}
adb shell pm enable com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardExitActivity || true
wait ${!}
sleep 1
adb shell am start com.cyanogenmod.setupwizard/com.cyanogenmod.setupwizard.SetupWizardExitActivity || true
wait ${!}
sleep 1
adb shell am start com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardExitActivity

res/anim/slide_right.xml

deleted100644 → 0
+0 −22
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2015 The Android Open Source Project

    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.
-->

<translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="300"
    android:fromXDelta="0%"
    android:toXDelta="100%"
    android:interpolator="@android:anim/decelerate_interpolator" />

res/layout-land/setup_locale.xml

deleted100644 → 0
+0 −31
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2017 The LineageOS Project

     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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent">

    <include layout="@layout/header_condensed" />

    <com.cyanogenmod.setupwizard.ui.LocalePicker
        android:id="@+id/locale_list"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:focusable="true"
        android:focusableInTouchMode="true"
        android:layout_centerInParent="true"/>
</LinearLayout>
Loading