Update work profile lock in Settings to latest spec

* Updated FrameLayout of work profile lock in Settings to use GlifLayout
* Removed old background image of work profile lock
* Updated text for PIN, password and pattern
* Added enterprise logo to work profile lock

Bug: 141290838
Test: Manual testing
      atest com.android.settings.password

Change-Id: Ie09974857b6c76a182a8075b9e1964a2e0af0de9
This commit is contained in:
Alex Johnston
2019-12-09 12:52:14 +00:00
parent 1772ec0040
commit 7868acfa74
13 changed files with 330 additions and 264 deletions

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2019 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="M20,6h-4L16,4c0,-1.11 -0.89,-2 -2,-2h-4c-1.11,0 -2,0.89 -2,2v2L4,6c-1.11,0 -1.99,0.89 -1.99,2L2,19c0,1.11 0.89,2 2,2h16c1.11,0 2,-0.89 2,-2L22,8c0,-1.11 -0.89,-2 -2,-2zM12,15c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM14,6h-4L10,4h4v2z"
android:fillColor="?android:attr/colorPrimary"/>
</vector>

View File

@@ -13,59 +13,57 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<FrameLayout <com.google.android.setupdesign.GlifLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/setup_wizard_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:importantForAutofill="noExcludeDescendants"> android:icon="@drawable/ic_enterprise"
android:layout="@layout/sud_glif_blank_template">
<include layout="@layout/confirm_lock_background_base" /> <!--common_typos_disable-->
<com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient
<LinearLayout
android:id="@+id/topLayout" android:id="@+id/topLayout"
android:orientation="vertical" android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<TextView <LinearLayout
style="@*android:style/TextAppearance.DeviceDefault.Title" android:layout_width="match_parent"
android:id="@+id/headerText" android:layout_height="wrap_content"
android:layout_marginStart="24dp" android:orientation="vertical">
android:layout_marginEnd="24dp"
android:layout_marginTop="12dp" <ImageView
android:id="@+id/sud_layout_icon"
style="@style/SudGlifIcon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="?android:attr/colorAccent"/> android:layout_gravity="?attr/sudGlifHeaderGravity"
android:src="@drawable/ic_enterprise" />
<TextView <TextView
style="@*android:style/TextAppearance.DeviceDefault.Body1" android:id="@+id/headerText"
android:id="@+id/sud_layout_description" style="@style/SudGlifHeaderTitle"
android:layout_marginStart="24dp" android:layout_width="match_parent"
android:layout_marginEnd="24dp"
android:layout_marginTop="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<FrameLayout <TextView
android:id="@+id/sud_layout_description"
style="@style/SudDescription.Glif"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="?attr/sudMarginSides"
android:layout_marginEnd="?attr/sudMarginSides" />
</LinearLayout>
<Space
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1"> android:layout_weight="1" />
<Button
style="@android:style/Widget.Material.Button.Borderless"
android:id="@+id/cancelButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|bottom"
android:text="@string/cancel"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="14dp"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical"> android:orientation="vertical">
@@ -73,21 +71,40 @@
android:id="@+id/password_entry" android:id="@+id/password_entry"
android:layout_width="208dp" android:layout_width="208dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:inputType="textPassword" android:inputType="textPassword"
android:imeOptions="actionNext|flagNoFullscreen|flagForceAscii" android:imeOptions="actionNext|flagNoFullscreen|flagForceAscii"
android:gravity="center" android:gravity="center"
style="@style/TextAppearance.PasswordEntry"/> style="@style/TextAppearance.PasswordEntry"/>
<TextView style="@style/TextAppearance.ErrorText" <TextView
style="@style/TextAppearance.ErrorText"
android:accessibilityLiveRegion="polite" android:accessibilityLiveRegion="polite"
android:id="@+id/errorText" android:id="@+id/errorText"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="10dp"/> android:layout_marginTop="8dp"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"/>
</LinearLayout> </LinearLayout>
</FrameLayout> <Space
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout> <Button
</FrameLayout> android:id="@+id/cancelButton"
style="@style/SudGlifButton.Secondary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="?attr/sudMarginSides"
android:layout_marginEnd="?attr/sudMarginSides"
android:layout_marginBottom="80dp"
android:layout_gravity="center_horizontal"
android:text="@string/cancel" />
<!--common_typos_disable-->
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
</com.google.android.setupdesign.GlifLayout>

