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

Commit 3e4a37ad authored by Pawan Wagh's avatar Pawan Wagh Committed by Automerger Merge Worker
Browse files

Merge "UI and error message fixes for 16k developer option" into main am: e5508966 am: 588dbe4b

parents 02e0dc41 588dbe4b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -384,6 +384,13 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
                        || enableAngleController.isDefaultValue())) {
                    disableDeveloperOptions();
                } else {
                    // Disabling developer options in page-agnostic mode isn't supported as device
                    // isn't in production state
                    if (Enable16kUtils.isPageAgnosticModeOn(getContext())) {
                        Enable16kUtils.showPageAgnosticWarning(getContext());
                        onDisableDevelopmentOptionsRejected();
                        return;
                    }
                    DisableDevSettingsDialogFragment.show(this /* host */);
                }
            }
+7 −3
Original line number Diff line number Diff line
@@ -207,7 +207,10 @@ public class Enable16kPagesPreferenceController extends DeveloperOptionsPreferen
        int status = data.getInt(SystemUpdateManager.KEY_STATUS);
        if (status != SystemUpdateManager.STATUS_UNKNOWN
                && status != SystemUpdateManager.STATUS_IDLE) {
            throw new RuntimeException("System has pending update!");
            throw new RuntimeException(
                    "System has pending update! Please restart the device to complete applying"
                            + " pending update. If you are seeing this after using 16KB developer"
                            + " options, please check configuration and OTA packages!");
        }

        // Publish system update info
@@ -313,7 +316,7 @@ public class Enable16kPagesPreferenceController extends DeveloperOptionsPreferen
    }

    private void displayToast(String message) {
        Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show();
        Toast.makeText(mContext, message, Toast.LENGTH_LONG).show();
    }

    @Override
@@ -330,7 +333,7 @@ public class Enable16kPagesPreferenceController extends DeveloperOptionsPreferen

                    @Override
                    public void onFailure(@NonNull Throwable t) {
                        Log.e(TAG, "Failed to change the /data partition with ext4");
                        Log.e(TAG, "Failed to change the /data partition to ext4");
                        displayToast(mContext.getString(R.string.format_ext4_failure_toast));
                    }
                },
@@ -405,6 +408,7 @@ public class Enable16kPagesPreferenceController extends DeveloperOptionsPreferen
                        LinearLayout.LayoutParams.WRAP_CONTENT,
                        LinearLayout.LayoutParams.WRAP_CONTENT);
        progressBar.setLayoutParams(params);
        progressBar.setPadding(0, 24, 0, 24);
        builder.setView(progressBar);
        builder.setCancelable(false);
        return builder.create();
+2 −1
Original line number Diff line number Diff line
@@ -70,8 +70,9 @@ public class EnableExt4WarningDialog extends InstrumentedDialogFragment
    public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
        return new AlertDialog.Builder(getActivity())
                .setTitle(R.string.confirm_format_ext4_title)
                .setIcon(R.drawable.ic_delete_accent)
                .setMessage(R.string.confirm_format_ext4_text)
                .setPositiveButton(android.R.string.ok, this /* onClickListener */)
                .setPositiveButton(R.string.main_clear_confirm_title, this /* onClickListener */)
                .setNegativeButton(android.R.string.cancel, this /* onClickListener */)
                .create();
    }