diff options
-rw-r--r-- | src/com/android/settings/profiles/ProfileConfig.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/settings/profiles/ProfileConfig.java b/src/com/android/settings/profiles/ProfileConfig.java index 2a0981d..4e6967b 100644 --- a/src/com/android/settings/profiles/ProfileConfig.java +++ b/src/com/android/settings/profiles/ProfileConfig.java @@ -27,6 +27,7 @@ import android.app.ProfileGroup; import android.app.ProfileManager; import android.app.RingModeSettings; import android.app.StreamSettings; +import android.app.admin.DevicePolicyManager; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; @@ -234,6 +235,13 @@ public class ProfileConfig extends SettingsPreferenceFragment R.array.profile_lockmode_summaries)[mProfile.getScreenLockMode()]); mScreenLockModePreference.setValue(String.valueOf(mProfile.getScreenLockMode())); mScreenLockModePreference.setOnPreferenceChangeListener(this); + + DevicePolicyManager dpm = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE); + if (dpm.requireSecureKeyguard()) { + mScreenLockModePreference.setEnabled(false); + mScreenLockModePreference.setSummary(R.string.unlock_set_unlock_disabled_summary); + } + systemPrefs.addPreference(mScreenLockModePreference); } |