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

Commit d93e0e1b authored by Alessandro Astone's avatar Alessandro Astone Committed by Bruno Martins
Browse files

SetupWizard: Add activity to toggle recovery updates

Change-Id: I8157d812c1b616b10dd4204d12cc8fb21d4eee50
parent 7423d88c
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -223,6 +223,18 @@
            </intent-filter>
        </activity>

        <activity android:name=".UpdateRecoveryActivity"
                  android:label="@string/activity_label_empty"
                  android:excludeFromRecents="true"
                  android:configChanges="mcc|mnc"
                  android:immersive="true"
                  android:windowSoftInputMode="stateAlwaysHidden">
            <intent-filter>
                <action android:name="org.lineageos.setupwizard.LINEAGE_RECOVERY_UPDATE"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>

        <activity android:name=".LineageSettingsActivity"
                  android:label="@string/activity_label_empty"
                  android:excludeFromRecents="true"
+25 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (c) 2020 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0">
    <path
        android:fillColor="@color/black"
        android:pathData="M17,1.01L7,1c-1.1,0 -2,0.9 -2,2v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2L19,3c0,-1.1 -0.9,-1.99 -2,-1.99zM17,19L7,19L7,5h10v14zM16,13h-3L13,8h-2v5L8,13l4,4 4,-4z"/>
</vector>
+101 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2015 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.
     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"
    android:background="@color/primary">

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

    <FrameLayout android:id="@+id/page"
                 android:layout_width="match_parent"
                 android:layout_height="0dp"
                 android:layout_weight="1">

        <ScrollView android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:fillViewport="true">

            <LinearLayout
                android:orientation="vertical"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                style="@style/PageContent">

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:textSize="16sp"
                    android:layout_marginBottom="@dimen/summary_margin_bottom"
                    android:paddingLeft="@dimen/content_margin_left"
                    android:paddingRight="@dimen/content_margin_right"
                    style="@style/PageSummaryText"
                    android:text="@string/update_recovery_description" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:textSize="16sp"
                    android:layout_marginBottom="@dimen/summary_margin_bottom"
                    android:paddingLeft="@dimen/content_margin_left"
                    android:paddingRight="@dimen/content_margin_right"
                    style="@style/PageSummaryText"
                    android:text="@string/update_recovery_warning" />

                <LinearLayout
                    android:id="@+id/update_recovery_checkbox_view"
                    android:orientation="horizontal"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:paddingLeft="@dimen/location_margin_left"
                    android:paddingRight="@dimen/content_margin_right"
                    android:background="?android:attr/selectableItemBackground"
                    android:clickable="true">

                    <CheckBox
                        android:id="@+id/update_recovery_checkbox"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="top"
                        android:layout_marginTop="5dp"
                        android:duplicateParentState="true"
                        android:clickable="false" />

                    <TextView
                        android:layout_width="0px"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:textSize="15sp"
                        android:textStyle="bold"
                        android:lineSpacingExtra="@dimen/setup_line_spacing"
                        android:gravity="top"
                        android:layout_marginLeft="@dimen/location_text_margin_left"
                        android:layout_marginRight="@dimen/location_text_margin_right"
                        android:paddingBottom="@dimen/content_margin_bottom"
                        android:text="@string/update_recovery_setting"
                        android:maxLines="5" />
                </LinearLayout>

            </LinearLayout>
        </ScrollView>
    </FrameLayout>

    <com.google.android.setupdesign.view.NavigationBar
        android:id="@+id/navigation_bar"
        style="@style/SudNavBarTheme"
        android:layout_width="match_parent"
        android:layout_height="@dimen/sud_navbar_height" />
</LinearLayout>
 No newline at end of file
+4 −0
Original line number Diff line number Diff line
@@ -54,6 +54,10 @@
    </WizardAction>

    <WizardAction wizard:uri="intent:#Intent;action=org.lineageos.setupwizard.LINEAGE_LOCATION_SETTINGS;end" id="location_settings">
        <result wizard:action="recovery_update" />
    </WizardAction>

    <WizardAction wizard:uri="intent:#Intent;action=org.lineageos.setupwizard.LINEAGE_RECOVERY_UPDATE;end" id="recovery_update">
        <result wizard:action="lineage_settings" />
    </WizardAction>

+4 −1
Original line number Diff line number Diff line
@@ -98,7 +98,10 @@
        <result wizard:action="oem_post_setup" />
    </WizardAction>
    <WizardAction wizard:script="android.resource://com.google.android.setupwizard/xml/wizard_script_qr_provision_flow" id="qr_provision_flow" />
    <WizardAction wizard:uri="intent:#Intent;action=org.lineageos.setupwizard.LINEAGE_SETTINGS;end" id="oem_post_setup">
    <WizardAction wizard:uri="intent:#Intent;action=org.lineageos.setupwizard.LINEAGE_RECOVERY_UPDATE;end" id="oem_post_setup">
        <result wizard:action="lineage_settings" />
    </WizardAction>
    <WizardAction wizard:uri="intent:#Intent;action=org.lineageos.setupwizard.LINEAGE_SETTINGS;end" id="lineage_settings">
        <result wizard:action="restore" />
    </WizardAction>
    <WizardAction wizard:uri="intent:#Intent;action=org.lineageos.setupwizard.LINEAGE_RESTORE_BACKUP;end" id="restore">
Loading