Updater: Recovery update is NOT optional

Change-Id: Ifee233452c079a5888721388618004fe9e54cc72
diff --git a/app/src/main/java/org/lineageos/updater/UpdatesActivity.java b/app/src/main/java/org/lineageos/updater/UpdatesActivity.java
index 25ca0b8..4a0825d 100644
--- a/app/src/main/java/org/lineageos/updater/UpdatesActivity.java
+++ b/app/src/main/java/org/lineageos/updater/UpdatesActivity.java
@@ -584,7 +584,6 @@
         SwitchCompat meteredNetworkWarning = view.findViewById(
                 R.id.preferences_metered_network_warning);
         SwitchCompat abPerfMode = view.findViewById(R.id.preferences_ab_perf_mode);
-        SwitchCompat updateRecovery = view.findViewById(R.id.preferences_update_recovery);
 
         if (!Utils.isABDevice()) {
             abPerfMode.setVisibility(View.GONE);
@@ -597,34 +596,6 @@
                 prefs.getBoolean(Constants.PREF_MOBILE_DATA_WARNING, true)));
         abPerfMode.setChecked(prefs.getBoolean(Constants.PREF_AB_PERF_MODE, false));
 
-        if (getResources().getBoolean(R.bool.config_hideRecoveryUpdate)) {
-            // Hide the update feature if explicitly requested.
-            // Might be the case of A-only devices using prebuilt vendor images.
-            updateRecovery.setVisibility(View.GONE);
-        } else if (Utils.isRecoveryUpdateExecPresent()) {
-            updateRecovery.setChecked(
-                    SystemProperties.getBoolean(Constants.UPDATE_RECOVERY_PROPERTY, false));
-        } else {
-            // There is no recovery updater script in the device, so the feature is considered
-            // forcefully enabled, just to avoid users to be confused and complain that
-            // recovery gets overwritten. That's the case of A/B and recovery-in-boot devices.
-            updateRecovery.setChecked(true);
-            updateRecovery.setOnTouchListener(new View.OnTouchListener() {
-                private Toast forcedUpdateToast = null;
-
-                @Override
-                public boolean onTouch(View v, MotionEvent event) {
-                    if (forcedUpdateToast != null) {
-                        forcedUpdateToast.cancel();
-                    }
-                    forcedUpdateToast = Toast.makeText(getApplicationContext(),
-                            getString(R.string.toast_forced_update_recovery), Toast.LENGTH_SHORT);
-                    forcedUpdateToast.show();
-                    return true;
-                }
-            });
-        }
-
         new AlertDialog.Builder(this)
                 .setTitle(R.string.menu_preferences)
                 .setView(view)
@@ -649,11 +620,6 @@
                         boolean enableABPerfMode = abPerfMode.isChecked();
                         mUpdaterService.getUpdaterController().setPerformanceMode(enableABPerfMode);
                     }
-                    if (Utils.isRecoveryUpdateExecPresent()) {
-                        boolean enableRecoveryUpdate = updateRecovery.isChecked();
-                        SystemProperties.set(Constants.UPDATE_RECOVERY_PROPERTY,
-                                String.valueOf(enableRecoveryUpdate));
-                    }
                 })
                 .show();
     }
diff --git a/app/src/main/java/org/lineageos/updater/misc/Constants.java b/app/src/main/java/org/lineageos/updater/misc/Constants.java
index beb9423..2d17dd8 100644
--- a/app/src/main/java/org/lineageos/updater/misc/Constants.java
+++ b/app/src/main/java/org/lineageos/updater/misc/Constants.java
@@ -54,8 +54,5 @@
     public static final String PREF_INSTALL_AGAIN = "install_again";
     public static final String PREF_INSTALL_NOTIFIED = "install_notified";
 
-    public static final String UPDATE_RECOVERY_EXEC = "/vendor/bin/install-recovery.sh";
-    public static final String UPDATE_RECOVERY_PROPERTY = "persist.vendor.recovery_update";
-
     public static final String HAS_SEEN_INFO_DIALOG = "has_seen_info_dialog";
 }
diff --git a/app/src/main/java/org/lineageos/updater/misc/Utils.java b/app/src/main/java/org/lineageos/updater/misc/Utils.java
index b7ba720..62474a7 100644
--- a/app/src/main/java/org/lineageos/updater/misc/Utils.java
+++ b/app/src/main/java/org/lineageos/updater/misc/Utils.java
@@ -410,10 +410,6 @@
         }
     }
 
-    public static boolean isRecoveryUpdateExecPresent() {
-        return new File(Constants.UPDATE_RECOVERY_EXEC).exists();
-    }
-
     public static String getDisplayVersion(String version) {
         float floatVersion = 0;
         try {
diff --git a/app/src/main/res/layout/preferences_dialog.xml b/app/src/main/res/layout/preferences_dialog.xml
index c1b4356..8d10123 100644
--- a/app/src/main/res/layout/preferences_dialog.xml
+++ b/app/src/main/res/layout/preferences_dialog.xml
@@ -52,12 +52,4 @@
         android:layout_marginBottom="16dp"
         android:text="@string/menu_ab_perf_mode"
         android:textSize="16sp" />
-
-    <androidx.appcompat.widget.SwitchCompat
-        android:id="@+id/preferences_update_recovery"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginBottom="16dp"
-        android:text="@string/menu_update_recovery"
-        android:textSize="16sp" />
 </LinearLayout>
diff --git a/app/src/main/res/values/config.xml b/app/src/main/res/values/config.xml
deleted file mode 100644
index 76ab686..0000000
--- a/app/src/main/res/values/config.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?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.
--->
-<resources>
-    <bool name="config_hideRecoveryUpdate">false</bool>
-</resources>
diff --git a/app/src/main/res/values/symbols.xml b/app/src/main/res/values/symbols.xml
deleted file mode 100644
index f3dc0ba..0000000
--- a/app/src/main/res/values/symbols.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?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.
--->
-<resources>
-    <java-symbol type="bool" name="config_hideRecoveryUpdate" />
-</resources>