OSDN Git Service

Option to hide swipe method
authorEvan Rosky <erosky@google.com>
Fri, 10 Jun 2016 19:15:22 +0000 (12:15 -0700)
committerEvan Rosky <erosky@google.com>
Thu, 23 Jun 2016 19:51:26 +0000 (19:51 +0000)
Bug: 27502832
Change-Id: Ia61b63279fa6f831fdfa9209747b0cbcbf807d50

res/values/bools.xml
src/com/android/settings/ChooseLockGeneric.java

index 6f04457..233c13f 100644 (file)
@@ -41,6 +41,9 @@
     <!-- Whether none security option is hide or not  (country specific). -->
     <bool name="config_hide_none_security_option">false</bool>
 
+    <!-- Whether swipe security option is hidden or not -->
+    <bool name="config_hide_swipe_security_option">false</bool>
+
     <!--Whether the storage manager exists. -->
     <bool name="config_has_storage_manager">false</bool>
 </resources>
index 6db6f76..66f4925 100644 (file)
@@ -461,11 +461,16 @@ public class ChooseLockGeneric extends SettingsActivity {
                         disabledByAdmin = adminEnforcedQuality
                                 > DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED;
                     } else if (KEY_UNLOCK_SET_NONE.equals(key)) {
-                        if (mUserId != UserHandle.myUserId()) {
-                            // Swipe doesn't make sense for profiles.
+                        if (getResources().getBoolean(R.bool.config_hide_swipe_security_option)) {
+                            enabled = false;
                             visible = false;
+                        } else {
+                            if (mUserId != UserHandle.myUserId()) {
+                                // Swipe doesn't make sense for profiles.
+                                visible = false;
+                            }
+                            enabled = quality <= DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED;
                         }
-                        enabled = quality <= DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED;
                         disabledByAdmin = adminEnforcedQuality
                                 > DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED;
                     } else if (KEY_UNLOCK_SET_PATTERN.equals(key)) {