Fix a regression in enabling unknown sources toggle automerge: ceceb2a

automerge: 8b955d1

* commit '8b955d1d47e1bcf1e989fb437f50dd7f82f1e567':
  Fix a regression in enabling unknown sources toggle
This commit is contained in:
Amith Yamasani
2014-11-12 03:12:40 +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);