diff options
author | Pawit Pornkitprasan <p.pawit@gmail.com> | 2013-04-03 20:56:50 +0700 |
---|---|---|
committer | Pawit Pornkitprasan <p.pawit@gmail.com> | 2013-04-03 20:56:50 +0700 |
commit | 284bc9b3ff76d24c2dffcdd620172bcb4b0721cc (patch) | |
tree | e4b3c4eeec6bcd17a9f41cd36314131c4d670c29 /src/com | |
parent | 2433cb7f952f2f1c9e80932e760f8617a1d7d95e (diff) | |
download | packages_apps_settings-284bc9b3ff76d24c2dffcdd620172bcb4b0721cc.zip packages_apps_settings-284bc9b3ff76d24c2dffcdd620172bcb4b0721cc.tar.gz packages_apps_settings-284bc9b3ff76d24c2dffcdd620172bcb4b0721cc.tar.bz2 |
Profile: respect DPM when overriding screen lock (2/2)
Change-Id: Ia0c2b51cfa35e47328a68366964f231e2bb7ebfa
Diffstat (limited to 'src/com')
-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); } |