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

Commit c58a8836 authored by Fan Zhang's avatar Fan Zhang
Browse files

Convert encryption status to preference controller

- Move Crypt/Encryption setting into security package.
- Reformat crypt_keeper_settings.xml
- Add controller and test for encryption status

Bug: 32953042
Test: robotests
Change-Id: I1f4b2f97133435c70a49522a59886ac4da6759af
parent b1047d17
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2384,7 +2384,7 @@
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                android:value="com.android.settings.CryptKeeperSettings" />
                android:value="com.android.settings.security.CryptKeeperSettings" />
        </activity>

        <activity android:name="Settings$DataPlanUsageSummaryActivity"
+13 −24
Original line number Diff line number Diff line
@@ -14,33 +14,29 @@
     limitations under the License.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
>

    android:paddingStart="@dimen/preference_no_icon_padding_start"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
    android:orientation="vertical">
    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_marginStart="16dp"
        android:layout_marginEnd="16dp"
        android:layout_marginTop="16dp"
        android:layout_weight="1"
    >
        android:layout_weight="1">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
        >
            android:orientation="vertical">
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dip"
                android:layout_marginBottom="16dip"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:text="@string/crypt_keeper_desc"
            />
                android:text="@string/crypt_keeper_desc" />
            <TextView
                android:id="@+id/warning_low_charge"
                android:layout_width="match_parent"
@@ -49,8 +45,7 @@
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textStyle="bold"
                android:text="@string/crypt_keeper_low_charge_text"
                android:visibility="gone"
            />
                android:visibility="gone" />
            <TextView
                android:id="@+id/warning_unplugged"
                android:layout_width="match_parent"
@@ -59,20 +54,14 @@
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textStyle="bold"
                android:text="@string/crypt_keeper_unplugged_text"
                android:visibility="gone"
            />
                android:visibility="gone" />
        </LinearLayout>

    </ScrollView>
    <Button
        android:id="@+id/initiate_encrypt"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="16dip"
        android:layout_marginBottom="16dip"
        style="@style/ActionPrimaryButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/crypt_keeper_button_text"
        android:gravity="center" 
    />

        android:layout_gravity="end"
        android:text="@string/crypt_keeper_button_text" />
</LinearLayout>
+52 −31
Original line number Diff line number Diff line
@@ -14,43 +14,64 @@
     limitations under the License.
-->

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
<PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:title="@string/encryption_and_credential_settings_title"
    android:key="encryption_and_credentials_screen">

    <PreferenceCategory android:key="credentials_management"
    <PreferenceCategory
        android:key="encryption_and_credentials_status_category"
        android:title="@string/crypt_keeper_settings_title">

        <Preference
            android:key="encryption_and_credentials_encryption_status"
            android:title="@string/crypt_keeper_encrypt_title"
            android:fragment="com.android.settings.security.CryptKeeperSettings"
            android:summary="@string/summary_placeholder" />

    </PreferenceCategory>

    <PreferenceCategory
        android:key="credentials_management"
        android:title="@string/credentials_title"
        android:persistent="false"
        android:order="100">

        <com.android.settingslib.RestrictedPreference android:key="credential_storage_type"
        <com.android.settingslib.RestrictedPreference
            android:key="credential_storage_type"
            android:title="@string/credential_storage_type" />

        <Preference android:key="trusted_credentials"
        <Preference
            android:key="trusted_credentials"
            android:title="@string/trusted_credentials"
            android:summary="@string/trusted_credentials_summary"
            android:fragment="com.android.settings.TrustedCredentialsSettings" />

        <com.android.settingslib.RestrictedPreference android:key="user_credentials"
        <com.android.settingslib.RestrictedPreference
            android:key="user_credentials"
            android:title="@string/user_credentials"
            android:summary="@string/user_credentials_summary"
            android:fragment="com.android.settings.UserCredentialsSettings" />

        <com.android.settingslib.RestrictedPreference android:key="credentials_install"
        <com.android.settingslib.RestrictedPreference
            android:key="credentials_install"
            android:title="@string/credentials_install"
            android:summary="@string/credentials_install_summary">

            <intent android:action="android.credentials.INSTALL"
            <intent
                android:action="android.credentials.INSTALL"
                android:targetPackage="com.android.certinstaller"
                android:targetClass="com.android.certinstaller.CertInstallerMain" />

        </com.android.settingslib.RestrictedPreference>

        <com.android.settingslib.RestrictedPreference android:key="credentials_reset"
        <com.android.settingslib.RestrictedPreference
            android:key="credentials_reset"
            android:title="@string/credentials_reset"
            android:summary="@string/credentials_reset_summary">

            <intent android:action="com.android.credentials.RESET"
            <intent
                android:action="com.android.credentials.RESET"
                android:targetPackage="com.android.settings"
                android:targetClass="com.android.settings.CredentialStorage" />

+0 −33
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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.
-->

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
                  android:key="security_settings_encrypted_screen"
                  android:title="@string/security_settings_title">

    <PreferenceCategory
        android:key="security_category_for_encrypted_device"
        android:title="@string/crypt_keeper_settings_title">

        <Preference
            android:key="crypt_keeper_encrypt_title"
            android:title="@string/crypt_keeper_encrypt_title"
            android:summary="@string/crypt_keeper_encrypted_summary"/>

    </PreferenceCategory>


</PreferenceScreen>
+0 −32
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 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.
-->

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
                  android:key="security_settings_unencrypted_screen"
                  android:title="@string/crypt_keeper_settings_title">

    <PreferenceCategory
        android:key="security_category_for_unencrypted_device"
        android:title="@string/crypt_keeper_settings_title">

        <Preference
            android:key="encryption"
            android:title="@string/crypt_keeper_encrypt_title"
            android:fragment="com.android.settings.CryptKeeperSettings" />

    </PreferenceCategory>

</PreferenceScreen>
Loading