Updater: Remove A/B performance mode setting
Change-Id: I580cfa5893e0f9866d11139130bd3591dd5d805e
diff --git a/app/src/main/java/org/lineageos/updater/UpdatesActivity.java b/app/src/main/java/org/lineageos/updater/UpdatesActivity.java
index 4a0825d..8855a8f 100644
--- a/app/src/main/java/org/lineageos/updater/UpdatesActivity.java
+++ b/app/src/main/java/org/lineageos/updater/UpdatesActivity.java
@@ -583,18 +583,12 @@
SwitchCompat autoDelete = view.findViewById(R.id.preferences_auto_delete_updates);
SwitchCompat meteredNetworkWarning = view.findViewById(
R.id.preferences_metered_network_warning);
- SwitchCompat abPerfMode = view.findViewById(R.id.preferences_ab_perf_mode);
-
- if (!Utils.isABDevice()) {
- abPerfMode.setVisibility(View.GONE);
- }
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
autoCheckInterval.setSelection(Utils.getUpdateCheckSetting(this));
autoDelete.setChecked(prefs.getBoolean(Constants.PREF_AUTO_DELETE_UPDATES, false));
meteredNetworkWarning.setChecked(prefs.getBoolean(Constants.PREF_METERED_NETWORK_WARNING,
prefs.getBoolean(Constants.PREF_MOBILE_DATA_WARNING, true)));
- abPerfMode.setChecked(prefs.getBoolean(Constants.PREF_AB_PERF_MODE, false));
new AlertDialog.Builder(this)
.setTitle(R.string.menu_preferences)
@@ -606,7 +600,6 @@
.putBoolean(Constants.PREF_AUTO_DELETE_UPDATES, autoDelete.isChecked())
.putBoolean(Constants.PREF_METERED_NETWORK_WARNING,
meteredNetworkWarning.isChecked())
- .putBoolean(Constants.PREF_AB_PERF_MODE, abPerfMode.isChecked())
.apply();
if (Utils.isUpdateCheckEnabled(this)) {
@@ -615,11 +608,6 @@
UpdatesCheckReceiver.cancelRepeatingUpdatesCheck(this);
UpdatesCheckReceiver.cancelUpdatesCheck(this);
}
-
- if (Utils.isABDevice()) {
- boolean enableABPerfMode = abPerfMode.isChecked();
- mUpdaterService.getUpdaterController().setPerformanceMode(enableABPerfMode);
- }
})
.show();
}
diff --git a/app/src/main/java/org/lineageos/updater/controller/ABUpdateInstaller.java b/app/src/main/java/org/lineageos/updater/controller/ABUpdateInstaller.java
index a7ad9fa..6b4c02c 100644
--- a/app/src/main/java/org/lineageos/updater/controller/ABUpdateInstaller.java
+++ b/app/src/main/java/org/lineageos/updater/controller/ABUpdateInstaller.java
@@ -207,10 +207,6 @@
}
}
- boolean enableABPerfMode = PreferenceManager.getDefaultSharedPreferences(mContext)
- .getBoolean(Constants.PREF_AB_PERF_MODE, false);
- mUpdateEngine.setPerformanceMode(enableABPerfMode);
-
String zipFileUri = "file://" + file.getAbsolutePath();
mUpdateEngine.applyPayload(zipFileUri, offset, 0, headerKeyValuePairs);
@@ -273,10 +269,6 @@
}
- public void setPerformanceMode(boolean enable) {
- mUpdateEngine.setPerformanceMode(enable);
- }
-
public void suspend() {
if (!isInstallingUpdate(mContext)) {
Log.e(TAG, "cancel: Not installing any update");
diff --git a/app/src/main/java/org/lineageos/updater/controller/UpdaterController.java b/app/src/main/java/org/lineageos/updater/controller/UpdaterController.java
index daa710c..3d3dc37 100644
--- a/app/src/main/java/org/lineageos/updater/controller/UpdaterController.java
+++ b/app/src/main/java/org/lineageos/updater/controller/UpdaterController.java
@@ -546,11 +546,4 @@
public boolean isWaitingForReboot(String downloadId) {
return ABUpdateInstaller.isWaitingForReboot(mContext, downloadId);
}
-
- public void setPerformanceMode(boolean enable) {
- if (!Utils.isABDevice()) {
- return;
- }
- ABUpdateInstaller.getInstance(mContext, this).setPerformanceMode(enable);
- }
}
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 2d17dd8..0aee507 100644
--- a/app/src/main/java/org/lineageos/updater/misc/Constants.java
+++ b/app/src/main/java/org/lineageos/updater/misc/Constants.java
@@ -31,7 +31,6 @@
public static final String PREF_LAST_UPDATE_CHECK = "last_update_check";
public static final String PREF_AUTO_UPDATES_CHECK_INTERVAL = "auto_updates_check_interval";
public static final String PREF_AUTO_DELETE_UPDATES = "auto_delete_updates";
- public static final String PREF_AB_PERF_MODE = "ab_perf_mode";
public static final String PREF_METERED_NETWORK_WARNING = "pref_metered_network_warning";
public static final String PREF_MOBILE_DATA_WARNING = "pref_mobile_data_warning";
public static final String PREF_NEEDS_REBOOT_ID = "needs_reboot_id";
diff --git a/app/src/main/res/layout/preferences_dialog.xml b/app/src/main/res/layout/preferences_dialog.xml
index 8d10123..1c01c32 100644
--- a/app/src/main/res/layout/preferences_dialog.xml
+++ b/app/src/main/res/layout/preferences_dialog.xml
@@ -44,12 +44,4 @@
android:layout_marginBottom="16dp"
android:text="@string/menu_metered_network_warning"
android:textSize="16sp" />
-
- <androidx.appcompat.widget.SwitchCompat
- android:id="@+id/preferences_ab_perf_mode"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="16dp"
- android:text="@string/menu_ab_perf_mode"
- android:textSize="16sp" />
</LinearLayout>