Wire in device owner information into SecuritySettings
If the device owner information has been provisioned by device policy client via the DevicePolicyManager then make the current user info preference read only and add a summary to specify that the preference has been disabled by the administrator. Bug: 22547309 Change-Id: I14952abd2e022607b82ce4361cfa514549243045
This commit is contained in:
@@ -690,6 +690,8 @@
|
|||||||
<string name="cdma_security_settings_summary">Set My Location, screen unlock, credential storage lock</string>
|
<string name="cdma_security_settings_summary">Set My Location, screen unlock, credential storage lock</string>
|
||||||
<!-- In the security screen, the header title for settings related to Passwords-->
|
<!-- In the security screen, the header title for settings related to Passwords-->
|
||||||
<string name="security_passwords_title">Passwords</string>
|
<string name="security_passwords_title">Passwords</string>
|
||||||
|
<!-- Summary for settings preference disabled by administrator [CHAR LIMIT=50] -->
|
||||||
|
<string name="disabled_by_administrator_summary">Disabled by administrator</string>
|
||||||
|
|
||||||
<!-- Fingerprint enrollment and settings --><skip />
|
<!-- Fingerprint enrollment and settings --><skip />
|
||||||
<!-- Title shown for menu item that launches fingerprint settings or enrollment [CHAR LIMIT=22] -->
|
<!-- Title shown for menu item that launches fingerprint settings or enrollment [CHAR LIMIT=22] -->
|
||||||
|
@@ -214,6 +214,9 @@ public class SecuritySettings extends SettingsPreferenceFragment
|
|||||||
|
|
||||||
mOwnerInfoPref = findPreference(KEY_OWNER_INFO_SETTINGS);
|
mOwnerInfoPref = findPreference(KEY_OWNER_INFO_SETTINGS);
|
||||||
if (mOwnerInfoPref != null) {
|
if (mOwnerInfoPref != null) {
|
||||||
|
mOwnerInfoPref.setEnabled(!mLockPatternUtils.isDeviceOwnerInfoEnabled());
|
||||||
|
|
||||||
|
if (mOwnerInfoPref.isEnabled()) {
|
||||||
mOwnerInfoPref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
|
mOwnerInfoPref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceClick(Preference preference) {
|
public boolean onPreferenceClick(Preference preference) {
|
||||||
@@ -222,6 +225,7 @@ public class SecuritySettings extends SettingsPreferenceFragment
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (mIsAdmin) {
|
if (mIsAdmin) {
|
||||||
if (LockPatternUtils.isDeviceEncryptionEnabled()) {
|
if (LockPatternUtils.isDeviceEncryptionEnabled()) {
|
||||||
@@ -630,11 +634,15 @@ public class SecuritySettings extends SettingsPreferenceFragment
|
|||||||
|
|
||||||
public void updateOwnerInfo() {
|
public void updateOwnerInfo() {
|
||||||
if (mOwnerInfoPref != null) {
|
if (mOwnerInfoPref != null) {
|
||||||
|
if (mLockPatternUtils.isDeviceOwnerInfoEnabled()) {
|
||||||
|
mOwnerInfoPref.setSummary(R.string.disabled_by_administrator_summary);
|
||||||
|
} else {
|
||||||
mOwnerInfoPref.setSummary(mLockPatternUtils.isOwnerInfoEnabled(MY_USER_ID)
|
mOwnerInfoPref.setSummary(mLockPatternUtils.isOwnerInfoEnabled(MY_USER_ID)
|
||||||
? mLockPatternUtils.getOwnerInfo(MY_USER_ID)
|
? mLockPatternUtils.getOwnerInfo(MY_USER_ID)
|
||||||
: getString(R.string.owner_info_settings_summary));
|
: getString(R.string.owner_info_settings_summary));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceTreeClick(Preference preference) {
|
public boolean onPreferenceTreeClick(Preference preference) {
|
||||||
|
Reference in New Issue
Block a user