View File

@@ -13,83 +13,67 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<FrameLayout <com.google.android.setupdesign.GlifLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/setup_wizard_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" > android:layout_height="match_parent"
android:icon="@drawable/ic_enterprise"
<include layout="@layout/confirm_lock_background_base" /> android:layout="@layout/sud_glif_blank_template">
<com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient <com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/topLayout" android:id="@+id/topLayout"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:clipChildren="false" android:layout_weight="1"
android:clipToPadding="false"> android:fillViewport="true">
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:orientation="vertical"
android:layout_weight="1" android:paddingBottom="24dp">
android:orientation="vertical">
<ImageView
android:id="@+id/sud_layout_icon"
style="@style/SudGlifIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="?attr/sudGlifHeaderGravity"
android:src="@drawable/ic_enterprise" />
<TextView <TextView
style="@*android:style/TextAppearance.DeviceDefault.Headline"
android:id="@+id/headerText" android:id="@+id/headerText"
android:layout_marginStart="32dp" style="@style/SudGlifHeaderTitle"
android:layout_marginEnd="32dp" android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?android:attr/colorAccent"/>
<TextView
style="@*android:style/TextAppearance.DeviceDefault.Body1"
android:id="@+id/sud_layout_description"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:layout_marginTop="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<TextView
android:id="@+id/sud_layout_description"
style="@style/SudDescription.Glif"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="?attr/sudMarginSides"
android:layout_marginEnd="?attr/sudMarginSides" />x
<Button <Button
style="@android:style/Widget.Material.Button.Borderless"
android:id="@+id/cancelButton" android:id="@+id/cancelButton"
style="@style/SetupWizardButton.Negative"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/cancel" android:layout_marginStart="?attr/sudMarginSides"
android:layout_marginStart="16dp" android:layout_marginEnd="?attr/sudMarginSides"
android:layout_marginEnd="16dp" android:text="@string/cancel" />
android:layout_marginTop="16dp"/>
</LinearLayout>
<LinearLayout <Space
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
android:clipChildren="false"
android:clipToPadding="false">
<View
android:id="@+id/leftSpacer"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.4"/>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false">
<com.android.internal.widget.LockPatternView
android:id="@+id/lockPattern"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="0dp"
android:layout_gravity="center"/> android:layout_weight="1" />
<TextView <TextView
style="@style/TextAppearance.ErrorText" style="@style/TextAppearance.ErrorText"
@@ -97,16 +81,30 @@
android:id="@+id/errorText" android:id="@+id/errorText"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal" android:layout_marginStart="?attr/sudMarginSides"
android:layout_marginBottom="24dp"/> android:layout_marginEnd="?attr/sudMarginSides"
</FrameLayout> android:layout_marginBottom="24dp"
android:gravity="center_vertical"/>
<View
android:id="@+id/rightSpacer"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"/>
</LinearLayout> </LinearLayout>
</ScrollView>
<com.google.android.setupdesign.view.FillContentLayout
style="@style/LockPatternContainerStyle"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingStart="0dp">
<com.android.internal.widget.LockPatternView
android:id="@+id/lockPattern"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center" />
</com.google.android.setupdesign.view.FillContentLayout>
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient> </com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
</FrameLayout> </com.google.android.setupdesign.GlifLayout>

View File

@@ -14,15 +14,16 @@
~ See the License for the specific language governing permissions and ~ See the License for the specific language governing permissions and
~ limitations under the License ~ limitations under the License
--> -->
<FrameLayout <com.google.android.setupdesign.GlifLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/setup_wizard_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:importantForAutofill="noExcludeDescendants"> android:layout="@layout/sud_glif_blank_template">
<include <include
layout="@layout/confirm_lock_password_base" layout="@layout/confirm_lock_password_base"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="center_horizontal" /> android:layout_gravity="center_horizontal" />
</FrameLayout> </com.google.android.setupdesign.GlifLayout>

