16/n: Add PIN/Password
Bug: 140127687
Make AuthCredentialView abstract, and have the following subclasses
1) AuthCredentialPatternView
2) AuthCredentialPasswordView
Back button cancels password authentication
Test: manual test with pattern, pin, password
Test: atest com.android.systemui.biometrics
Change-Id: I95e42144616a59827da25d10d063990452714f76
diff --git a/packages/SystemUI/res/layout-land/auth_credential_view.xml b/packages/SystemUI/res/layout-land/auth_credential_pattern_view.xml
similarity index 96%
rename from packages/SystemUI/res/layout-land/auth_credential_view.xml
rename to packages/SystemUI/res/layout-land/auth_credential_pattern_view.xml
index 4a34ede..c3fa39e 100644
--- a/packages/SystemUI/res/layout-land/auth_credential_view.xml
+++ b/packages/SystemUI/res/layout-land/auth_credential_pattern_view.xml
@@ -14,7 +14,7 @@
~ limitations under the License.
-->
-<com.android.systemui.biometrics.AuthCredentialView
+<com.android.systemui.biometrics.AuthCredentialPatternView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -110,4 +110,4 @@
</LinearLayout>
-</com.android.systemui.biometrics.AuthCredentialView>
\ No newline at end of file
+</com.android.systemui.biometrics.AuthCredentialPatternView>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/auth_credential_view.xml b/packages/SystemUI/res/layout/auth_credential_password_view.xml
similarity index 83%
copy from packages/SystemUI/res/layout/auth_credential_view.xml
copy to packages/SystemUI/res/layout/auth_credential_password_view.xml
index 74f991c..4aed033 100644
--- a/packages/SystemUI/res/layout/auth_credential_view.xml
+++ b/packages/SystemUI/res/layout/auth_credential_password_view.xml
@@ -14,7 +14,7 @@
~ limitations under the License.
-->
-<com.android.systemui.biometrics.AuthCredentialView
+<com.android.systemui.biometrics.AuthCredentialPasswordView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -66,7 +66,7 @@
<Space
android:layout_width="0dp"
android:layout_height="0dp"
- android:layout_weight="3"/>
+ android:layout_weight="1"/>
<TextView
android:id="@+id/error"
@@ -77,21 +77,25 @@
android:gravity="center"
android:textColor="?android:attr/colorError"/>
- <com.android.internal.widget.LockPatternView
- android:id="@+id/lockPattern"
+ <EditText
+ android:id="@+id/lockPassword"
android:layout_marginBottom="20dp"
- android:layout_marginLeft="40dp"
- android:layout_marginRight="40dp"
- android:layout_width="wrap_content"
+ android:layout_marginLeft="100dp"
+ android:layout_marginRight="100dp"
+ android:layout_width="208dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
- android:clipChildren="false"
- android:clipToPadding="false"
+ android:gravity="center"
+ android:inputType="textPassword"
+ android:maxLength="500"
+ android:textSize="16sp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:imeOptions="flagForceAscii"
style="@style/LockPatternStyleBiometricPrompt"/>
<Space
android:layout_width="0dp"
android:layout_height="0dp"
- android:layout_weight="1"/>
+ android:layout_weight="5"/>
-</com.android.systemui.biometrics.AuthCredentialView>
\ No newline at end of file
+</com.android.systemui.biometrics.AuthCredentialPasswordView>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/auth_credential_view.xml b/packages/SystemUI/res/layout/auth_credential_pattern_view.xml
similarity index 96%
rename from packages/SystemUI/res/layout/auth_credential_view.xml
rename to packages/SystemUI/res/layout/auth_credential_pattern_view.xml
index 74f991c..c9edcd6 100644
--- a/packages/SystemUI/res/layout/auth_credential_view.xml
+++ b/packages/SystemUI/res/layout/auth_credential_pattern_view.xml
@@ -14,7 +14,7 @@
~ limitations under the License.
-->
-<com.android.systemui.biometrics.AuthCredentialView
+<com.android.systemui.biometrics.AuthCredentialPatternView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -94,4 +94,4 @@
android:layout_height="0dp"
android:layout_weight="1"/>
-</com.android.systemui.biometrics.AuthCredentialView>
\ No newline at end of file
+</com.android.systemui.biometrics.AuthCredentialPatternView>
\ No newline at end of file