Remove the lockscreen widget setting
Bug: 14087729 Change-Id: Ia276411f7622fe1211528ab779a7099bb20800d4
This commit is contained in:
@@ -51,10 +51,6 @@
|
|||||||
android:key="power_button_instantly_locks"
|
android:key="power_button_instantly_locks"
|
||||||
android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/>
|
android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/>
|
||||||
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:key="keyguard_enable_widgets"
|
|
||||||
android:title="@string/security_enable_widgets_title"/>
|
|
||||||
|
|
||||||
<PreferenceScreen
|
<PreferenceScreen
|
||||||
android:fragment="com.android.settings.OwnerInfoSettings"
|
android:fragment="com.android.settings.OwnerInfoSettings"
|
||||||
android:key="owner_info_settings"
|
android:key="owner_info_settings"
|
||||||
|
@@ -26,10 +26,6 @@
|
|||||||
android:summary="@string/unlock_set_unlock_mode_none"
|
android:summary="@string/unlock_set_unlock_mode_none"
|
||||||
android:persistent="false"/>
|
android:persistent="false"/>
|
||||||
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:key="keyguard_enable_widgets"
|
|
||||||
android:title="@string/security_enable_widgets_title"/>
|
|
||||||
|
|
||||||
<PreferenceScreen
|
<PreferenceScreen
|
||||||
android:fragment="com.android.settings.OwnerInfoSettings"
|
android:fragment="com.android.settings.OwnerInfoSettings"
|
||||||
android:key="owner_info_settings"
|
android:key="owner_info_settings"
|
||||||
|
@@ -26,10 +26,6 @@
|
|||||||
android:summary="@string/unlock_set_unlock_mode_off"
|
android:summary="@string/unlock_set_unlock_mode_off"
|
||||||
android:persistent="false"/>
|
android:persistent="false"/>
|
||||||
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:key="keyguard_enable_widgets"
|
|
||||||
android:title="@string/security_enable_widgets_title"/>
|
|
||||||
|
|
||||||
<PreferenceScreen
|
<PreferenceScreen
|
||||||
android:fragment="com.android.settings.OwnerInfoSettings"
|
android:fragment="com.android.settings.OwnerInfoSettings"
|
||||||
android:key="owner_info_settings"
|
android:key="owner_info_settings"
|
||||||
|
@@ -38,10 +38,6 @@
|
|||||||
android:key="power_button_instantly_locks"
|
android:key="power_button_instantly_locks"
|
||||||
android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/>
|
android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/>
|
||||||
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:key="keyguard_enable_widgets"
|
|
||||||
android:title="@string/security_enable_widgets_title"/>
|
|
||||||
|
|
||||||
<PreferenceScreen
|
<PreferenceScreen
|
||||||
android:fragment="com.android.settings.OwnerInfoSettings"
|
android:fragment="com.android.settings.OwnerInfoSettings"
|
||||||
android:key="owner_info_settings"
|
android:key="owner_info_settings"
|
||||||
|
@@ -42,10 +42,6 @@
|
|||||||
android:key="power_button_instantly_locks"
|
android:key="power_button_instantly_locks"
|
||||||
android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/>
|
android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/>
|
||||||
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:key="keyguard_enable_widgets"
|
|
||||||
android:title="@string/security_enable_widgets_title"/>
|
|
||||||
|
|
||||||
<PreferenceScreen
|
<PreferenceScreen
|
||||||
android:fragment="com.android.settings.OwnerInfoSettings"
|
android:fragment="com.android.settings.OwnerInfoSettings"
|
||||||
android:key="owner_info_settings"
|
android:key="owner_info_settings"
|
||||||
|
@@ -38,10 +38,6 @@
|
|||||||
android:key="power_button_instantly_locks"
|
android:key="power_button_instantly_locks"
|
||||||
android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/>
|
android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/>
|
||||||
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:key="keyguard_enable_widgets"
|
|
||||||
android:title="@string/security_enable_widgets_title"/>
|
|
||||||
|
|
||||||
<PreferenceScreen
|
<PreferenceScreen
|
||||||
android:fragment="com.android.settings.OwnerInfoSettings"
|
android:fragment="com.android.settings.OwnerInfoSettings"
|
||||||
android:key="owner_info_settings"
|
android:key="owner_info_settings"
|
||||||
|
@@ -75,7 +75,6 @@ public class SecuritySettings extends RestrictedSettingsFragment
|
|||||||
private static final String KEY_DEVICE_ADMIN_CATEGORY = "device_admin_category";
|
private static final String KEY_DEVICE_ADMIN_CATEGORY = "device_admin_category";
|
||||||
private static final String KEY_LOCK_AFTER_TIMEOUT = "lock_after_timeout";
|
private static final String KEY_LOCK_AFTER_TIMEOUT = "lock_after_timeout";
|
||||||
private static final String KEY_OWNER_INFO_SETTINGS = "owner_info_settings";
|
private static final String KEY_OWNER_INFO_SETTINGS = "owner_info_settings";
|
||||||
private static final String KEY_ENABLE_WIDGETS = "keyguard_enable_widgets";
|
|
||||||
|
|
||||||
private static final int SET_OR_CHANGE_LOCK_METHOD_REQUEST = 123;
|
private static final int SET_OR_CHANGE_LOCK_METHOD_REQUEST = 123;
|
||||||
private static final int CONFIRM_EXISTING_FOR_BIOMETRIC_WEAK_IMPROVE_REQUEST = 124;
|
private static final int CONFIRM_EXISTING_FOR_BIOMETRIC_WEAK_IMPROVE_REQUEST = 124;
|
||||||
@@ -111,7 +110,6 @@ public class SecuritySettings extends RestrictedSettingsFragment
|
|||||||
private DialogInterface mWarnInstallApps;
|
private DialogInterface mWarnInstallApps;
|
||||||
private CheckBoxPreference mToggleVerifyApps;
|
private CheckBoxPreference mToggleVerifyApps;
|
||||||
private CheckBoxPreference mPowerButtonInstantlyLocks;
|
private CheckBoxPreference mPowerButtonInstantlyLocks;
|
||||||
private CheckBoxPreference mEnableKeyguardWidgets;
|
|
||||||
|
|
||||||
private boolean mIsPrimary;
|
private boolean mIsPrimary;
|
||||||
|
|
||||||
@@ -270,31 +268,6 @@ public class SecuritySettings extends RestrictedSettingsFragment
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable or disable keyguard widget checkbox based on DPM state
|
|
||||||
mEnableKeyguardWidgets = (CheckBoxPreference) root.findPreference(KEY_ENABLE_WIDGETS);
|
|
||||||
if (mEnableKeyguardWidgets != null) {
|
|
||||||
if (ActivityManager.isLowRamDeviceStatic()
|
|
||||||
|| mLockPatternUtils.isLockScreenDisabled()) {
|
|
||||||
// Widgets take a lot of RAM, so disable them on low-memory devices
|
|
||||||
PreferenceGroup securityCategory
|
|
||||||
= (PreferenceGroup) root.findPreference(KEY_SECURITY_CATEGORY);
|
|
||||||
if (securityCategory != null) {
|
|
||||||
securityCategory.removePreference(root.findPreference(KEY_ENABLE_WIDGETS));
|
|
||||||
mEnableKeyguardWidgets = null;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
final boolean disabled = (0 != (mDPM.getKeyguardDisabledFeatures(null)
|
|
||||||
& DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL));
|
|
||||||
if (disabled) {
|
|
||||||
mEnableKeyguardWidgets.setSummary(
|
|
||||||
R.string.security_enable_widgets_disabled_summary);
|
|
||||||
} else {
|
|
||||||
mEnableKeyguardWidgets.setSummary("");
|
|
||||||
}
|
|
||||||
mEnableKeyguardWidgets.setEnabled(!disabled);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show password
|
// Show password
|
||||||
mShowPassword = (CheckBoxPreference) root.findPreference(KEY_SHOW_PASSWORD);
|
mShowPassword = (CheckBoxPreference) root.findPreference(KEY_SHOW_PASSWORD);
|
||||||
mResetCredentials = root.findPreference(KEY_RESET_CREDENTIALS);
|
mResetCredentials = root.findPreference(KEY_RESET_CREDENTIALS);
|
||||||
@@ -504,10 +477,6 @@ public class SecuritySettings extends RestrictedSettingsFragment
|
|||||||
if (mResetCredentials != null) {
|
if (mResetCredentials != null) {
|
||||||
mResetCredentials.setEnabled(!mKeyStore.isEmpty());
|
mResetCredentials.setEnabled(!mKeyStore.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mEnableKeyguardWidgets != null) {
|
|
||||||
mEnableKeyguardWidgets.setChecked(lockPatternUtils.getWidgetsEnabled());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -561,8 +530,6 @@ public class SecuritySettings extends RestrictedSettingsFragment
|
|||||||
lockPatternUtils.setVisiblePatternEnabled(isToggled(preference));
|
lockPatternUtils.setVisiblePatternEnabled(isToggled(preference));
|
||||||
} else if (KEY_POWER_INSTANTLY_LOCKS.equals(key)) {
|
} else if (KEY_POWER_INSTANTLY_LOCKS.equals(key)) {
|
||||||
lockPatternUtils.setPowerButtonInstantlyLocks(isToggled(preference));
|
lockPatternUtils.setPowerButtonInstantlyLocks(isToggled(preference));
|
||||||
} else if (KEY_ENABLE_WIDGETS.equals(key)) {
|
|
||||||
lockPatternUtils.setWidgetsEnabled(mEnableKeyguardWidgets.isChecked());
|
|
||||||
} else if (preference == mShowPassword) {
|
} else if (preference == mShowPassword) {
|
||||||
Settings.System.putInt(getContentResolver(), Settings.System.TEXT_SHOW_PASSWORD,
|
Settings.System.putInt(getContentResolver(), Settings.System.TEXT_SHOW_PASSWORD,
|
||||||
mShowPassword.isChecked() ? 1 : 0);
|
mShowPassword.isChecked() ? 1 : 0);
|
||||||
@@ -713,24 +680,6 @@ public class SecuritySettings extends RestrictedSettingsFragment
|
|||||||
result.add(data);
|
result.add(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
LockPatternUtils lockPatternUtils = new LockPatternUtils(context);
|
|
||||||
|
|
||||||
if (!ActivityManager.isLowRamDeviceStatic()
|
|
||||||
&& !lockPatternUtils.isLockScreenDisabled()) {
|
|
||||||
DevicePolicyManager dpm = (DevicePolicyManager)
|
|
||||||
context.getSystemService(Context.DEVICE_POLICY_SERVICE);
|
|
||||||
|
|
||||||
final boolean disabled = (0 != (dpm.getKeyguardDisabledFeatures(null)
|
|
||||||
& DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL));
|
|
||||||
|
|
||||||
if (disabled) {
|
|
||||||
data = new SearchIndexableRaw(context);
|
|
||||||
data.title = res.getString(R.string.security_enable_widgets_disabled_summary);
|
|
||||||
data.screenTitle = screenTitle;
|
|
||||||
result.add(data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Credential storage
|
// Credential storage
|
||||||
final UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
|
final UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
|
||||||
|
|
||||||
@@ -771,12 +720,6 @@ public class SecuritySettings extends RestrictedSettingsFragment
|
|||||||
keys.add(KEY_SIM_LOCK);
|
keys.add(KEY_SIM_LOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ActivityManager.isLowRamDeviceStatic()
|
|
||||||
|| lockPatternUtils.isLockScreenDisabled()) {
|
|
||||||
// Widgets take a lot of RAM, so disable them on low-memory devices
|
|
||||||
keys.add(KEY_ENABLE_WIDGETS);
|
|
||||||
}
|
|
||||||
|
|
||||||
final UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
|
final UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
|
||||||
if (um.hasUserRestriction(UserManager.DISALLOW_CONFIG_CREDENTIALS)) {
|
if (um.hasUserRestriction(UserManager.DISALLOW_CONFIG_CREDENTIALS)) {
|
||||||
keys.add(KEY_CREDENTIALS_MANAGER);
|
keys.add(KEY_CREDENTIALS_MANAGER);
|
||||||
|
Reference in New Issue
Block a user