View File

@@ -13,12 +13,16 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <com.google.android.setupdesign.GlifLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/setup_wizard_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:layout="@layout/sud_glif_blank_template">
<include layout="@layout/confirm_lock_pattern_base" <include
layout="@layout/confirm_lock_pattern_base"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="center_horizontal" /> android:layout_gravity="center_horizontal" />
</FrameLayout> </com.google.android.setupdesign.GlifLayout>

View File

@@ -13,53 +13,50 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<FrameLayout <com.google.android.setupdesign.GlifLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/setup_wizard_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:importantForAutofill="noExcludeDescendants"> android:icon="@drawable/ic_enterprise"
android:layout="@layout/sud_glif_blank_template">
<include layout="@layout/confirm_lock_background_base" />
<com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient <com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/topLayout" android:id="@+id/topLayout"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="@dimen/confirm_credentials_layout_width" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:layout_gravity="top|center_horizontal"
android:paddingTop="@dimen/confirm_credentials_top_padding">
<TextView <LinearLayout
style="@*android:style/TextAppearance.DeviceDefault.Headline" android:layout_width="match_parent"
android:id="@+id/headerText" android:layout_height="wrap_content"
android:layout_marginStart="?attr/confirmDeviceCredentialsSideMargin" android:orientation="vertical">
android:layout_marginEnd="?attr/confirmDeviceCredentialsSideMargin"
android:layout_marginTop="?attr/confirmDeviceCredentialsTopMargin" <ImageView
android:id="@+id/sud_layout_icon"
style="@style/SudGlifIcon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="?android:attr/colorAccent"/> android:layout_gravity="?attr/sudGlifHeaderGravity"
android:src="@drawable/ic_enterprise" />
<TextView <TextView
style="@*android:style/TextAppearance.DeviceDefault.Body1" android:id="@+id/headerText"
android:id="@+id/sud_layout_description" style="@style/SudGlifHeaderTitle"
android:layout_marginStart="?attr/confirmDeviceCredentialsSideMargin" android:layout_width="match_parent"
android:layout_marginEnd="?attr/confirmDeviceCredentialsSideMargin"
android:layout_marginTop="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<Button <TextView
style="@android:style/Widget.Material.Button.Borderless" android:id="@+id/sud_layout_description"
android:id="@+id/cancelButton" style="@style/SudDescription.Glif"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/cancel" android:layout_marginStart="?attr/sudMarginSides"
android:layout_marginStart="16dp" android:layout_marginEnd="?attr/sudMarginSides" />
android:layout_marginEnd="16dp" </LinearLayout>
android:layout_marginTop="16dp"/>
<View android:layout_width="match_parent" <Space
android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" /> android:layout_weight="1" />
@@ -73,6 +70,7 @@
android:id="@+id/password_entry" android:id="@+id/password_entry"
android:layout_width="208dp" android:layout_width="208dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:inputType="textPassword" android:inputType="textPassword"
android:imeOptions="actionNext|flagNoFullscreen|flagForceAscii" android:imeOptions="actionNext|flagNoFullscreen|flagForceAscii"
android:gravity="center" android:gravity="center"
@@ -90,5 +88,21 @@
</LinearLayout> </LinearLayout>
<Space
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<Button
android:id="@+id/cancelButton"
style="@style/SudGlifButton.Secondary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="?attr/sudMarginSides"
android:layout_marginEnd="?attr/sudMarginSides"
android:layout_marginBottom="80dp"
android:layout_gravity="center_horizontal"
android:text="@string/cancel" />
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient> </com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
</FrameLayout> </com.google.android.setupdesign.GlifLayout>

View File

