Merge "Fix issue where can't FR Volantis if OEM unlock is enabled" into lmp-dev

This commit is contained in:
Andres Morales
2014-09-08 21:07:48 +00:00
committed by Android (Google) Code Review

View File

@@ -62,31 +62,29 @@ public class MasterClearConfirm extends Fragment {
final PersistentDataBlockManager pdbManager = (PersistentDataBlockManager) final PersistentDataBlockManager pdbManager = (PersistentDataBlockManager)
getActivity().getSystemService(Context.PERSISTENT_DATA_BLOCK_SERVICE); 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 OEM unlock is enabled, this will be wiped during FR process.
if (!pdbManager.getOemUnlockEnabled()) { final ProgressDialog progressDialog = getProgressDialog();
final ProgressDialog progressDialog = getProgressDialog(); progressDialog.show();
progressDialog.show();
// need to prevent orientation changes as we're about to go into // 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 // a long IO request, so we won't be able to access inflate resources on flash
final int oldOrientation = getActivity().getRequestedOrientation(); final int oldOrientation = getActivity().getRequestedOrientation();
getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED); getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED);
new AsyncTask<Void, Void, Void>() { new AsyncTask<Void, Void, Void>() {
@Override @Override
protected Void doInBackground(Void... params) { protected Void doInBackground(Void... params) {
pdbManager.wipe(); pdbManager.wipe();
return null; return null;
} }
@Override @Override
protected void onPostExecute(Void aVoid) { protected void onPostExecute(Void aVoid) {
progressDialog.hide(); progressDialog.hide();
getActivity().setRequestedOrientation(oldOrientation); getActivity().setRequestedOrientation(oldOrientation);
doMasterClear(); doMasterClear();
} }
}.execute(); }.execute();
}
} else { } else {
doMasterClear(); doMasterClear();
} }