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

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/3079811

Change-Id: Ie63bca803a77b8f3468e68050898934cc8b9e1b5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Pawan Wagh
2024-05-11 03:50:47 +00:00
committed by Automerger Merge Worker
3 changed files with 16 additions and 4 deletions

View File

@@ -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 */);
}
}

View File

@@ -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();

View File

@@ -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();
}