@@ -13,91 +13,95 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<FrameLayout <com.google.android.setupdesign.GlifLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/setup_wizard_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:icon="@drawable/ic_enterprise"
android:layout="@layout/sud_glif_blank_template">
<com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient
android:id="@+id/topLayout"
android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<include layout="@layout/confirm_lock_background_base" />
<com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/topLayout"
android:orientation="vertical"
android:layout_width="@dimen/confirm_credentials_layout_width"
android:layout_height="match_parent"
android:layout_gravity="top|center_horizontal"
android:paddingTop="@dimen/confirm_credentials_top_padding">
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical"
android:paddingBottom="24dp">
<TextView <ImageView
style="@*android:style/TextAppearance.DeviceDefault.Headline" android:id="@+id/sud_layout_icon"
android:id="@+id/headerText" style="@style/SudGlifIcon"
android:layout_marginStart="?attr/confirmDeviceCredentialsSideMargin"
android:layout_marginEnd="?attr/confirmDeviceCredentialsSideMargin"
android:layout_marginTop="?attr/confirmDeviceCredentialsTopMargin"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="?android:attr/colorAccent"/> android:layout_gravity="?attr/sudGlifHeaderGravity"
android:src="@drawable/ic_enterprise" />
<TextView <TextView
style="@*android:style/TextAppearance.DeviceDefault.Body1" android:id="@+id/headerText"
android:id="@+id/sud_layout_description" style="@style/SudGlifHeaderTitle"
android:layout_marginStart="?attr/confirmDeviceCredentialsSideMargin" android:layout_width="match_parent"
android:layout_marginEnd="?attr/confirmDeviceCredentialsSideMargin"
android:layout_marginTop="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<TextView
android:id="@+id/sud_layout_description"
style="@style/SudDescription.Glif"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="?attr/sudMarginSides"
android:layout_marginEnd="?attr/sudMarginSides" />x
<Button <Button
style="@android:style/Widget.Material.Button.Borderless"
android:id="@+id/cancelButton" android:id="@+id/cancelButton"
style="@style/SudGlifButton.Secondary"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/cancel" android:layout_marginStart="?attr/sudMarginSides"
android:layout_marginStart="16dp" android:layout_marginEnd="?attr/sudMarginSides"
android:layout_marginEnd="16dp" android:layout_marginBottom="80dp"
android:layout_marginTop="16dp"/> android:text="@string/cancel" />
</LinearLayout> </LinearLayout>
</ScrollView> <LinearLayout
style="@style/SudContentFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:paddingLeft="0dp"
android:paddingRight="0dp">
<com.google.android.setupdesign.view.FillContentLayout
style="@style/LockPatternContainerStyle"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1">
<com.android.internal.widget.LockPatternView <com.android.internal.widget.LockPatternView
android:id="@+id/lockPattern" android:id="@+id/lockPattern"
android:layout_width="312dp"
android:layout_height="0dp"
android:layout_weight="3"
android:layout_gravity="center_horizontal"/>
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="match_parent"
android:layout_weight="1" android:layout_gravity="center" />
android:orientation="vertical">
</com.google.android.setupdesign.view.FillContentLayout>
<TextView <TextView
style="@style/TextAppearance.ErrorText" style="@style/TextAppearance.ErrorText"
android:accessibilityLiveRegion="polite" android:accessibilityLiveRegion="polite"
android:id="@+id/errorText" android:id="@+id/errorText"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="0dp" android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginHorizontal="?attr/sudMarginSides"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:gravity="center_vertical"/> android:gravity="center_vertical"/>
</LinearLayout> </LinearLayout>
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient> </com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
</FrameLayout> </com.google.android.setupdesign.GlifLayout>

View File

