Fix a regression in enabling unknown sources toggle

automerge: ceceb2a

* commit 'ceceb2ab07aab457a4229d051de222ad88ed62a1':
  Fix a regression in enabling unknown sources toggle
This commit is contained in:
Amith Yamasani
2014-11-12 01:13:42 +00:00
committed by android-build-merger

View File

@@ -336,7 +336,8 @@ public class SecuritySettings extends SettingsPreferenceFragment
KEY_TOGGLE_INSTALL_APPLICATIONS);
mToggleAppInstallation.setChecked(isNonMarketAppsAllowed());
// Side loading of apps.
mToggleAppInstallation.setEnabled(mIsPrimary);
// Disable for restricted profiles. For others, check if policy disallows it.
mToggleAppInstallation.setEnabled(!um.getUserInfo(UserHandle.myUserId()).isRestricted());
if (um.hasUserRestriction(UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES)
|| um.hasUserRestriction(UserManager.DISALLOW_INSTALL_APPS)) {
mToggleAppInstallation.setEnabled(false);