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

Commit 720073fb authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Merge branch '2241-t-fast_update' into 'v2.4-t'

Updater: Force performance mode for FP4 and FP5

See merge request !200
parents 2656c1c7 49eae3fb
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -619,6 +619,11 @@ public class UpdatesActivity extends UpdatesListActivity implements UpdateImport
        abPerfMode.setChecked(prefs.getBoolean(Constants.PREF_AB_PERF_MODE,
                getResources().getBoolean(R.bool.config_prioritizeUpdateProcess)));

        if (Utils.isPrefDevices()) {
            abPerfMode.setChecked(true);
            abPerfMode.setEnabled(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.
+1 −1
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ class ABUpdateInstaller {

        boolean enableABPerfMode = PreferenceManager.getDefaultSharedPreferences(mContext)
                .getBoolean(Constants.PREF_AB_PERF_MODE, false);
        mUpdateEngine.setPerformanceMode(enableABPerfMode);
        mUpdateEngine.setPerformanceMode(enableABPerfMode || Utils.isPrefDevices());

        String zipFileUri = "file://" + file.getAbsolutePath();
        try {
+6 −0
Original line number Diff line number Diff line
@@ -531,6 +531,12 @@ public class Utils {
        return isAB;
    }

    public static boolean isPrefDevices() {
        String manufacturer = Build.MANUFACTURER.toLowerCase(Locale.ROOT);
        String device = Build.DEVICE.toLowerCase(Locale.ROOT);
        return manufacturer.equals("fairphone") && (device.equals("fp4") || device.equals("fp5"));
    }

    public static boolean isDevModeOn(Context context) {
        return Settings.Secure.getInt(context.getContentResolver(),
                Settings.Global.DEVELOPMENT_SETTINGS_ENABLED , 0) == 1;