@@ -2086,7 +2086,7 @@
<!-- Title for the fragment to show that the QR code is for sharing Wi-Fi hotspot network [CHAR LIMIT=50] --> <!-- Title for the fragment to show that the QR code is for sharing Wi-Fi hotspot network [CHAR LIMIT=50] -->
<string name="wifi_dpp_share_hotspot">Share hotspot</string> <string name="wifi_dpp_share_hotspot">Share hotspot</string>
<!-- Title for Wi-Fi DPP lockscreen title [CHAR LIMIT=50] --> <!-- Title for Wi-Fi DPP lockscreen title [CHAR LIMIT=50] -->
<string name="wifi_dpp_lockscreen_title">Verify it\u0027s you</string> <string name="wifi_dpp_lockscreen_title">Verify that it\u0027s you</string>
<!-- Hint for Wi-Fi password [CHAR LIMIT=50] --> <!-- Hint for Wi-Fi password [CHAR LIMIT=50] -->
<string name="wifi_dpp_wifi_password">Wi\u2011Fi password: <xliff:g id="password" example="my password">%1$s</xliff:g></string> <string name="wifi_dpp_wifi_password">Wi\u2011Fi password: <xliff:g id="password" example="my password">%1$s</xliff:g></string>
<!-- Hint for Wi-Fi hotspot password [CHAR LIMIT=50] --> <!-- Hint for Wi-Fi hotspot password [CHAR LIMIT=50] -->
@@ -3969,10 +3969,16 @@
<string name="lockpassword_choose_your_pattern_message">For security, set pattern</string> <string name="lockpassword_choose_your_pattern_message">For security, set pattern</string>
<!-- Header on password confirm screen [CHAR LIMIT=40] --> <!-- Header on password confirm screen [CHAR LIMIT=40] -->
<string name="lockpassword_confirm_your_password_header">Re-enter your password</string> <string name="lockpassword_confirm_your_password_header">Re-enter your password</string>
<!-- Header on password confirm screen for the work profile [CHAR LIMIT=40] -->
<string name="lockpassword_confirm_your_work_password_header">Enter your work password</string>
<!-- Header on pattern confirm screen [CHAR LIMIT=30] --> <!-- Header on pattern confirm screen [CHAR LIMIT=30] -->
<string name="lockpassword_confirm_your_pattern_header">Confirm your pattern</string> <string name="lockpassword_confirm_your_pattern_header">Confirm your pattern</string>
<!-- Header on pattern confirm screen for the work profile [CHAR LIMIT=30] -->
<string name="lockpassword_confirm_your_work_pattern_header">Enter your work pattern</string>
<!-- Header on password confirm screen [CHAR LIMIT=40] --> <!-- Header on password confirm screen [CHAR LIMIT=40] -->
<string name="lockpassword_confirm_your_pin_header">Re-enter your PIN</string> <string name="lockpassword_confirm_your_pin_header">Re-enter your PIN</string>
<!-- Header on password confirm screen for the work profile [CHAR LIMIT=40] -->
<string name="lockpassword_confirm_your_work_pin_header">Enter your work PIN</string>
<!-- Header on password confirm screen if second password doesn't match the first. [CHAR LIMIT=30] --> <!-- Header on password confirm screen if second password doesn't match the first. [CHAR LIMIT=30] -->
<string name="lockpassword_confirm_passwords_dont_match">Passwords don\u2019t match</string> <string name="lockpassword_confirm_passwords_dont_match">Passwords don\u2019t match</string>
<!-- Header on pin confirm screen if second pin doesn't match the first. [CHAR LIMIT=30]--> <!-- Header on pin confirm screen if second pin doesn't match the first. [CHAR LIMIT=30]-->

View File

