From e6bf2a5609b9aabbd790c3c3680172f4b50a3f8e Mon Sep 17 00:00:00 2001 From: Andres Morales Date: Mon, 8 Sep 2014 13:14:00 -0700 Subject: [PATCH] Fix issue where can't FR Volantis if OEM unlock is enabled Bug: 17426800 Change-Id: I02340d1ec4b80d9e3b05d35d36653c6ff4ff3232 --- .../android/settings/MasterClearConfirm.java | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/src/com/android/settings/MasterClearConfirm.java b/src/com/android/settings/MasterClearConfirm.java index 0455d747e5e..40c23244a48 100644 --- a/src/com/android/settings/MasterClearConfirm.java +++ b/src/com/android/settings/MasterClearConfirm.java @@ -62,31 +62,29 @@ public class MasterClearConfirm extends Fragment { final PersistentDataBlockManager pdbManager = (PersistentDataBlockManager) getActivity().getSystemService(Context.PERSISTENT_DATA_BLOCK_SERVICE); - if (pdbManager != null) { + if (pdbManager != null && !pdbManager.getOemUnlockEnabled()) { // if OEM unlock is enabled, this will be wiped during FR process. - if (!pdbManager.getOemUnlockEnabled()) { - final ProgressDialog progressDialog = getProgressDialog(); - progressDialog.show(); + final ProgressDialog progressDialog = getProgressDialog(); + progressDialog.show(); - // need to prevent orientation changes as we're about to go into - // a long IO request, so we won't be able to access inflate resources on flash - final int oldOrientation = getActivity().getRequestedOrientation(); - getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED); - new AsyncTask() { - @Override - protected Void doInBackground(Void... params) { - pdbManager.wipe(); - return null; - } + // need to prevent orientation changes as we're about to go into + // a long IO request, so we won't be able to access inflate resources on flash + final int oldOrientation = getActivity().getRequestedOrientation(); + getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED); + new AsyncTask() { + @Override + protected Void doInBackground(Void... params) { + pdbManager.wipe(); + return null; + } - @Override - protected void onPostExecute(Void aVoid) { - progressDialog.hide(); - getActivity().setRequestedOrientation(oldOrientation); - doMasterClear(); - } - }.execute(); - } + @Override + protected void onPostExecute(Void aVoid) { + progressDialog.hide(); + getActivity().setRequestedOrientation(oldOrientation); + doMasterClear(); + } + }.execute(); } else { doMasterClear(); }