diff options
Diffstat (limited to 'src/com/android/settings/profiles/SetupActionsFragment.java')
-rw-r--r-- | src/com/android/settings/profiles/SetupActionsFragment.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/settings/profiles/SetupActionsFragment.java b/src/com/android/settings/profiles/SetupActionsFragment.java index bc7cad1..bcd98be 100644 --- a/src/com/android/settings/profiles/SetupActionsFragment.java +++ b/src/com/android/settings/profiles/SetupActionsFragment.java @@ -26,6 +26,7 @@ import android.app.NotificationGroup; import cyanogenmod.profiles.LockSettings; import cyanogenmod.profiles.RingModeSettings; import cyanogenmod.profiles.StreamSettings; +import android.app.admin.DevicePolicyManager; import android.bluetooth.BluetoothAdapter; import android.content.ContentResolver; import android.content.Context; @@ -75,6 +76,7 @@ import com.android.settings.profiles.actions.item.AirplaneModeItem; import com.android.settings.profiles.actions.item.BrightnessItem; import com.android.settings.profiles.actions.item.AppGroupItem; import com.android.settings.profiles.actions.item.ConnectionOverrideItem; +import com.android.settings.profiles.actions.item.DisabledItem; import com.android.settings.profiles.actions.item.DozeModeItem; import com.android.settings.profiles.actions.item.Header; import com.android.settings.profiles.actions.item.Item; @@ -238,7 +240,14 @@ public class SetupActionsFragment extends SettingsPreferenceFragment mItems.add(new Header(getString(R.string.profile_system_settings_title))); mItems.add(new RingModeItem(mProfile.getRingMode())); mItems.add(new AirplaneModeItem(mProfile.getAirplaneMode())); - mItems.add(new LockModeItem(mProfile)); + DevicePolicyManager dpm = (DevicePolicyManager) getSystemService( + Context.DEVICE_POLICY_SERVICE); + if (!dpm.requireSecureKeyguard()) { + mItems.add(new LockModeItem(mProfile)); + } else { + mItems.add(new DisabledItem(R.string.profile_lockmode_title, + R.string.profile_lockmode_policy_disabled_summary)); + } mItems.add(new BrightnessItem(mProfile.getBrightness())); final Activity activity = getActivity(); |