@@ -186,8 +186,6 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
final LockPatternUtils lockPatternUtils = new LockPatternUtils(this); final LockPatternUtils lockPatternUtils = new LockPatternUtils(this);
final Bundle bpBundle = new Bundle(); final Bundle bpBundle = new Bundle();
mTitle = bpBundle.getString(BiometricPrompt.KEY_TITLE);
mDetails = bpBundle.getString(BiometricPrompt.KEY_SUBTITLE);
bpBundle.putString(BiometricPrompt.KEY_TITLE, mTitle); bpBundle.putString(BiometricPrompt.KEY_TITLE, mTitle);
bpBundle.putString(BiometricPrompt.KEY_DESCRIPTION, mDetails); bpBundle.putString(BiometricPrompt.KEY_DESCRIPTION, mDetails);
bpBundle.putBoolean(BiometricPrompt.EXTRA_DISALLOW_BIOMETRICS_IF_POLICY_EXISTS, bpBundle.putBoolean(BiometricPrompt.EXTRA_DISALLOW_BIOMETRICS_IF_POLICY_EXISTS,

View File

@@ -17,7 +17,6 @@
package com.android.settings.password; package com.android.settings.password;
import android.app.KeyguardManager; import android.app.KeyguardManager;
import android.hardware.biometrics.BiometricManager;
import android.os.Bundle; import android.os.Bundle;
import android.os.UserManager; import android.os.UserManager;
import android.util.Log; import android.util.Log;
@@ -65,7 +64,7 @@ public abstract class ConfirmDeviceCredentialBaseActivity extends SettingsActivi
return; return;
} }
if (UserManager.get(this).isManagedProfile(credentialOwnerUserId)) { if (UserManager.get(this).isManagedProfile(credentialOwnerUserId)) {
setTheme(R.style.Theme_ConfirmDeviceCredentialsWork); setTheme(SetupWizardUtils.getTheme(getIntent()));
mConfirmCredentialTheme = ConfirmCredentialTheme.WORK; mConfirmCredentialTheme = ConfirmCredentialTheme.WORK;
} else if (getIntent().getBooleanExtra( } else if (getIntent().getBooleanExtra(
ConfirmDeviceCredentialBaseFragment.DARK_THEME, false)) { ConfirmDeviceCredentialBaseFragment.DARK_THEME, false)) {

View File

@@ -140,9 +140,6 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends InstrumentedFr
Utils.getUserIdFromBundle( Utils.getUserIdFromBundle(
getActivity(), getActivity(),
getActivity().getIntent().getExtras(), isInternalActivity())); getActivity().getIntent().getExtras(), isInternalActivity()));
if (mUserManager.isManagedProfile(credentialOwnerUserId)) {
setWorkChallengeBackground(view, credentialOwnerUserId);
}
} }
// User could be locked while Effective user is unlocked even though the effective owns the // User could be locked while Effective user is unlocked even though the effective owns the

View File

