Since the beginning [1], ChooseLockPassword#validatePassword() has never
accepted non-ASCII characters [2]. Hence we can safely specify
EditorInfo#IME_FLAG_FORCE_ASCII so that IMEs can optimize their UX based
on this flag. Note that EditorInfo#IME_FLAG_FORCE_ASCII is just a hint
for the IME so there should be no behavior change in the system side.
Note also that EditorInfo#IME_FLAG_FORCE_ASCII has been used in KeyGuard
(keyguard_password_view.xml) since JB MR-1 [3] so this flag is considered
to be well tested.
[1]: 00d2476d8f
[2]: Only character c where 32 <= c <= 126 is accepted
[3]: Id75286113771ca1407e9db182172b580f870b612
Test: Run `adb shell dumpsys input_method` when the password entry
field is focused to make sure that 'imeOptions' parameter
has 0x80000000 bit. Tested the following scenarios:
- PIN on a direct-boot disabled device
- PIN on a direct-boot enabled device
- Password on a direct-boot disabled device
- Password on a direct-boot enabled device
Fixes: 27858858
Change-Id: I3075e24c6dac4d49f4d0e56a0d4d8434a323754d
99 lines
3.9 KiB
XML
99 lines
3.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!--
|
|
Copyright (C) 2014 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.
|
|
-->
|
|
<com.android.setupwizardlib.GlifLayout
|
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:icon="@drawable/ic_lock"
|
|
settings:suwHeaderText="@string/lockpassword_choose_your_password_header">
|
|
|
|
<LinearLayout
|
|
style="@style/SuwContentFrame"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:clipChildren="false"
|
|
android:clipToPadding="false"
|
|
android:gravity="center_horizontal"
|
|
android:orientation="vertical">
|
|
|
|
<!-- header text ('Enter Pin') -->
|
|
<TextView
|
|
android:id="@+id/headerText"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:accessibilityLiveRegion="polite"
|
|
android:gravity="center"
|
|
android:lines="2"
|
|
android:textAppearance="?android:attr/textAppearanceMedium"/>
|
|
|
|
<!-- Password entry field -->
|
|
<EditText android:id="@+id/password_entry"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="center"
|
|
android:gravity="center"
|
|
android:inputType="textPassword"
|
|
android:imeOptions="actionNext|flagNoExtractUi|flagForceAscii"
|
|
android:textSize="24sp"
|
|
style="@style/TextAppearance.PasswordEntry"/>
|
|
|
|
<LinearLayout
|
|
android:id="@+id/bottom_container"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:clipChildren="false"
|
|
android:clipToPadding="false"
|
|
android:orientation="vertical">
|
|
|
|
<android.support.v7.widget.RecyclerView
|
|
android:id="@+id/password_requirements_view"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"/>
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:clipChildren="false"
|
|
android:clipToPadding="false"
|
|
android:gravity="end"
|
|
android:orientation="horizontal">
|
|
|
|
<!-- left : cancel -->
|
|
<Button android:id="@+id/cancel_button"
|
|
style="@style/SetupWizardButton.Negative"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:text="@string/lockpassword_cancel_label" />
|
|
|
|
<Space
|
|
android:layout_width="0dp"
|
|
android:layout_height="0dp"
|
|
android:layout_weight="1" />
|
|
|
|
<!-- right : continue -->
|
|
<Button android:id="@+id/next_button"
|
|
style="@style/SetupWizardButton.Positive"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:text="@string/lockpassword_continue_label" />
|
|
</LinearLayout>
|
|
</LinearLayout>
|
|
</LinearLayout>
|
|
|
|
</com.android.setupwizardlib.GlifLayout>
|