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

Commit b21d2216 authored by Eric Biggers's avatar Eric Biggers
Browse files

Remove support for converting from FDE to FBE

Devices that launched with Android 10 or later require FBE (File Based
Encryption) from the beginning, so there's no need to support converting
to FBE after the fact anymore.  This was only ever a developer option,
so it probably wasn't used much.  And in any case, it's not used
anymore, as isConvertibleToFBE() is hard-coded to return false.  Besides
the fact that FBE has been required for several releases now, this
functionality was only ever available on devices that use FDE (Full Disk
Encryption), but FDE support has been removed from Android.

Therefore, remove this unused code.

Bug: 208476087
Change-Id: Ia765d6827e6144153c4e2a253b146ef2c75ca6fe
parent 40410274
Loading
Loading
Loading
Loading
+0 −46
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 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.
-->

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

        <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="12dp"
                android:layout_marginEnd="12dp"
                android:layout_marginTop="12dp"
                android:textSize="18sp"
                android:text="@string/confirm_convert_to_fbe_warning" />

        <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="fill_parent"
                android:layout_gravity="center"
                android:orientation="horizontal">
            <Button
                    android:id="@+id/button_confirm_convert_fbe"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom"
                    android:layout_marginBottom="12dp"
                    android:text="@string/button_confirm_convert_fbe" />
        </LinearLayout>

</LinearLayout>

res/layout/convert_fbe.xml

deleted100644 → 0
+0 −46
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.
-->

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

        <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/preference_no_icon_padding_start"
                android:layout_marginEnd="12dp"
                android:layout_marginTop="12dp"
                android:textSize="18sp"
                android:text="@string/convert_to_fbe_warning" />

        <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="fill_parent"
                android:layout_gravity="center"
                android:orientation="horizontal">
            <Button
                    android:id="@+id/button_convert_fbe"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom"
                    android:layout_marginBottom="12dp"
                    android:text="@string/button_convert_fbe" />
        </LinearLayout>

</LinearLayout>
+0 −5
Original line number Diff line number Diff line
@@ -11396,11 +11396,6 @@
    <!-- Title for the See more preference item in Special app access settings [CHAR LIMIT=30] -->
    <string name="special_access_more">See more</string>
    <!-- Developer option to convert to file encryption - final warning -->
    <string name="confirm_convert_to_fbe_warning">Really wipe user data and convert to file encryption?</string>
    <!-- Developer option to convert to file encryption - final button -->
    <string name="button_confirm_convert_fbe">Wipe and convert</string>
    <!-- Reset rate-limiting in the system service ShortcutManager.  "ShortcutManager" is the name of a system service and not translatable.
    If the word "rate-limit" is hard to translate, use "Reset ShortcutManager API call limit" as the source text, which means
    the same thing in this context.
+0 −6
Original line number Diff line number Diff line
@@ -88,12 +88,6 @@
            android:summary="@string/runningservices_settings_summary"
            android:fragment="com.android.settings.applications.RunningServices" />

        <Preference
            android:key="convert_to_file_encryption"
            android:title="@string/convert_to_file_encryption"
            android:summary="@string/convert_to_file_encryption_enabled"
            android:fragment="com.android.settings.applications.ConvertToFbe" />

        <com.android.settings.development.ColorModePreference
            android:key="picture_color_mode"
            android:title="@string/picture_color_mode"
+0 −55
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 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.
 */
package com.android.settings.applications;

import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;

public class ConfirmConvertToFbe extends SettingsPreferenceFragment {
    static final String TAG = "ConfirmConvertToFBE";

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.confirm_convert_fbe, null);

        final Button button = (Button) rootView.findViewById(R.id.button_confirm_convert_fbe);
        button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Intent intent = new Intent(Intent.ACTION_FACTORY_RESET);
                intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
                intent.setPackage("android");
                intent.putExtra(Intent.EXTRA_REASON, "convert_fbe");
                getActivity().sendBroadcast(intent);
            }
        });

        return rootView;
    }

    @Override
    public int getMetricsCategory() {
        return SettingsEnums.CONVERT_FBE_CONFIRM;
    }
}
Loading