@@ -56,16 +56,12 @@ import java.util.ArrayList;
public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity { public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
// The index of the array is isStrongAuth << 2 + isProfile << 1 + isAlpha. // The index of the array is isStrongAuth << 1 + isAlpha.
private static final int[] DETAIL_TEXTS = new int[] { private static final int[] DETAIL_TEXTS = new int[] {
R.string.lockpassword_confirm_your_pin_generic, R.string.lockpassword_confirm_your_pin_generic,
R.string.lockpassword_confirm_your_password_generic, R.string.lockpassword_confirm_your_password_generic,
R.string.lockpassword_confirm_your_pin_generic_profile,
R.string.lockpassword_confirm_your_password_generic_profile,
R.string.lockpassword_strong_auth_required_device_pin, R.string.lockpassword_strong_auth_required_device_pin,
R.string.lockpassword_strong_auth_required_device_password, R.string.lockpassword_strong_auth_required_device_password
R.string.lockpassword_strong_auth_required_work_pin,
R.string.lockpassword_strong_auth_required_work_password,
}; };
public static class InternalActivity extends ConfirmLockPassword { public static class InternalActivity extends ConfirmLockPassword {
@@ -109,6 +105,7 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
private InputMethodManager mImm; private InputMethodManager mImm;
private AppearAnimationUtils mAppearAnimationUtils; private AppearAnimationUtils mAppearAnimationUtils;
private DisappearAnimationUtils mDisappearAnimationUtils; private DisappearAnimationUtils mDisappearAnimationUtils;
private boolean mIsManagedProfile;
// required constructor for fragments // required constructor for fragments
public ConfirmLockPasswordFragment() { public ConfirmLockPasswordFragment() {
@@ -149,6 +146,8 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
mImm = (InputMethodManager) getActivity().getSystemService( mImm = (InputMethodManager) getActivity().getSystemService(
Context.INPUT_METHOD_SERVICE); Context.INPUT_METHOD_SERVICE);
mIsManagedProfile = UserManager.get(getActivity()).isManagedProfile(mEffectiveUserId);
Intent intent = getActivity().getIntent(); Intent intent = getActivity().getIntent();
if (intent != null) { if (intent != null) {
CharSequence headerMessage = intent.getCharSequenceExtra( CharSequence headerMessage = intent.getCharSequenceExtra(
@@ -205,6 +204,10 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
return mIsAlpha ? R.string.lockpassword_confirm_your_password_header_frp return mIsAlpha ? R.string.lockpassword_confirm_your_password_header_frp
: R.string.lockpassword_confirm_your_pin_header_frp; : R.string.lockpassword_confirm_your_pin_header_frp;
} }
if (mIsManagedProfile) {
return mIsAlpha ? R.string.lockpassword_confirm_your_work_password_header
: R.string.lockpassword_confirm_your_work_pin_header;
}
return mIsAlpha ? R.string.lockpassword_confirm_your_password_header return mIsAlpha ? R.string.lockpassword_confirm_your_password_header
: R.string.lockpassword_confirm_your_pin_header; : R.string.lockpassword_confirm_your_pin_header;
} }
@@ -215,10 +218,8 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
: R.string.lockpassword_confirm_your_pin_details_frp; : R.string.lockpassword_confirm_your_pin_details_frp;
} }
boolean isStrongAuthRequired = isStrongAuthRequired(); boolean isStrongAuthRequired = isStrongAuthRequired();
boolean isProfile = UserManager.get(getActivity()).isManagedProfile(mEffectiveUserId); // Map boolean flags to an index by isStrongAuth << 1 + isAlpha.
// Map boolean flags to an index by isStrongAuth << 2 + isProfile << 1 + isAlpha. int index = ((isStrongAuthRequired ? 1 : 0) << 1) + (mIsAlpha ? 1 : 0);
int index = ((isStrongAuthRequired ? 1 : 0) << 2) + ((isProfile ? 1 : 0) << 1)
+ (mIsAlpha ? 1 : 0);
return DETAIL_TEXTS[index]; return DETAIL_TEXTS[index];
} }

View File

@@ -90,8 +90,6 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
private TextView mHeaderTextView; private TextView mHeaderTextView;
private TextView mDetailsTextView; private TextView mDetailsTextView;
private View mLeftSpacerLandscape;
private View mRightSpacerLandscape;
// caller-supplied text for various prompts // caller-supplied text for various prompts
private CharSequence mHeaderText; private CharSequence mHeaderText;
@@ -100,6 +98,8 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
private AppearAnimationUtils mAppearAnimationUtils; private AppearAnimationUtils mAppearAnimationUtils;
private DisappearAnimationUtils mDisappearAnimationUtils; private DisappearAnimationUtils mDisappearAnimationUtils;
private boolean mIsManagedProfile;
// required constructor for fragments // required constructor for fragments
public ConfirmLockPatternFragment() { public ConfirmLockPatternFragment() {
@@ -119,8 +119,8 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
mLockPatternView = (LockPatternView) view.findViewById(R.id.lockPattern); mLockPatternView = (LockPatternView) view.findViewById(R.id.lockPattern);
mDetailsTextView = (TextView) view.findViewById(R.id.sud_layout_description); mDetailsTextView = (TextView) view.findViewById(R.id.sud_layout_description);
mErrorTextView = (TextView) view.findViewById(R.id.errorText); mErrorTextView = (TextView) view.findViewById(R.id.errorText);
mLeftSpacerLandscape = view.findViewById(R.id.leftSpacer);
mRightSpacerLandscape = view.findViewById(R.id.rightSpacer); mIsManagedProfile = UserManager.get(getActivity()).isManagedProfile(mEffectiveUserId);
// make it so unhandled touch events within the unlock screen go to the // make it so unhandled touch events within the unlock screen go to the
// lock pattern view. // lock pattern view.
@@ -325,7 +325,9 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
} }
private int getDefaultHeader() { private int getDefaultHeader() {
return mFrp ? R.string.lockpassword_confirm_your_pattern_header_frp if (mFrp) return R.string.lockpassword_confirm_your_pattern_header_frp;
return mIsManagedProfile
? R.string.lockpassword_confirm_your_work_pattern_header
: R.string.lockpassword_confirm_your_pattern_header; : R.string.lockpassword_confirm_your_pattern_header;
} }