Merge "Disallow turning off developer options in page-agnostic mode" into main am: 0d124654ca
am: 74da70de2d
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/3073278 Change-Id: I985bf4d4f78e2d17915d330430eae5818e7fb44b Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -595,6 +595,15 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
|
||||
if (Utils.isMonkeyRunning()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
DevelopmentSettingsEnabler.setDevelopmentSettingsEnabled(getContext(), false);
|
||||
final SystemPropPoker poker = SystemPropPoker.getInstance();
|
||||
poker.blockPokes();
|
||||
|
@@ -17,6 +17,7 @@
|
||||
package com.android.settings.development;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.SystemProperties;
|
||||
import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
@@ -116,4 +117,13 @@ public class Enable16kUtils {
|
||||
public static boolean isUsing16kbPages() {
|
||||
return PAGE_SIZE == PAGE_SIZE_16KB;
|
||||
}
|
||||
|
||||
/**
|
||||
* show page-agnostic mode warning dialog to user
|
||||
* @param context to start activity
|
||||
*/
|
||||
public static void showPageAgnosticWarning(@NonNull Context context) {
|
||||
Intent intent = new Intent(context, PageAgnosticWarningActivity.class);
|
||||
context.startActivityAsUser(intent, UserHandle.SYSTEM);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user