Fix 2579923: Make changing lock screen method more discoverable.
This changes the organization of lock screen security settings
to make choosing an alternate unlock method more discoverable.
Instead of having to disable the old lock method to use a new
one, the user now just has one set/change option in lock settings,
with a list of method-specific setting below it.
In addition, we ask the user to confirm their old credentials
before prompting them to choose a new one, which eliminates one
source of confusion.
Also, ChooseLockGeneric now shows a UI if quality isn't specified.
Any unlock method less secure than minimum specified by
DevicePolicyManager (if active) is greyed out.
Change-Id: Iecc6f64d4d3368a583f06f8d5fe9655cc3d5bd3b
diff --git a/res/xml/security_settings_chooser.xml b/res/xml/security_settings_chooser.xml
index 4f5797f4..095c69f 100644
--- a/res/xml/security_settings_chooser.xml
+++ b/res/xml/security_settings_chooser.xml
@@ -21,21 +21,9 @@
android:title="@string/lock_settings_title">
<PreferenceScreen
- android:key="unlock_set_pattern"
- android:title="@string/unlock_set_unlock_pattern_title"
- android:summary="@string/unlock_set_unlock_pattern_summary"
- android:persistent="false"/>
-
- <PreferenceScreen
- android:key="unlock_set_pin"
- android:title="@string/unlock_set_unlock_pin_title"
- android:summary="@string/unlock_set_unlock_pin_summary"
- android:persistent="false"/>
-
- <PreferenceScreen
- android:key="unlock_set_password"
- android:title="@string/unlock_set_unlock_password_title"
- android:summary="@string/unlock_set_unlock_password_summary"
+ android:key="unlock_set_or_change"
+ android:title="@string/unlock_set_unlock_launch_picker_title"
+ android:summary="@string/unlock_set_unlock_launch_picker_summary"
android:persistent="false"/>
</PreferenceCategory>
diff --git a/res/xml/security_settings_password.xml b/res/xml/security_settings_password.xml
index 9addee4..ac06711 100644
--- a/res/xml/security_settings_password.xml
+++ b/res/xml/security_settings_password.xml
@@ -21,14 +21,9 @@
android:title="@string/lock_settings_title">
<PreferenceScreen
- android:key="unlock_method_disable"
- android:title="@string/unlock_disable_lock_title"
- android:summary="@string/unlock_disable_lock_password_summary"
- android:persistent="false"/>
-
- <PreferenceScreen
- android:key="unlock_method_change_current"
- android:title="@string/unlock_change_lock_password_title"
+ android:key="unlock_set_or_change"
+ android:title="@string/unlock_set_unlock_launch_picker_change_title"
+ android:summary="@string/unlock_set_unlock_launch_picker_change_summary"
android:persistent="false"/>
<CheckBoxPreference
diff --git a/res/xml/security_settings_pattern.xml b/res/xml/security_settings_pattern.xml
index 467fbd7..095828a 100644
--- a/res/xml/security_settings_pattern.xml
+++ b/res/xml/security_settings_pattern.xml
@@ -21,14 +21,9 @@
android:title="@string/lock_settings_title">
<PreferenceScreen
- android:key="unlock_method_disable"
- android:title="@string/unlock_disable_lock_title"
- android:summary="@string/unlock_disable_lock_pattern_summary"
- android:persistent="false"/>
-
- <PreferenceScreen
- android:key="unlock_method_change_current"
- android:title="@string/unlock_change_lock_pattern_title"
+ android:key="unlock_set_or_change"
+ android:title="@string/unlock_set_unlock_launch_picker_change_title"
+ android:summary="@string/unlock_set_unlock_launch_picker_change_summary"
android:persistent="false"/>
<CheckBoxPreference
diff --git a/res/xml/security_settings_picker.xml b/res/xml/security_settings_picker.xml
new file mode 100644
index 0000000..cbed209
--- /dev/null
+++ b/res/xml/security_settings_picker.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <PreferenceCategory
+ android:key="security_picker_category"
+ android:title="@string/lock_settings_picker_title">
+
+ <PreferenceScreen
+ android:key="unlock_set_none"
+ android:title="@string/unlock_set_unlock_none_title"
+ android:summary="@string/unlock_set_unlock_none_summary"
+ android:persistent="false"/>
+
+ <PreferenceScreen
+ android:key="unlock_set_pattern"
+ android:title="@string/unlock_set_unlock_pattern_title"
+ android:summary="@string/unlock_set_unlock_pattern_summary"
+ android:persistent="false"/>
+
+ <PreferenceScreen
+ android:key="unlock_set_pin"
+ android:title="@string/unlock_set_unlock_pin_title"
+ android:summary="@string/unlock_set_unlock_pin_summary"
+ android:persistent="false"/>
+
+ <PreferenceScreen
+ android:key="unlock_set_password"
+ android:title="@string/unlock_set_unlock_password_title"
+ android:summary="@string/unlock_set_unlock_password_summary"
+ android:persistent="false"/>
+
+ </PreferenceCategory>
+
+</PreferenceScreen>
diff --git a/res/xml/security_settings_pin.xml b/res/xml/security_settings_pin.xml
index fb77714..ac06711 100644
--- a/res/xml/security_settings_pin.xml
+++ b/res/xml/security_settings_pin.xml
@@ -21,14 +21,9 @@
android:title="@string/lock_settings_title">
<PreferenceScreen
- android:key="unlock_method_disable"
- android:title="@string/unlock_disable_lock_title"
- android:summary="@string/unlock_disable_lock_pin_summary"
- android:persistent="false"/>
-
- <PreferenceScreen
- android:key="unlock_method_change_current"
- android:title="@string/unlock_change_lock_pin_title"
+ android:key="unlock_set_or_change"
+ android:title="@string/unlock_set_unlock_launch_picker_change_title"
+ android:summary="@string/unlock_set_unlock_launch_picker_change_summary"
android:persistent="false"/>
<CheckBoxPreference