Prevents users from being added if device is not provisioned

Also added a utility function for checking provisioning, instead of
repeating code for this check in several places.

bug:26156445
Change-Id: I9f4a280dd0cdf889f892e386dbf6a3fdb2a052ef
This commit is contained in:
Udam Saini
2016-03-25 10:47:00 -07:00
parent 1997f76cfc
commit 679f7ad07e
6 changed files with 15 additions and 13 deletions

View File

@@ -68,8 +68,7 @@ public class MasterClearConfirm extends InstrumentedFragment {
getActivity().getSystemService(Context.PERSISTENT_DATA_BLOCK_SERVICE);
if (pdbManager != null && !pdbManager.getOemUnlockEnabled() &&
Settings.Global.getInt(getActivity().getContentResolver(),
Settings.Global.DEVICE_PROVISIONED, 0) != 0) {
Utils.isDeviceProvisioned(getActivity())) {
// if OEM unlock is enabled, this will be wiped during FR process. If disabled, it
// will be wiped here, unless the device is still being provisioned, in which case
// the persistent data block will be preserved.