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

Commit 692f794e authored by Howard Chen's avatar Howard Chen Committed by Android (Google) Code Review
Browse files

Merge "Disable factory reset in DSU mode" into tm-dev

parents d4a01ee0 d45a0789
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -26,11 +26,13 @@ import android.accounts.AccountManager;
import android.accounts.AuthenticatorDescription;
import android.app.ActionBar;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.admin.DevicePolicyManager;
import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
@@ -43,6 +45,7 @@ import android.os.Environment;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.UserManager;
import android.os.image.DynamicSystemManager;
import android.provider.Settings;
import android.sysprop.VoldProperties;
import android.telephony.euicc.EuiccManager;
@@ -266,6 +269,19 @@ public class MainClear extends InstrumentedFragment implements OnGlobalLayoutLis
                return;
            }

            final DynamicSystemManager dsuManager = (DynamicSystemManager)
                    getActivity().getSystemService(Context.DYNAMIC_SYSTEM_SERVICE);
            if (dsuManager.isInUse()) {
                AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
                builder.setTitle(R.string.dsu_is_running);
                builder.setPositiveButton(R.string.okay, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {}
                });
                AlertDialog dsuAlertdialog = builder.create();
                dsuAlertdialog.show();
                return;
            }

            if (runKeyguardConfirmation(KEYGUARD_REQUEST)) {
                return;
            }