Block developer settings during SUW

Block access to development settings by tapping on the build number
in "About phone". Once SUW has completed, taps will be allowed.

Bug: 25290269
Change-Id: I9b2787712237f28fba446abab15a9e1c075d0419
This commit is contained in:
Russell Brenner
2015-11-09 11:35:42 -08:00
parent 26bb544ff2
commit 4836ab6df4
2 changed files with 11 additions and 1 deletions

View File

@@ -259,7 +259,11 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
if (android.os.Process.myUserHandle().getIdentifier() != UserHandle.USER_OWNER
|| mUm.hasUserRestriction(UserManager.DISALLOW_DEBUGGING_FEATURES)) {
|| mUm.hasUserRestriction(UserManager.DISALLOW_DEBUGGING_FEATURES)
|| Settings.Global.getInt(getActivity().getContentResolver(),
Settings.Global.DEVICE_PROVISIONED, 0) == 0) {
// 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;
setPreferenceScreen(new PreferenceScreen(getActivity(), null));
return;