Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d20261b0 authored by David van Tonder's avatar David van Tonder Committed by Gerrit Code Review
Browse files

Merge "Profile: respect DPM when overriding screen lock (2/2)" into cm-10.1

parents 95be1ae5 284bc9b3
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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);
        }