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

@@ -339,9 +339,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
setIfOnlyAvailableForAdmins(true);
if (isUiRestricted()
|| Settings.Global.getInt(getActivity().getContentResolver(),
Settings.Global.DEVICE_PROVISIONED, 0) == 0) {
if (isUiRestricted() || !Utils.isDeviceProvisioned(getActivity())) {
// Block access to developer options if the user is not the owner, if user policy
// restricts it, or if the device has not been provisioned
mUnavailable = true;