Snap for 7389169 from 0327293c3c to sc-release

Change-Id: Ie8c1ae0d96ff9269099c9eae39abf17ee77ae994
This commit is contained in:
android-build-team Robot
2021-05-22 03:08:21 +00:00
47 changed files with 782 additions and 337 deletions

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 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.
-->
<inset
xmlns:android="http://schemas.android.com/apk/res/android"
android:inset="10dp">
<shape android:shape="oval">
<solid android:color="?android:attr/textColorSecondary" />
<size android:width="4dp" android:height="4dp" />
</shape>
</inset>

View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 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.
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/perm_icon"
android:layout_width="24dip"
android:layout_height="24dip"
android:layout_alignParentStart="true"
android:scaleType="fitCenter" />
<TextView
android:id="@+id/permission_group"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold"
android:paddingStart="6dip"
android:layout_toEndOf="@id/perm_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/permission_list"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_marginTop="-4dip"
android:paddingBottom="8dip"
android:paddingStart="6dip"
android:layout_below="@id/permission_group"
android:layout_toEndOf="@id/perm_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>

View File

@@ -4,9 +4,9 @@
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
You may obtain a copy of the License at You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -21,7 +21,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<ScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dip" android:layout_height="0dip"
android:layout_weight="1.0" android:layout_weight="1.0"
@@ -134,7 +134,7 @@
android:showDividers="beginning|middle|end"> android:showDividers="beginning|middle|end">
<LinearLayout <LinearLayout
android:id="@+id/restricted_action" android:id="@+id/restricted_action"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:gravity="center_vertical"> android:gravity="center_vertical">
@@ -173,5 +173,5 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>

View File

@@ -31,14 +31,6 @@
android:clipToPadding="false" android:clipToPadding="false"
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.setupdesign.view.RichTextView
android:id="@+id/sud_layout_description"
style="@style/SudDescription.Glif"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"
android:text="@string/security_settings_face_enroll_education_message"/>
<Space 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"/>

View File

@@ -26,6 +26,6 @@
android:visibility="invisible" android:visibility="invisible"
android:layout_marginStart="@dimen/preference_no_icon_padding_start"/> android:layout_marginStart="@dimen/preference_no_icon_padding_start"/>
<include layout="@layout/preference_material" /> <include layout="@layout/settingslib_preference" />
</FrameLayout> </FrameLayout>

View File

@@ -31,5 +31,5 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_toStartOf="@id/widget_summary" android:layout_toStartOf="@id/widget_summary"
layout="@layout/preference_material"/> layout="@layout/preference_app"/>
</RelativeLayout> </RelativeLayout>

View File

@@ -35,22 +35,7 @@
android:clipToPadding="false" android:clipToPadding="false"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"> android:paddingStart="?android:attr/listPreferredItemPaddingStart">
<LinearLayout <include layout="@layout/settingslib_icon_frame"/>
android:id="@+id/icon_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="start|center_vertical"
android:minWidth="56dp"
android:orientation="horizontal"
android:paddingTop="4dp"
android:paddingBottom="4dp">
<com.android.internal.widget.PreferenceImageView
android:id="@android:id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="24dp"
android:maxHeight="24dp"/>
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@@ -652,7 +652,7 @@
<!-- Text shown for the title of the lockdown option --> <!-- Text shown for the title of the lockdown option -->
<string name="lockdown_settings_title">Show lockdown option</string> <string name="lockdown_settings_title">Show lockdown option</string>
<!-- Text shown for the description of the lockdown option --> <!-- Text shown for the description of the lockdown option -->
<string name="lockdown_settings_summary">Display power button option that turns off Smart Lock, biometric unlocking, and notifications on the lock screen</string> <string name="lockdown_settings_summary">Display Power button option that turns off Smart Lock, Face Unlock, Fingerprint Unlock, and notifications on the lock screen</string>
<!-- Text shown for the title of the lock when trust lost option [CHAR LIMIT=40] --> <!-- Text shown for the title of the lock when trust lost option [CHAR LIMIT=40] -->
<string name="trust_lost_locks_screen_title">Lock screen when trust is lost</string> <string name="trust_lost_locks_screen_title">Lock screen when trust is lost</string>
@@ -736,24 +736,26 @@
<!-- Face enrollment and settings --><skip /> <!-- Face enrollment and settings --><skip />
<!-- Message shown in summary field when face unlock is set up. [CHAR LIMIT=40] --> <!-- Message shown in summary field when face unlock is set up. [CHAR LIMIT=40] -->
<string name="security_settings_face_preference_summary">Face added</string> <string name="security_settings_face_preference_summary">Face added</string>
<!-- Message shown in summary field when face unlock is not set up. [CHAR LIMIT=54] --> <!-- Message shown in summary field when Face Unlock is not set up. [CHAR LIMIT=54] -->
<string name="security_settings_face_preference_summary_none">Set up face unlock</string> <string name="security_settings_face_preference_summary_none">Tap to set up face</string>
<!-- Title shown for menu item that launches face settings or enrollment. [CHAR LIMIT=32] --> <!-- Title shown for menu item that launches face settings or enrollment. [CHAR LIMIT=32] -->
<string name="security_settings_face_preference_title">Face unlock</string> <string name="security_settings_face_preference_title">Face Unlock</string>
<!-- Title shown for menu item that launches face settings or enrollment, for work profile [CHAR LIMIT=50] --> <!-- Title shown for menu item that launches face settings or enrollment, for work profile [CHAR LIMIT=50] -->
<string name="security_settings_face_profile_preference_title">Face unlock for work</string> <string name="security_settings_face_profile_preference_title">Face Unlock for work</string>
<!-- Introduction title shown in face enrollment education screen [CHAR LIMIT=40] --> <!-- Introduction title shown in face enrollment education screen [CHAR LIMIT=50] -->
<string name="security_settings_face_enroll_education_title">How to set up face unlock</string> <string name="security_settings_face_enroll_education_title">How to set up Face Unlock</string>
<!-- Introduction title shown in face enrollment education screen for accessibility [CHAR LIMI=40]--> <!-- Introduction title shown in face enrollment education screen for accessibility [CHAR LIMIT=50]-->
<string name="security_settings_face_enroll_education_title_accessibility">Set up face unlock</string> <string name="security_settings_face_enroll_education_title_accessibility">Set up Face Unlock</string>
<!-- Introduction title shown in face enrollment education screen to show the face unlock feature, when face unlock is disabled by device admin [CHAR LIMIT=60] --> <!-- Introduction title shown in face enrollment education screen to show the face unlock feature, when face unlock is disabled by device admin [CHAR LIMIT=60] -->
<string name="security_settings_face_enroll_education_title_unlock_disabled">Use your face to authenticate</string> <string name="security_settings_face_enroll_education_title_unlock_disabled">Use your face to authenticate</string>
<!-- Introduction detail message shown in face education [CHAR LIMIT=NONE] --> <!-- Introduction detail message shown in face education [CHAR LIMIT=NONE] -->
<string name="security_settings_face_enroll_education_message"></string> <string name="security_settings_face_enroll_education_message"></string>
<!-- Introduction detail message shown in face education for accessibility [CHAR LIMIT=NONE] -->
<string name="security_settings_face_enroll_education_message_accessibility"></string>
<!-- Button that takes the user to the enrollment activity [CHAR LIMIT=20] --> <!-- Button that takes the user to the enrollment activity [CHAR LIMIT=20] -->
<string name="security_settings_face_enroll_education_start">Start</string> <string name="security_settings_face_enroll_education_start">Start</string>
<!-- Confirmation dialog message shown when users with system accessibility features enabled try to start the non-accessibility version of enrollment [CHAR LIMIT=150] --> <!-- Confirmation dialog message shown when users with system accessibility features enabled try to start the non-accessibility version of enrollment [CHAR LIMIT=150] -->
<string name="security_settings_face_enroll_education_accessibility_dialog_message">If accessibility face unlock is turned off, some setup steps may not work properly with TalkBack.</string> <string name="security_settings_face_enroll_education_accessibility_dialog_message">If accessibility Face Unlock is turned off, some setup steps may not work properly with TalkBack.</string>
<!-- Negative button text for users who were shown the accessibility dialog [CHAR LIMIT=10] --> <!-- Negative button text for users who were shown the accessibility dialog [CHAR LIMIT=10] -->
<string name="security_settings_face_enroll_education_accessibility_dialog_negative">Go back</string> <string name="security_settings_face_enroll_education_accessibility_dialog_negative">Go back</string>
<!-- Positive button text for users who were shown the accessibility dialog [CHAR LIMIT=20] --> <!-- Positive button text for users who were shown the accessibility dialog [CHAR LIMIT=20] -->
@@ -823,27 +825,25 @@
<!-- Button text to exit face wizard after everything is done [CHAR LIMIT=15] --> <!-- Button text to exit face wizard after everything is done [CHAR LIMIT=15] -->
<string name="security_settings_face_enroll_done">Done</string> <string name="security_settings_face_enroll_done">Done</string>
<!-- Settings suggestion title text for re-enrolling a face. [CHAR LIMIT=50] --> <!-- Settings suggestion title text for re-enrolling a face. [CHAR LIMIT=50] -->
<string name="security_settings_face_enroll_should_re_enroll_title">Improve face unlock performance</string> <string name="security_settings_face_enroll_should_re_enroll_title">Improve Face Unlock performance</string>
<!-- Settings suggestion subtitle text for re-enrolling a face. [CHAR LIMIT=40] --> <!-- Settings suggestion subtitle text for re-enrolling a face. [CHAR LIMIT=40] -->
<string name="security_settings_face_enroll_should_re_enroll_subtitle">Set up face unlock again</string> <string name="security_settings_face_enroll_should_re_enroll_subtitle">Set up Face Unlock again</string>
<!-- Settings suggestion title text for mandatory re-enrolling of a face. [CHAR LIMIT=50] --> <!-- Settings suggestion title text for mandatory re-enrolling of a face. [CHAR LIMIT=50] -->
<string name="security_settings_face_enroll_must_re_enroll_title">Set up face unlock again</string> <string name="security_settings_face_enroll_must_re_enroll_title">Set up Face Unlock again</string>
<!-- Settings suggestion subtitle text for mandatory re-enrolling of a face. [CHAR LIMIT=40] --> <!-- Settings suggestion subtitle text for mandatory re-enrolling of a face. [CHAR LIMIT=40] -->
<string name="security_settings_face_enroll_must_re_enroll_subtitle">Improve security and performance</string> <string name="security_settings_face_enroll_must_re_enroll_subtitle">Improve security and performance</string>
<!-- Settings suggestion alert body title for re-enrolling a face. [CHAR LIMIT=60] --> <!-- Settings suggestion alert body title for re-enrolling a face. [CHAR LIMIT=60] -->
<string name="security_settings_face_enroll_improve_face_alert_title">Set up face unlock</string> <string name="security_settings_face_enroll_improve_face_alert_title">Set up Face Unlock</string>
<!-- Settings suggestion alert body text for re-enrolling a face. [CHAR LIMIT=300] --> <!-- Settings suggestion alert body text for re-enrolling a face. [CHAR LIMIT=300] -->
<string name="security_settings_face_enroll_improve_face_alert_body">Delete your current face data to set up face unlock again.\n\nThe face data used by face unlock will be permanently and securely deleted. After removal, you will need your PIN, pattern, or password to unlock your phone, sign in to apps, and confirm payments.</string> <string name="security_settings_face_enroll_improve_face_alert_body">Delete your current face model to set up Face Unlock again.\n\nYour face model will be permanently and securely deleted.\n\nAfter deletion, you will need your PIN, pattern, or password to unlock your phone or for authentication in apps.</string>
<!-- Settings suggestion alert body text for re-enrolling a face. [CHAR LIMIT=300] -->
<string name="security_settings_face_enroll_improve_face_alert_body_fingerprint">Delete your current face model to set up Face Unlock again.\n\nYour face model will be permanently and securely deleted.\n\nAfter deletion, you will need your fingerprint, PIN, pattern, or password to unlock your phone or for authentication in apps.</string>
<!-- Title for a category shown for the face settings page. [CHAR LIMIT=20] --> <!-- Title for a category shown for the face settings page. [CHAR LIMIT=20] -->
<string name="security_settings_face_settings_use_face_category">Use face unlock for</string> <string name="security_settings_face_settings_use_face_category">Use Face Unlock for</string>
<!-- Text shown on a toggle which allows or disallows the device to use face for unlocking the device. [CHAR LIMIT=20] -->
<string name="security_settings_face_settings_use_face_unlock_phone">Unlocking your phone</string>
<!-- Text shown on a toggle which allows or disallows the device to use face unlock for apps. This will be presented to the user together with the context of security_settings_face_settings_use_face_category. [CHAR LIMIT=30] -->
<string name="security_settings_face_settings_use_face_for_apps">App sign-in \u0026 payments</string>
<!-- Title for a category shown for the face settings page, followed by items that the user can toggle on/off to require/disable. --> <!-- Title for a category shown for the face settings page, followed by items that the user can toggle on/off to require/disable. -->
<string name="security_settings_face_settings_require_category">Requirements for face unlock</string> <string name="security_settings_face_settings_require_category">Requirements for Face Unlock</string>
<!-- Title for a category shown for the face settings page, followed by items that the user can toggle on/off to require/disable. [CHAR LIMIT=50] --> <!-- Title for a category shown for the face settings page, followed by items that the user can toggle on/off to require/disable. [CHAR LIMIT=50] -->
<string name="security_settings_face_settings_preferences_category">When using face unlock</string> <string name="security_settings_face_settings_preferences_category">When using Face Unlock</string>
<!-- Text shown on a toggle which disables/enables face unlock, depending if the user's eyes are open. [CHAR LIMIT=30] --> <!-- Text shown on a toggle which disables/enables face unlock, depending if the user's eyes are open. [CHAR LIMIT=30] -->
<string name="security_settings_face_settings_require_attention">Require eyes to be open</string> <string name="security_settings_face_settings_require_attention">Require eyes to be open</string>
<!-- Text shown on the details of a toggle which disables/enables face unlock, depending if the user's eyes are open. [CHAR LIMIT=70] --> <!-- Text shown on the details of a toggle which disables/enables face unlock, depending if the user's eyes are open. [CHAR LIMIT=70] -->
@@ -851,17 +851,17 @@
<!-- When authenticating in apps, always require confirmation (e.g. confirm button) after a face is authenticated. [CHAR LIMIT=50] --> <!-- When authenticating in apps, always require confirmation (e.g. confirm button) after a face is authenticated. [CHAR LIMIT=50] -->
<string name="security_settings_face_settings_require_confirmation">Always require confirmation</string> <string name="security_settings_face_settings_require_confirmation">Always require confirmation</string>
<!-- When authenticating in apps, always require confirmation (e.g. confirm button) after a face is authenticated. [CHAR LIMIT=70] --> <!-- When authenticating in apps, always require confirmation (e.g. confirm button) after a face is authenticated. [CHAR LIMIT=70] -->
<string name="security_settings_face_settings_require_confirmation_details">When using face unlock in apps, always require confirmation step</string> <string name="security_settings_face_settings_require_confirmation_details">When using Face Unlock in apps, always require confirmation step</string>
<!-- Button text in face settings which removes the user's face model from the device [CHAR LIMIT=40] --> <!-- Button text in face settings which removes the user's face model from the device [CHAR LIMIT=40] -->
<string name="security_settings_face_settings_remove_face_model">Delete face model</string> <string name="security_settings_face_settings_remove_face_model">Delete face model</string>
<!-- Button text in face settings which lets the user enroll their face [CHAR LIMIT=40] --> <!-- Button text in face settings which lets the user enroll their face [CHAR LIMIT=40] -->
<string name="security_settings_face_settings_enroll">Set up face unlock</string> <string name="security_settings_face_settings_enroll">Set up Face Unlock</string>
<!-- Text shown in face settings explaining what your face can be used for. [CHAR LIMIT=NONE] --> <!-- Text shown in face settings explaining what your face can be used for. [CHAR LIMIT=NONE] -->
<string name="security_settings_face_settings_top_intro">Use face unlock to unlock your device, sign in to apps, and confirm payments.</string> <string name="security_settings_face_settings_top_intro">Use Face Unlock to unlock your device, sign in to apps, and confirm payments.</string>
<!-- Text shown in face settings explaining what your face can be used for. [CHAR LIMIT=NONE] --> <!-- Text shown in face settings explaining what your face can be used for. [CHAR LIMIT=NONE] -->
<string name="security_settings_face_settings_footer">Keep in mind:\nLooking at the phone can unlock it when you don\u2019t intend to.\n\nYour phone can be unlocked by someone else if it\u2019s held up to your face.\n\nYour phone can be unlocked by someone who looks a lot like you, say, an identical sibling.</string> <string name="security_settings_face_settings_footer">Use your face to unlock your phone or for authentication in apps, like when you sign in or approve a purchase.\n\nKeep in mind:\nYou can only have one face set up at a time. To add another face, delete the current one.\n\nLooking at the phone can unlock it when you don\u2019t intend to.\n\nYour phone can be unlocked by someone else if it\u2019s held up to your face.\n\nYour phone can be unlocked by someone who looks a lot like you, like an identical sibling.</string>
<!-- Text shown in face settings explaining what your face can be used for. Used when attention checking is not supported. [CHAR LIMIT=NONE] --> <!-- Text shown in face settings explaining what your face can be used for. Used when attention checking is not supported. [CHAR LIMIT=NONE] -->
<string name="security_settings_face_settings_footer_attention_not_supported">Keep in mind:\nLooking at the phone can unlock it when you don\u2019t intend to.\n\nYour phone can be unlocked by someone else if it\u2019s held up to your face, even if your eyes are closed.\n\nYour phone can be unlocked by someone who looks a lot like you, say, an identical sibling.</string> <string name="security_settings_face_settings_footer_attention_not_supported">Use your face to unlock your phone or for authentication in apps, like when you sign in or approve a purchase.\n\nKeep in mind:\nYou can only have one face set up at a time. To add another face, delete the current one.\n\nLooking at the phone can unlock it when you don\u2019t intend to.\n\nYour phone can be unlocked by someone else if it\u2019s held up to your face, even if your eyes are closed.\n\nYour phone can be unlocked by someone who looks a lot like you, like an identical sibling.</string>
<!-- Dialog title shown when the user removes an enrollment [CHAR LIMIT=35] --> <!-- Dialog title shown when the user removes an enrollment [CHAR LIMIT=35] -->
<string name="security_settings_face_settings_remove_dialog_title">Delete face model?</string> <string name="security_settings_face_settings_remove_dialog_title">Delete face model?</string>
<!-- Dialog contents shown when the user removes an enrollment [CHAR LIMIT=NONE] --> <!-- Dialog contents shown when the user removes an enrollment [CHAR LIMIT=NONE] -->
@@ -871,7 +871,7 @@
<!-- Dialog contents shown when the user chooses to delete an existing enrolled face model. [CHAR LIMIT=NONE] --> <!-- Dialog contents shown when the user chooses to delete an existing enrolled face model. [CHAR LIMIT=NONE] -->
<string name="security_settings_face_settings_remove_model_dialog_details">Your face model will be permanently and securely deleted.\n\nAfter deletion, you will need your fingerprint, PIN, pattern, or password to unlock your phone or for authentication in apps.</string> <string name="security_settings_face_settings_remove_model_dialog_details">Your face model will be permanently and securely deleted.\n\nAfter deletion, you will need your fingerprint, PIN, pattern, or password to unlock your phone or for authentication in apps.</string>
<!-- Subtitle shown for contextual setting face enrollment [CHAR LIMIT=NONE] --> <!-- Subtitle shown for contextual setting face enrollment [CHAR LIMIT=NONE] -->
<string name="security_settings_face_settings_context_subtitle">Use face unlock to unlock your phone</string> <string name="security_settings_face_settings_context_subtitle">Use Face Unlock to unlock your phone</string>
<!-- Fingerprint enrollment and settings --><skip /> <!-- Fingerprint enrollment and settings --><skip />
<!-- Title shown for menu item that launches fingerprint settings or enrollment [CHAR LIMIT=22] --> <!-- Title shown for menu item that launches fingerprint settings or enrollment [CHAR LIMIT=22] -->
@@ -978,11 +978,11 @@
<!-- Message shown in summary field of biometric settings when face is enrolled, and a single fingerprintis enrolled. [CHAR LIMIT=66]--> <!-- Message shown in summary field of biometric settings when face is enrolled, and a single fingerprintis enrolled. [CHAR LIMIT=66]-->
<string name="security_settings_biometric_preference_summary_both_fp_single">Face and fingerprint added</string> <string name="security_settings_biometric_preference_summary_both_fp_single">Face and fingerprint added</string>
<!-- Introduction shown in face and fingerprint page to introduce the biometric feature. [CHAR LIMIT=NONE]--> <!-- Introduction shown in face and fingerprint page to introduce the biometric feature. [CHAR LIMIT=NONE]-->
<string name="biometric_settings_intro">When you set up face unlock and fingerprint, your phone will ask for your fingerprint when you wear a mask or are in a dark area.</string> <string name="biometric_settings_intro">When you set up Face Unlock and Fingerprint Unlock, your phone will ask for your fingerprint when you wear a mask or are in a dark area</string>
<!-- Biometric category title - biometric options for unlocking the device. [CHAR LIMIT=50] --> <!-- Biometric category title - biometric options for unlocking the device. [CHAR LIMIT=50] -->
<string name="biometric_settings_category_ways_to_unlock">Ways to unlock</string> <string name="biometric_settings_category_ways_to_unlock">Ways to unlock</string>
<!-- Biometric category title - configuration options for using biometric to unlock the device or authenticate in apps. [CHAR LIMIT=50] --> <!-- Biometric category title - configuration options for using biometric to unlock the device or authenticate in apps. [CHAR LIMIT=50] -->
<string name="biometric_settings_category_ways_to_use">Use face and fingerprint to</string> <string name="biometric_settings_category_ways_to_use">Use face and fingerprint for</string>
<!-- Text shown on a toggle which allows or disallows the device to use biometric for unlocking the device. [CHAR LIMIT=50] --> <!-- Text shown on a toggle which allows or disallows the device to use biometric for unlocking the device. [CHAR LIMIT=50] -->
<string name="biometric_settings_use_biometric_unlock_phone">Unlocking your phone</string> <string name="biometric_settings_use_biometric_unlock_phone">Unlocking your phone</string>
<!-- Text shown on a toggle which allows or disallows the device to use biometric for authentication. [CHAR LIMIT=50] --> <!-- Text shown on a toggle which allows or disallows the device to use biometric for authentication. [CHAR LIMIT=50] -->
@@ -1013,13 +1013,15 @@
<!-- Introduction title shown in fingerprint enrollment dialog to locate the sensor [CHAR LIMIT=29] --> <!-- Introduction title shown in fingerprint enrollment dialog to locate the sensor [CHAR LIMIT=29] -->
<string name="security_settings_fingerprint_enroll_find_sensor_title">Touch the sensor</string> <string name="security_settings_fingerprint_enroll_find_sensor_title">Touch the sensor</string>
<!-- Introduction title shown in fingerprint enrollment dialog to locate the sensor [CHAR LIMIT=60] --> <!-- Introduction title shown in fingerprint enrollment dialog to locate the sensor [CHAR LIMIT=60] -->
<string name="security_settings_udfps_enroll_find_sensor_title">Touch &amp; hold the fingerprint icon</string> <string name="security_settings_udfps_enroll_find_sensor_title">How to set up your fingerprint</string>
<!-- Message shown in fingerprint enrollment dialog to locate the sensor --> <!-- Message shown in fingerprint enrollment dialog to locate the sensor -->
<string name="security_settings_fingerprint_enroll_find_sensor_message">It\u2019s on the back of your phone. Use your index finger.</string> <string name="security_settings_fingerprint_enroll_find_sensor_message">It\u2019s on the back of your phone. Use your index finger.</string>
<!-- Message shown in fingerprint enrollment dialog to locate the sensor [CHAR LIMIT=NONE]--> <!-- Message shown in fingerprint enrollment dialog to locate the sensor [CHAR LIMIT=NONE]-->
<string name="security_settings_udfps_enroll_find_sensor_message">The fingerprint sensor is on your screen</string> <string name="security_settings_udfps_enroll_find_sensor_message">The fingerprint sensor is on your screen. You\u2019ll capture your fingerprint on the next screen.</string>
<!-- Button for starting fingerprint enrollment. [CHAR LIMIT=10]-->
<string name="security_settings_udfps_enroll_find_sensor_start_button">Start</string>
<!-- Message announced to a11y users during fingerprint enrollment to help them locate the sensor. [CHAR LIMIT=NONE] --> <!-- Message announced to a11y users during fingerprint enrollment to help them locate the sensor. [CHAR LIMIT=NONE] -->
<string name="security_settings_udfps_enroll_find_sensor_a11y">The fingerprint sensor is on your screen. Move your finger across the screen to find the sensor.</string> <string name="security_settings_udfps_enroll_a11y">Move your finger across the screen to find the sensor. Touch &amp; hold the fingerprint sensor.</string>
<!-- Content description of graphic that shows where the fingerprint of the device is [CHAR LIMIT=NONE] --> <!-- Content description of graphic that shows where the fingerprint of the device is [CHAR LIMIT=NONE] -->
<string name="security_settings_fingerprint_enroll_find_sensor_content_description">Illustration with device and fingerprint sensor location</string> <string name="security_settings_fingerprint_enroll_find_sensor_content_description">Illustration with device and fingerprint sensor location</string>
<!-- Label text shown in fingerprint dialog for renaming a fingerprint template [CHAR LIMIT=22] --> <!-- Label text shown in fingerprint dialog for renaming a fingerprint template [CHAR LIMIT=22] -->
@@ -1033,7 +1035,9 @@
<!-- Message shown in fingerprint enrollment dialog to begin enrollment [CHAR LIMIT=NONE] --> <!-- Message shown in fingerprint enrollment dialog to begin enrollment [CHAR LIMIT=NONE] -->
<string name="security_settings_fingerprint_enroll_start_message">Put your finger on the sensor and lift after you feel a vibration</string> <string name="security_settings_fingerprint_enroll_start_message">Put your finger on the sensor and lift after you feel a vibration</string>
<!-- Message shown in fingerprint enrollment dialog to begin enrollment [CHAR LIMIT=NONE] --> <!-- Message shown in fingerprint enrollment dialog to begin enrollment [CHAR LIMIT=NONE] -->
<string name="security_settings_udfps_enroll_start_message">Keep your finger on the icon until you feel a vibration</string> <string name="security_settings_udfps_enroll_start_message">Keep your finger on the sensor until you feel a vibration</string>
<!-- Title shown in fingerprint enrollment [CHAR LIMIT=NONE]-->
<string name="security_settings_fingerprint_enroll_udfps_title">Touch &amp; hold the fingerprint sensor</string>
<!-- Title shown in fingerprint enrollment dialog to repeat touching the fingerprint sensor [CHAR LIMIT=40] --> <!-- Title shown in fingerprint enrollment dialog to repeat touching the fingerprint sensor [CHAR LIMIT=40] -->
<string name="security_settings_fingerprint_enroll_repeat_title">Lift, then touch again</string> <string name="security_settings_fingerprint_enroll_repeat_title">Lift, then touch again</string>
<!-- Title shown in fingerprint enrollment dialog to repeat touching the fingerprint sensor [CHAR LIMIT=40] --> <!-- Title shown in fingerprint enrollment dialog to repeat touching the fingerprint sensor [CHAR LIMIT=40] -->
@@ -1043,7 +1047,11 @@
<!-- Message shown in fingerprint enrollment dialog to repeat touching the fingerprint sensor [CHAR LIMIT=NONE] --> <!-- Message shown in fingerprint enrollment dialog to repeat touching the fingerprint sensor [CHAR LIMIT=NONE] -->
<string name="security_settings_fingerprint_enroll_repeat_message">Keep lifting your finger to add the different parts of your fingerprint</string> <string name="security_settings_fingerprint_enroll_repeat_message">Keep lifting your finger to add the different parts of your fingerprint</string>
<!-- Message shown in fingerprint enrollment dialog to repeat touching the fingerprint sensor [CHAR LIMIT=NONE] --> <!-- Message shown in fingerprint enrollment dialog to repeat touching the fingerprint sensor [CHAR LIMIT=NONE] -->
<string name="security_settings_udfps_enroll_repeat_message">Touch &amp; hold each time the icon moves. This helps capture your full fingerprint.</string> <string name="security_settings_udfps_enroll_repeat_message">Touch &amp; hold each time the fingerprint icon moves. This helps capture your full fingerprint.</string>
<!-- Message shown in fingerprint enrollment asking users to repeat touching the fingerprint sensor.-->
<string name="security_settings_udfps_enroll_repeat_a11y_message">This helps capture your full fingerprint</string>
<!-- Message read to a11y users when enrollment progress is made. The number is from 0 to 100. [CHAR LIMIT=NONE]-->
<string name="security_settings_udfps_enroll_progress_a11y_message">Enrolling fingerprint <xliff:g id="percentage" example="10">%d</xliff:g> percent</string>
<!-- Title shown in fingerprint enrollment dialog once enrollment is completed [CHAR LIMIT=29] --> <!-- Title shown in fingerprint enrollment dialog once enrollment is completed [CHAR LIMIT=29] -->
<string name="security_settings_fingerprint_enroll_finish_title">Fingerprint added</string> <string name="security_settings_fingerprint_enroll_finish_title">Fingerprint added</string>
<!-- Message shown in fingerprint enrollment dialog once enrollment is completed --> <!-- Message shown in fingerprint enrollment dialog once enrollment is completed -->
@@ -1054,30 +1062,102 @@
<string name="setup_fingerprint_enroll_enrolling_skip_title">Skip fingerprint setup?</string> <string name="setup_fingerprint_enroll_enrolling_skip_title">Skip fingerprint setup?</string>
<!-- Content of the dialog shown when the user tries to skip fingerprint setup, asking them to confirm the action [CHAR LIMIT=NONE] --> <!-- Content of the dialog shown when the user tries to skip fingerprint setup, asking them to confirm the action [CHAR LIMIT=NONE] -->
<string name="setup_fingerprint_enroll_enrolling_skip_message">You\u2019ve chosen to use your fingerprint as one way to unlock your phone. If you skip now, you\u2019ll need to set this up later. Setup takes only a minute or so.</string> <string name="setup_fingerprint_enroll_enrolling_skip_message">You\u2019ve chosen to use your fingerprint as one way to unlock your phone. If you skip now, you\u2019ll need to set this up later. Setup takes only a minute or so.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set fingerprint. (tablet) [CHAR LIMIT=NONE] --> <!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up fingerprint. (tablet) [CHAR LIMIT=NONE] -->
<string name="fingerprint_lock_screen_setup_skip_dialog_text" product="tablet">Protect your tablet with a screen lock option so no one will be able to use it if it is lost or stolen. You also need a screen lock option to set up fingerprint. Tap Cancel, then set a PIN, pattern, or password.</string> <string name="lock_screen_pin_skip_message" product="tablet">A PIN protects your tablet if it\u2019s lost or stolen</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set fingerprint. (device) [CHAR LIMIT=NONE] --> <!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up fingerprint. (tablet) [CHAR LIMIT=NONE] -->
<string name="fingerprint_lock_screen_setup_skip_dialog_text" product="device">Protect your device with a screen lock option so no one will be able to use it if it is lost or stolen. You also need a screen lock option to set up fingerprint. Tap Cancel, then set a PIN, pattern, or password.</string> <string name="lock_screen_pattern_skip_message" product="tablet">A pattern protects your tablet if it\u2019s lost or stolen</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set fingerprint. (default) [CHAR LIMIT=NONE] --> <!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up fingerprint. (tablet) [CHAR LIMIT=NONE] -->
<string name="fingerprint_lock_screen_setup_skip_dialog_text" product="default">Protect your phone with a screen lock option so no one will be able to use it if it is lost or stolen. You also need a screen lock option to set up fingerprint. Tap Cancel, then set a PIN, pattern, or password.</string> <string name="lock_screen_password_skip_message" product="tablet">A password protects your tablet if it\u2019s lost or stolen</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set face unlock. (tablet) [CHAR LIMIT=NONE] --> <!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up fingerprint. (device) [CHAR LIMIT=NONE] -->
<string name="face_lock_screen_setup_skip_dialog_text" product="tablet">By protecting your tablet with a screen lock option, no one will be able to use it if it is lost or stolen. You also need a screen lock option to set up face unlock. To go back, tap Cancel. </string> <string name="lock_screen_pin_skip_message" product="device">A PIN protects your device if it\u2019s lost or stolen</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set face unlock. (device) [CHAR LIMIT=NONE] --> <!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up fingerprint. (device) [CHAR LIMIT=NONE] -->
<string name="face_lock_screen_setup_skip_dialog_text" product="device">By protecting your device with a screen lock option, no one will be able to use it if it is lost or stolen. You also need a screen lock option to set up face unlock. To go back, tap Cancel. </string> <string name="lock_screen_pattern_skip_message" product="device">A pattern protects your device if it\u2019s lost or stolen</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set face unlock. (default) [CHAR LIMIT=NONE] --> <!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up fingerprint. (device) [CHAR LIMIT=NONE] -->
<string name="face_lock_screen_setup_skip_dialog_text" product="default">By protecting your phone with a screen lock option, no one will be able to use it if it is lost or stolen. You also need a screen lock option to set up face unlock. To go back, tap Cancel.</string> <string name="lock_screen_password_skip_message" product="device">A password protects your device if it\u2019s lost or stolen</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set biometric unlock. (tablet) [CHAR LIMIT=NONE] --> <!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up fingerprint. (default) [CHAR LIMIT=NONE] -->
<string name="biometrics_lock_screen_setup_skip_dialog_text" product="tablet">By protecting your tablet with a screen lock option, no one will be able to use it if it is lost or stolen. You also need a screen lock option to set up biometrics. To go back, tap Cancel. </string> <string name="lock_screen_pin_skip_message" product="default">A PIN protects your phone if it\u2019s lost or stolen</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set biometric unlock. (device) [CHAR LIMIT=NONE] --> <!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up fingerprint. (default) [CHAR LIMIT=NONE] -->
<string name="biometrics_lock_screen_setup_skip_dialog_text" product="device">By protecting your device with a screen lock option, no one will be able to use it if it is lost or stolen. You also need a screen lock option to set up biometrics. To go back, tap Cancel. </string> <string name="lock_screen_pattern_skip_message" product="default">A pattern protects your phone if it\u2019s lost or stolen</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set biometric unlock. (default) [CHAR LIMIT=NONE] --> <!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up fingerprint. (default) [CHAR LIMIT=NONE] -->
<string name="biometrics_lock_screen_setup_skip_dialog_text" product="default">By protecting your phone with a screen lock option, no one will be able to use it if it is lost or stolen. You also need a screen lock option to set up biometrics. To go back, tap Cancel.</string> <string name="lock_screen_password_skip_message" product="default">A password protects your phone if it\u2019s lost or stolen</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up fingerprint. (tablet) [CHAR LIMIT=NONE] -->
<string name="lock_screen_pin_skip_fingerprint_message" product="tablet">A PIN is required to set up Fingerprint Unlock.\n\nA PIN protects your tablet if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up fingerprint. (tablet) [CHAR LIMIT=NONE] -->
<string name="lock_screen_pattern_skip_fingerprint_message" product="tablet">A pattern is required to set up Fingerprint Unlock.\n\nA pattern protects your tablet if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up fingerprint. (tablet) [CHAR LIMIT=NONE] -->
<string name="lock_screen_password_skip_fingerprint_message" product="tablet">A password is required to set up Fingerprint Unlock.\n\nA password protects your tablet if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up fingerprint. (device) [CHAR LIMIT=NONE] -->
<string name="lock_screen_pin_skip_fingerprint_message" product="device">A PIN is required to set up Fingerprint Unlock.\n\nA PIN protects your device if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up fingerprint. (device) [CHAR LIMIT=NONE] -->
<string name="lock_screen_pattern_skip_fingerprint_message" product="device">A pattern is required to set up Fingerprint Unlock.\n\nA pattern protects your device if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up fingerprint. (device) [CHAR LIMIT=NONE] -->
<string name="lock_screen_password_skip_fingerprint_message" product="device">A password is required to set up Fingerprint Unlock.\n\nA password protects your device if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up fingerprint. (default) [CHAR LIMIT=NONE] -->
<string name="lock_screen_pin_skip_fingerprint_message" product="default">A PIN is required to set up Fingerprint Unlock.\n\nA PIN protects your phone if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up fingerprint. (default) [CHAR LIMIT=NONE] -->
<string name="lock_screen_pattern_skip_fingerprint_message" product="default">A pattern is required to set up Fingerprint Unlock.\n\nA pattern protects your phone if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up fingerprint. (default) [CHAR LIMIT=NONE] -->
<string name="lock_screen_password_skip_fingerprint_message" product="default">A password is required to set up Fingerprint Unlock.\n\nA password protects your phone if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up face. (tablet) [CHAR LIMIT=NONE] -->
<string name="lock_screen_pin_skip_face_message" product="tablet">A PIN is required to set up Face Unlock.\n\nA PIN protects your tablet if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up face. (tablet) [CHAR LIMIT=NONE] -->
<string name="lock_screen_pattern_skip_face_message" product="tablet">A pattern is required to set up Face Unlock.\n\nA pattern protects your tablet if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up face. (tablet) [CHAR LIMIT=NONE] -->
<string name="lock_screen_password_skip_face_message" product="tablet">A password is required to set up Face Unlock.\n\nA password protects your tablet if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up face. (device) [CHAR LIMIT=NONE] -->
<string name="lock_screen_pin_skip_face_message" product="device">A PIN is required to set up Face Unlock.\n\nA PIN protects your device if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up face. (device) [CHAR LIMIT=NONE] -->
<string name="lock_screen_pattern_skip_face_message" product="device">A pattern is required to set up Face Unlock.\n\nA pattern protects your device if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up face. (device) [CHAR LIMIT=NONE] -->
<string name="lock_screen_password_skip_face_message" product="device">A password is required to set up Face Unlock.\n\nA password protects your device if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up face. (default) [CHAR LIMIT=NONE] -->
<string name="lock_screen_pin_skip_face_message" product="default">A PIN is required to set up Face Unlock.\n\nA PIN protects your phone if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up face. (default) [CHAR LIMIT=NONE] -->
<string name="lock_screen_pattern_skip_face_message" product="default">A pattern is required to set up Face Unlock.\n\nA pattern protects your phone if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up face. (default) [CHAR LIMIT=NONE] -->
<string name="lock_screen_password_skip_face_message" product="default">A password is required to set up Face Unlock.\n\nA password protects your phone if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up face or fingerprint. (tablet) [CHAR LIMIT=NONE] -->
<string name="lock_screen_pin_skip_biometrics_message" product="tablet">A PIN is required to set up Face Unlock and Fingerprint Unlock.\n\nA PIN protects your tablet if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up face or fingerprint. (tablet) [CHAR LIMIT=NONE] -->
<string name="lock_screen_pattern_skip_biometrics_message" product="tablet">A pattern is required to set up Face Unlock and Fingerprint Unlock.\n\nA pattern protects your tablet if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up face or fingerprint. (tablet) [CHAR LIMIT=NONE] -->
<string name="lock_screen_password_skip_biometrics_message" product="tablet">A password is required to set up Face Unlock and Fingerprint Unlock.\n\nA password protects your tablet if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up face or fingerprint. (device) [CHAR LIMIT=NONE] -->
<string name="lock_screen_pin_skip_biometrics_message" product="device">A PIN is required to set up Face Unlock and Fingerprint Unlock.\n\nA PIN protects your device if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up face or fingerprint. (device) [CHAR LIMIT=NONE] -->
<string name="lock_screen_pattern_skip_biometrics_message" product="device">A pattern is required to set up Face Unlock and Fingerprint Unlock.\n\nA pattern protects your device if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up face or fingerprint. (device) [CHAR LIMIT=NONE] -->
<string name="lock_screen_password_skip_biometrics_message" product="device">A password is required to set up Face Unlock and Fingerprint Unlock.\n\nA password protects your device if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up face or fingerprint. (default) [CHAR LIMIT=NONE] -->
<string name="lock_screen_pin_skip_biometrics_message" product="default">A PIN is required to set up Face Unlock and Fingerprint Unlock.\n\nA PIN protects your phone if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up face or fingerprint. (default) [CHAR LIMIT=NONE] -->
<string name="lock_screen_pattern_skip_biometrics_message" product="default">A pattern is required to set up Face Unlock and Fingerprint Unlock.\n\nA pattern protects your phone if it\u2019s lost or stolen.</string>
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up face or fingerprint. (default) [CHAR LIMIT=NONE] -->
<string name="lock_screen_password_skip_biometrics_message" product="default">A password is required to set up Face Unlock and Fingerprint Unlock.\n\nA password protects your phone if it\u2019s lost or stolen.</string>
<!-- Title of dialog shown when the user tries to skip setting up a PIN, warning them of potential consequences of not doing so [CHAR LIMIT=48]--> <!-- Title of dialog shown when the user tries to skip setting up a PIN, warning them of potential consequences of not doing so [CHAR LIMIT=48]-->
<string name="lock_screen_pin_skip_title">Skip PIN setup?</string> <string name="lock_screen_pin_skip_title">Skip PIN setup?</string>
<!-- Title of dialog shown when the user tries to skip setting up a PIN, warning them of potential consequences of not doing so [CHAR LIMIT=90]-->
<string name="lock_screen_pin_skip_face_title">Skip setup for PIN and face?</string>
<!-- Title of dialog shown when the user tries to skip setting up a PIN, warning them of potential consequences of not doing so [CHAR LIMIT=90]-->
<string name="lock_screen_pin_skip_fingerprint_title">Skip setup for PIN and fingerprint?</string>
<!-- Title of dialog shown when the user tries to skip setting up a PIN, warning them of potential consequences of not doing so [CHAR LIMIT=90]-->
<string name="lock_screen_pin_skip_biometrics_title">Skip setup for PIN, face, and fingerprint?</string>
<!-- Title of dialog shown when the user tries to skip setting up a password, warning them of potential consequences of not doing so [CHAR LIMIT=48]--> <!-- Title of dialog shown when the user tries to skip setting up a password, warning them of potential consequences of not doing so [CHAR LIMIT=48]-->
<string name="lock_screen_password_skip_title">Skip password setup?</string> <string name="lock_screen_password_skip_title">Skip password setup?</string>
<!-- Title of dialog shown when the user tries to skip setting up a password, warning them of potential consequences of not doing so [CHAR LIMIT=48]-->
<string name="lock_screen_password_skip_face_title">Skip setup for password and face?</string>
<!-- Title of dialog shown when the user tries to skip setting up a password, warning them of potential consequences of not doing so [CHAR LIMIT=48]-->
<string name="lock_screen_password_skip_fingerprint_title">Skip setup for password and fingerprint?</string>
<!-- Title of dialog shown when the user tries to skip setting up a password, warning them of potential consequences of not doing so [CHAR LIMIT=48]-->
<string name="lock_screen_password_skip_biometrics_title">Skip setup for password, face, and fingerprint?</string>
<!-- Title of dialog shown when the user tries to skip setting up a pattern, warning them of potential consequences of not doing so [CHAR LIMIT=48]--> <!-- Title of dialog shown when the user tries to skip setting up a pattern, warning them of potential consequences of not doing so [CHAR LIMIT=48]-->
<string name="lock_screen_pattern_skip_title">Skip pattern setup?</string> <string name="lock_screen_pattern_skip_title">Skip pattern setup?</string>
<!-- Title of dialog shown when the user tries to skip setting up a pattern, warning them of potential consequences of not doing so [CHAR LIMIT=48]-->
<string name="lock_screen_pattern_skip_face_title">Skip setup for pattern and face?</string>
<!-- Title of dialog shown when the user tries to skip setting up a pattern, warning them of potential consequences of not doing so [CHAR LIMIT=48]-->
<string name="lock_screen_pattern_skip_fingerprint_title">Skip setup for pattern and fingerprint?</string>
<!-- Title of dialog shown when the user tries to skip setting up a pattern, warning them of potential consequences of not doing so [CHAR LIMIT=48]-->
<string name="lock_screen_pattern_skip_biometrics_title">Skip setup for pattern, face, and fingerprint?</string>
<!-- Button text to setup screen lock in onboard dialog [CHAR LIMIT=34] --> <!-- Button text to setup screen lock in onboard dialog [CHAR LIMIT=34] -->
<string name="security_settings_fingerprint_enroll_setup_screen_lock">Set up screen lock</string> <string name="security_settings_fingerprint_enroll_setup_screen_lock">Set up screen lock</string>
@@ -1423,14 +1503,14 @@
<!-- Message shown in screen lock picker while setting up the new screen lock with fingerprint option. [CHAR LIMIT=NONE]--> <!-- Message shown in screen lock picker while setting up the new screen lock with fingerprint option. [CHAR LIMIT=NONE]-->
<string name="fingerprint_unlock_title">You can unlock your phone using your fingerprint. For security, this option requires a backup screen lock.</string> <string name="fingerprint_unlock_title">You can unlock your phone using your fingerprint. For security, this option requires a backup screen lock.</string>
<!-- Title for preference that guides the user through creating a backup unlock pattern for face unlock [CHAR LIMIT=45]--> <!-- Title for preference that guides the user through creating a backup unlock pattern for Face Unlock [CHAR LIMIT=45]-->
<string name="face_unlock_set_unlock_pattern">Face unlock + Pattern</string> <string name="face_unlock_set_unlock_pattern">Face Unlock + Pattern</string>
<!-- Title for preference that guides the user through creating a backup unlock PIN for face unlock [CHAR LIMIT=45]--> <!-- Title for preference that guides the user through creating a backup unlock PIN for Face Unlock [CHAR LIMIT=45]-->
<string name="face_unlock_set_unlock_pin">Face unlock + PIN</string> <string name="face_unlock_set_unlock_pin">Face Unlock + PIN</string>
<!-- Title for preference that guides the user through creating a backup unlock password for face unlock [CHAR LIMIT=45]--> <!-- Title for preference that guides the user through creating a backup unlock password for Face Unlock [CHAR LIMIT=45]-->
<string name="face_unlock_set_unlock_password">Face unlock + Password</string> <string name="face_unlock_set_unlock_password">Face Unlock + Password</string>
<!-- Title for preference that guides the user to skip face unlock setup [CHAR LIMIT=60]--> <!-- Title for preference that guides the user to skip Face Unlock setup [CHAR LIMIT=60]-->
<string name="face_unlock_skip_face">Continue without face unlock</string> <string name="face_unlock_skip_face">Continue without Face Unlock</string>
<!-- Message shown in screen lock picker while setting up the new screen lock with face unlock option. [CHAR LIMIT=NONE] --> <!-- Message shown in screen lock picker while setting up the new screen lock with face unlock option. [CHAR LIMIT=NONE] -->
<string name="face_unlock_title">You can unlock your phone using your face. For security, this option requires a backup screen lock.</string> <string name="face_unlock_title">You can unlock your phone using your face. For security, this option requires a backup screen lock.</string>
@@ -4327,12 +4407,12 @@
<string name="lockpassword_pin_set_toast">PIN has been set</string> <string name="lockpassword_pin_set_toast">PIN has been set</string>
<!-- Toast shown if setting pattern was successful --> <!-- Toast shown if setting pattern was successful -->
<string name="lockpassword_pattern_set_toast">Pattern has been set</string> <string name="lockpassword_pattern_set_toast">Pattern has been set</string>
<!-- Header on first screen of choose password/PIN as backup for face unlock flow. If this string cannot be translated in under 40 characters, please translate "Set face unlock backup" [CHAR LIMIT=40] --> <!-- Header on first screen of choose password/PIN as backup for Face Unlock flow. If this string cannot be translated in under 40 characters, please translate "Set Face Unlock backup" [CHAR LIMIT=40] -->
<string name="lockpassword_choose_your_password_header_for_face">To use face unlock, set password</string> <string name="lockpassword_choose_your_password_header_for_face">To use Face Unlock, set password</string>
<!-- Header on first screen of choose pattern as backup for face unlock flow. If this string cannot be translated in under 40 characters, please translate "Set face unlock backup" [CHAR LIMIT=40] --> <!-- Header on first screen of choose pattern as backup for Face Unlock flow. If this string cannot be translated in under 40 characters, please translate "Set Face Unlock backup" [CHAR LIMIT=40] -->
<string name="lockpassword_choose_your_pattern_header_for_face">To use face unlock, set pattern</string> <string name="lockpassword_choose_your_pattern_header_for_face">To use Face Unlock, set pattern</string>
<!-- Header on first screen of choose password/PIN as backup for face unlock flow. If this string cannot be translated in under 40 characters, please translate "Set face unlock backup" [CHAR LIMIT=40] --> <!-- Header on first screen of choose password/PIN as backup for Face Unlock flow. If this string cannot be translated in under 40 characters, please translate "Set Face Unlock backup" [CHAR LIMIT=40] -->
<string name="lockpassword_choose_your_pin_header_for_face">To use face unlock, set PIN</string> <string name="lockpassword_choose_your_pin_header_for_face">To use Face Unlock, set PIN</string>
<!-- Header on first screen of choose password/PIN as backup for biometric unlock flow. If this string cannot be translated in under 40 characters, please translate "Set biometric unlock backup" [CHAR LIMIT=40] --> <!-- Header on first screen of choose password/PIN as backup for biometric unlock flow. If this string cannot be translated in under 40 characters, please translate "Set biometric unlock backup" [CHAR LIMIT=40] -->
<string name="lockpassword_choose_your_password_header_for_biometrics">To use biometrics, set password</string> <string name="lockpassword_choose_your_password_header_for_biometrics">To use biometrics, set password</string>
@@ -6489,8 +6569,10 @@
<string name="battery_usage_for_total_time">Total: <xliff:g id="time">%s</xliff:g></string> <string name="battery_usage_for_total_time">Total: <xliff:g id="time">%s</xliff:g></string>
<!-- [CHAR_LIMIT=NONE] Battery usage item for background usage time --> <!-- [CHAR_LIMIT=NONE] Battery usage item for background usage time -->
<string name="battery_usage_for_background_time">Background: <xliff:g id="time">%s</xliff:g></string> <string name="battery_usage_for_background_time">Background: <xliff:g id="time">%s</xliff:g></string>
<!-- [CHAR_LIMIT=NONE] Battery usage main screen footer contentt --> <!-- [CHAR_LIMIT=NONE] Battery usage main screen footer content -->
<string name="battery_usage_screen_footer">Battery usage data is approximate and doesn\'t measure usage when phone is charging</string> <string name="battery_usage_screen_footer">Battery usage data is approximate and doesn\'t measure usage when phone is charging</string>
<!-- [CHAR_LIMIT=NONE] Battery usage main screen footer for empty content -->
<string name="battery_usage_screen_footer_empty">Battery usage data will be available after you use your phone for a few hours</string>
<!-- [CHAR_LIMIT=NONE] Accessibility content description for battery chart view. --> <!-- [CHAR_LIMIT=NONE] Accessibility content description for battery chart view. -->
<string name="battery_usage_chart">Battery usage chart</string> <string name="battery_usage_chart">Battery usage chart</string>
<!-- Process Stats strings --> <!-- Process Stats strings -->
@@ -8836,7 +8918,7 @@
<string name="lockscreen_bypass_title">Skip lock screen</string> <string name="lockscreen_bypass_title">Skip lock screen</string>
<!-- Configure lock screen: Summary for the option of unlocking directly to home. [CHAR LIMIT=100] --> <!-- Configure lock screen: Summary for the option of unlocking directly to home. [CHAR LIMIT=100] -->
<string name="lockscreen_bypass_summary">After face unlock, go directly to last used screen</string> <string name="lockscreen_bypass_summary">After unlocking, go directly to last used screen</string>
<!-- Configure lock screen: Search keywords for the option of unlocking directly to home. [CHAR LIMIT=100] --> <!-- Configure lock screen: Search keywords for the option of unlocking directly to home. [CHAR LIMIT=100] -->
<string name="keywords_lockscreen_bypass">Lock screen, Lockscreen, Skip, Bypass</string> <string name="keywords_lockscreen_bypass">Lock screen, Lockscreen, Skip, Bypass</string>
@@ -8987,9 +9069,12 @@
<!-- [CHAR LIMIT=100] preference category title --> <!-- [CHAR LIMIT=100] preference category title -->
<string name="recent_conversations">Recent conversations</string> <string name="recent_conversations">Recent conversations</string>
<!-- [CHAR LIMIT=40] button title --> <!-- [CHAR LIMIT=60] button title -->
<string name="conversation_settings_clear_recents">Clear recent conversations</string> <string name="conversation_settings_clear_recents">Clear recent conversations</string>
<!-- a11y feedeback for 'clear recents' button' -->
<string name="recent_convos_removed">Recent conversations removed</string>
<!-- a11y string --> <!-- a11y string -->
<string name="clear">Clear</string> <string name="clear">Clear</string>
@@ -13132,8 +13217,8 @@
<string name="to_switch_networks_disconnect_ethernet">To switch networks, disconnect ethernet</string> <string name="to_switch_networks_disconnect_ethernet">To switch networks, disconnect ethernet</string>
<!-- Panel subtitle for Wi-Fi turned on. [CHAR LIMIT=60] --> <!-- Panel subtitle for Wi-Fi turned on. [CHAR LIMIT=60] -->
<string name="wifi_is_turned_on_subtitle">Wi\u2011Fi is turned on</string> <string name="wifi_is_turned_on_subtitle">Wi\u2011Fi is turned on</string>
<!-- Panel subtitle for select the network you want to use for data. [CHAR LIMIT=60] --> <!-- Panel subtitle for tapping a network to connect to internet. [CHAR LIMIT=60] -->
<string name="select_network_to_connect_internet">Select the network you want to use for data</string> <string name="tap_a_network_to_connect">Tap a network to connect</string>
<!-- Title for merged carrier Wi-Fi offload toggle. [CHAR LIMIT=NONE] --> <!-- Title for merged carrier Wi-Fi offload toggle. [CHAR LIMIT=NONE] -->
<string name="carrier_wifi_offload_title">W+ connections</string> <string name="carrier_wifi_offload_title">W+ connections</string>
<!-- Summary for merged carrier Wi-Fi offload toggle. [CHAR LIMIT=NONE] --> <!-- Summary for merged carrier Wi-Fi offload toggle. [CHAR LIMIT=NONE] -->

View File

@@ -59,6 +59,7 @@
<style name="SettingsMultiSelectListPreference" parent="@style/Preference.Material"> <style name="SettingsMultiSelectListPreference" parent="@style/Preference.Material">
<item name="android:positiveButtonText">@android:string/ok</item> <item name="android:positiveButtonText">@android:string/ok</item>
<item name="android:negativeButtonText">@android:string/cancel</item> <item name="android:negativeButtonText">@android:string/cancel</item>
<item name="iconSpaceReserved">@bool/settingslib_config_icon_space_reserved</item>
</style> </style>
<style name="SettingsPreferenceFragmentStyle" parent="@style/PreferenceFragment.Material"> <style name="SettingsPreferenceFragmentStyle" parent="@style/PreferenceFragment.Material">

View File

@@ -24,27 +24,18 @@
android:key="header_view" android:key="header_view"
android:layout="@layout/settings_entity_header" android:layout="@layout/settings_entity_header"
android:selectable="false" android:selectable="false"
android:order="-10000" android:order="-10000" />
settings:allowDividerBelow="true"/>
<com.android.settingslib.widget.LayoutPreference <com.android.settingslib.widget.LayoutPreference
android:key="instant_app_buttons" android:key="instant_app_buttons"
android:layout="@layout/instant_app_buttons" android:layout="@layout/instant_app_buttons"
android:selectable="false" android:selectable="false"
android:order="-9999" android:order="-9999" />
settings:allowDividerAbove="true"
settings:allowDividerBelow="true"/>
<com.android.settingslib.widget.ActionButtonsPreference <com.android.settingslib.widget.ActionButtonsPreference
android:key="action_buttons" android:key="action_buttons"
android:order="-9998" /> android:order="-9998" />
<!-- Add SpacePreference to draw divider -->
<com.android.settings.applications.SpacePreference
android:layout_height="0dp"
android:order="-9997"
settings:allowDividerAbove="true" />
<Preference <Preference
android:key="app_settings_link" android:key="app_settings_link"
android:title="@string/app_settings_link" android:title="@string/app_settings_link"

View File

@@ -22,11 +22,6 @@
<com.android.settingslib.widget.ActionButtonsPreference <com.android.settingslib.widget.ActionButtonsPreference
android:key="header_view" /> android:key="header_view" />
<com.android.settings.applications.SpacePreference
android:key="storage_space"
android:layout_height="8dp"
settings:allowDividerAbove="true"/>
<Preference <Preference
android:key="storage_used" android:key="storage_used"
android:title="@string/storage_used" android:title="@string/storage_used"
@@ -41,8 +36,7 @@
<PreferenceCategory <PreferenceCategory
android:key="storage_category" android:key="storage_category"
android:title="@string/app_info_storage_title" android:title="@string/app_info_storage_title">
settings:allowDividerAbove="true">
<Preference <Preference
android:key="app_size" android:key="app_size"

View File

@@ -30,7 +30,8 @@
<com.android.settingslib.widget.TopIntroPreference <com.android.settingslib.widget.TopIntroPreference
android:key="top_intro_request_manage_credentials" android:key="top_intro_request_manage_credentials"
android:order="-9999" android:order="-9999"
android:title="@string/request_manage_credentials_description"/> android:title="@string/request_manage_credentials_description"
settings:searchable="false"/>
<!-- Buttons --> <!-- Buttons -->
<com.android.settingslib.widget.ActionButtonsPreference <com.android.settingslib.widget.ActionButtonsPreference

View File

@@ -163,7 +163,7 @@
android:title="@string/call_category" android:title="@string/call_category"
settings:controller="com.android.settings.network.telephony.CallingPreferenceCategoryController"> settings:controller="com.android.settings.network.telephony.CallingPreferenceCategoryController">
<PreferenceScreen <Preference
android:key="wifi_calling" android:key="wifi_calling"
android:title="@string/wifi_calling_settings_title" android:title="@string/wifi_calling_settings_title"
android:summary="@string/wifi_calling_summary" android:summary="@string/wifi_calling_summary"
@@ -173,7 +173,7 @@
android:targetClass="com.android.settings.Settings$WifiCallingSettingsActivity"> android:targetClass="com.android.settings.Settings$WifiCallingSettingsActivity">
<extra android:name="show_drawer_menu" android:value="true"/> <extra android:name="show_drawer_menu" android:value="true"/>
</intent> </intent>
</PreferenceScreen> </Preference>
<SwitchPreference <SwitchPreference
android:key="video_calling_key" android:key="video_calling_key"

View File

@@ -28,6 +28,7 @@
android:key="app_list"/> android:key="app_list"/>
<com.android.settingslib.widget.FooterPreference <com.android.settingslib.widget.FooterPreference
android:key="battery_graph_footer"
android:title="@string/battery_usage_screen_footer" android:title="@string/battery_usage_screen_footer"
android:selectable="false" android:selectable="false"
settings:searchable="false"/> settings:searchable="false"/>

View File

@@ -26,13 +26,6 @@
android:key="biometric_ways_to_unlock" android:key="biometric_ways_to_unlock"
android:title="@string/biometric_settings_category_ways_to_unlock"> android:title="@string/biometric_settings_category_ways_to_unlock">
<Preference
android:key="biometric_fingerprint_settings"
android:title="@string/security_settings_fingerprint_preference_title"
android:summary="@string/summary_placeholder"
settings:keywords="@string/keywords_fingerprint_settings"
settings:controller="com.android.settings.biometrics.combination.BiometricFingerprintStatusPreferenceController" />
<Preference <Preference
android:key="biometric_face_settings" android:key="biometric_face_settings"
android:title="@string/security_settings_face_preference_title" android:title="@string/security_settings_face_preference_title"
@@ -40,6 +33,13 @@
settings:keywords="@string/keywords_face_settings" settings:keywords="@string/keywords_face_settings"
settings:controller="com.android.settings.biometrics.combination.BiometricFaceStatusPreferenceController" /> settings:controller="com.android.settings.biometrics.combination.BiometricFaceStatusPreferenceController" />
<Preference
android:key="biometric_fingerprint_settings"
android:title="@string/security_settings_fingerprint_preference_title"
android:summary="@string/summary_placeholder"
settings:keywords="@string/keywords_fingerprint_settings"
settings:controller="com.android.settings.biometrics.combination.BiometricFingerprintStatusPreferenceController" />
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory <PreferenceCategory

View File

@@ -29,12 +29,12 @@
settings:controller="com.android.settings.biometrics.face.FaceUnlockCategoryPreferenceController"> settings:controller="com.android.settings.biometrics.face.FaceUnlockCategoryPreferenceController">
<com.android.settingslib.RestrictedSwitchPreference <com.android.settingslib.RestrictedSwitchPreference
android:key="security_settings_face_keyguard" android:key="security_settings_face_keyguard"
android:title="@string/security_settings_face_settings_use_face_unlock_phone" android:title="@string/biometric_settings_use_biometric_unlock_phone"
settings:keywords="@string/keywords_face_unlock" settings:keywords="@string/keywords_face_unlock"
settings:controller="com.android.settings.biometrics.face.FaceSettingsKeyguardPreferenceController"/> settings:controller="com.android.settings.biometrics.face.FaceSettingsKeyguardPreferenceController"/>
<SwitchPreference <SwitchPreference
android:key="security_settings_face_app" android:key="security_settings_face_app"
android:title="@string/security_settings_face_settings_use_face_for_apps" android:title="@string/biometric_settings_use_biometric_for_apps"
settings:keywords="@string/keywords_face_unlock" settings:keywords="@string/keywords_face_unlock"
settings:controller="com.android.settings.biometrics.face.FaceSettingsAppPreferenceController"/> settings:controller="com.android.settings.biometrics.face.FaceSettingsAppPreferenceController"/>
<com.android.settingslib.RestrictedSwitchPreference <com.android.settingslib.RestrictedSwitchPreference

View File

@@ -233,18 +233,6 @@ public class SettingsActivity extends SettingsBaseActivity
@Override @Override
protected void onCreate(Bundle savedState) { protected void onCreate(Bundle savedState) {
if (FeatureFlagUtils.isEnabled(this, FeatureFlags.SILKY_HOME)) {
// Enable Activity transitions
getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
final MaterialSharedAxis enterTransition = new MaterialSharedAxis(
MaterialSharedAxis.X, /* forward */true);
getWindow().setEnterTransition(enterTransition);
final MaterialSharedAxis returnTransition = new MaterialSharedAxis(
MaterialSharedAxis.X, /* forward */false);
getWindow().setReturnTransition(returnTransition);
}
super.onCreate(savedState); super.onCreate(savedState);
Log.d(LOG_TAG, "Starting onCreate"); Log.d(LOG_TAG, "Starting onCreate");
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();

View File

@@ -89,7 +89,7 @@ public class VerifiedLinksPreference extends TwoTargetPreference {
CheckBox checkBox = (CheckBox) view.findViewById(com.android.internal.R.id.checkbox); CheckBox checkBox = (CheckBox) view.findViewById(com.android.internal.R.id.checkbox);
if (checkBox != null) { if (checkBox != null) {
checkBox.setChecked(true); checkBox.setChecked(true);
checkBox.setVisibility(mShowCheckBox ? View.VISIBLE : View.INVISIBLE); checkboxContainer.setVisibility(mShowCheckBox ? View.VISIBLE : View.GONE);
} }
} }
} }

View File

@@ -19,6 +19,7 @@ package com.android.settings.applications.manageapplications;
import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@@ -37,9 +38,8 @@ import com.android.settingslib.applications.ApplicationsState.AppEntry;
public class ApplicationViewHolder extends RecyclerView.ViewHolder { public class ApplicationViewHolder extends RecyclerView.ViewHolder {
private final TextView mAppName; @VisibleForTesting
private final ImageView mAppIcon; final TextView mAppName;
@VisibleForTesting @VisibleForTesting
final TextView mSummary; final TextView mSummary;
@VisibleForTesting @VisibleForTesting
@@ -49,6 +49,8 @@ public class ApplicationViewHolder extends RecyclerView.ViewHolder {
@VisibleForTesting @VisibleForTesting
final Switch mSwitch; final Switch mSwitch;
private final ImageView mAppIcon;
ApplicationViewHolder(View itemView) { ApplicationViewHolder(View itemView) {
super(itemView); super(itemView);
mAppName = itemView.findViewById(android.R.id.title); mAppName = itemView.findViewById(android.R.id.title);
@@ -95,11 +97,16 @@ public class ApplicationViewHolder extends RecyclerView.ViewHolder {
itemView.setEnabled(isEnabled); itemView.setEnabled(isEnabled);
} }
void setTitle(CharSequence title) { void setTitle(CharSequence title, CharSequence contentDescription) {
if (title == null) { if (title == null) {
return; return;
} }
mAppName.setText(title); mAppName.setText(title);
if (TextUtils.isEmpty(contentDescription)) {
return;
}
mAppName.setContentDescription(contentDescription);
} }
void setIcon(int drawableRes) { void setIcon(int drawableRes) {

View File

@@ -1422,9 +1422,8 @@ public class ManageApplications extends InstrumentedFragment
// Bind the data efficiently with the holder // Bind the data efficiently with the holder
final ApplicationsState.AppEntry entry = mEntries.get(position); final ApplicationsState.AppEntry entry = mEntries.get(position);
synchronized (entry) { synchronized (entry) {
holder.setTitle(entry.label);
mState.ensureLabelDescription(entry); mState.ensureLabelDescription(entry);
holder.itemView.setContentDescription(entry.labelDescription); holder.setTitle(entry.label, entry.labelDescription);
mState.ensureIcon(entry); mState.ensureIcon(entry);
holder.setIcon(entry.icon); holder.setIcon(entry.icon);
updateSummary(holder, entry); updateSummary(holder, entry);

View File

@@ -38,6 +38,7 @@ import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ResolveInfo; import android.content.pm.ResolveInfo;
import android.content.pm.UserInfo; import android.content.pm.UserInfo;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Binder; import android.os.Binder;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
@@ -52,11 +53,11 @@ import android.text.method.ScrollingMovementMethod;
import android.util.EventLog; import android.util.EventLog;
import android.util.Log; import android.util.Log;
import android.view.Display; import android.view.Display;
import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.ViewTreeObserver; import android.view.ViewTreeObserver;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.AppSecurityPermissions;
import android.widget.Button; import android.widget.Button;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
@@ -134,6 +135,8 @@ public class DeviceAdminAdd extends CollapsingToolbarBaseActivity {
boolean mIsCalledFromSupportDialog = false; boolean mIsCalledFromSupportDialog = false;
private LayoutInflater mLayoutInflaternflater;
@Override @Override
protected void onCreate(Bundle icicle) { protected void onCreate(Bundle icicle) {
super.onCreate(icicle); super.onCreate(icicle);
@@ -142,6 +145,7 @@ public class DeviceAdminAdd extends CollapsingToolbarBaseActivity {
mDPM = (DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE); mDPM = (DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE);
mAppOps = (AppOpsManager)getSystemService(Context.APP_OPS_SERVICE); mAppOps = (AppOpsManager)getSystemService(Context.APP_OPS_SERVICE);
mLayoutInflaternflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
PackageManager packageManager = getPackageManager(); PackageManager packageManager = getPackageManager();
if ((getIntent().getFlags()&Intent.FLAG_ACTIVITY_NEW_TASK) != 0) { if ((getIntent().getFlags()&Intent.FLAG_ACTIVITY_NEW_TASK) != 0) {
@@ -735,14 +739,36 @@ public class DeviceAdminAdd extends CollapsingToolbarBaseActivity {
for (DeviceAdminInfo.PolicyInfo pi : mDeviceAdmin.getUsedPolicies()) { for (DeviceAdminInfo.PolicyInfo pi : mDeviceAdmin.getUsedPolicies()) {
int descriptionId = isAdminUser ? pi.description : pi.descriptionForSecondaryUsers; int descriptionId = isAdminUser ? pi.description : pi.descriptionForSecondaryUsers;
int labelId = isAdminUser ? pi.label : pi.labelForSecondaryUsers; int labelId = isAdminUser ? pi.label : pi.labelForSecondaryUsers;
View view = AppSecurityPermissions.getPermissionItemView(this, getText(labelId), View view = getPermissionItemView(getText(labelId),
showDescription ? getText(descriptionId) : "", true); showDescription ? getText(descriptionId) : "");
mAdminPolicies.addView(view); mAdminPolicies.addView(view);
} }
mAdminPoliciesInitialized = true; mAdminPoliciesInitialized = true;
} }
} }
/**
* Utility to retrieve a view displaying a single permission. This provides
* the UI layout for permissions.
*/
private View getPermissionItemView(CharSequence grpName, CharSequence description) {
Drawable icon = this.getDrawable(com.android.internal.R.drawable.ic_text_dot);
View permView = mLayoutInflaternflater.inflate(R.layout.app_permission_item, null);
TextView permGrpView = permView.findViewById(R.id.permission_group);
TextView permDescView = permView.findViewById(R.id.permission_list);
ImageView imgView = (ImageView) permView.findViewById(R.id.perm_icon);
imgView.setImageDrawable(icon);
if (grpName != null) {
permGrpView.setText(grpName);
permDescView.setText(description);
} else {
permGrpView.setText(description);
permDescView.setVisibility(View.GONE);
}
return permView;
}
void toggleMessageEllipsis(View v) { void toggleMessageEllipsis(View v) {
TextView tv = (TextView) v; TextView tv = (TextView) v;

View File

@@ -170,20 +170,28 @@ public abstract class BiometricEnrollBase extends InstrumentedActivity {
layoutTitle.setAccessibilityLiveRegion(View.ACCESSIBILITY_LIVE_REGION_POLITE); layoutTitle.setAccessibilityLiveRegion(View.ACCESSIBILITY_LIVE_REGION_POLITE);
} }
getLayout().setHeaderText(title); getLayout().setHeaderText(title);
getLayout().getHeaderTextView().setContentDescription(title);
setTitle(title); setTitle(title);
} }
} }
protected void setHeaderText(int resId) { protected void setHeaderText(int resId) {
setHeaderText(resId, false /* force */); setHeaderText(resId, false /* force */);
getLayout().getHeaderTextView().setContentDescription(getText(resId));
} }
protected void setHeaderText(CharSequence title) { protected void setHeaderText(CharSequence title) {
getLayout().setHeaderText(title); getLayout().setHeaderText(title);
getLayout().getHeaderTextView().setContentDescription(title);
} }
protected void setDescriptionText(int resId) { protected void setDescriptionText(int resId) {
getLayout().setDescriptionText(resId); CharSequence previousDescription = getLayout().getDescriptionText();
CharSequence description = getString(resId);
// Prevent a11y for re-reading the same string
if (!TextUtils.equals(previousDescription, description)) {
getLayout().setDescriptionText(resId);
}
} }
protected void setDescriptionText(CharSequence descriptionText) { protected void setDescriptionText(CharSequence descriptionText) {

View File

@@ -122,7 +122,10 @@ public abstract class BiometricsSettingsBase extends DashboardFragment {
extras.putByteArray(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, token); extras.putByteArray(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, token);
extras.putInt(BiometricEnrollBase.EXTRA_KEY_SENSOR_ID, sensorId); extras.putInt(BiometricEnrollBase.EXTRA_KEY_SENSOR_ID, sensorId);
extras.putLong(BiometricEnrollBase.EXTRA_KEY_CHALLENGE, challenge); extras.putLong(BiometricEnrollBase.EXTRA_KEY_CHALLENGE, challenge);
super.onPreferenceTreeClick(preference);
}); });
return true;
} else if (getFingerprintPreferenceKey().equals(key)) { } else if (getFingerprintPreferenceKey().equals(key)) {
mDoNotFinishActivity = true; mDoNotFinishActivity = true;
mFingerprintManager.generateChallenge(mUserId, (sensorId, userId, challenge) -> { mFingerprintManager.generateChallenge(mUserId, (sensorId, userId, challenge) -> {
@@ -131,8 +134,12 @@ public abstract class BiometricsSettingsBase extends DashboardFragment {
final Bundle extras = preference.getExtras(); final Bundle extras = preference.getExtras();
extras.putByteArray(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, token); extras.putByteArray(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, token);
extras.putLong(BiometricEnrollBase.EXTRA_KEY_CHALLENGE, challenge); extras.putLong(BiometricEnrollBase.EXTRA_KEY_CHALLENGE, challenge);
super.onPreferenceTreeClick(preference);
}); });
return true;
} }
return super.onPreferenceTreeClick(preference); return super.onPreferenceTreeClick(preference);
} }

View File

@@ -16,6 +16,7 @@
package com.android.settings.biometrics.face; package com.android.settings.biometrics.face;
import android.annotation.StringRes;
import android.app.settings.SettingsEnums; import android.app.settings.SettingsEnums;
import android.content.ComponentName; import android.content.ComponentName;
import android.content.Intent; import android.content.Intent;
@@ -39,6 +40,7 @@ import com.android.settings.password.ChooseLockSettingsHelper;
import com.google.android.setupcompat.template.FooterBarMixin; import com.google.android.setupcompat.template.FooterBarMixin;
import com.google.android.setupcompat.template.FooterButton; import com.google.android.setupcompat.template.FooterButton;
import com.google.android.setupcompat.util.WizardManagerHelper; import com.google.android.setupcompat.util.WizardManagerHelper;
import com.google.android.setupdesign.GlifLayout;
import com.google.android.setupdesign.view.IllustrationVideoView; import com.google.android.setupdesign.view.IllustrationVideoView;
public class FaceEnrollEducation extends BiometricEnrollBase { public class FaceEnrollEducation extends BiometricEnrollBase {
@@ -62,22 +64,27 @@ public class FaceEnrollEducation extends BiometricEnrollBase {
new CompoundButton.OnCheckedChangeListener() { new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
int titleRes = isChecked ? final int headerRes;
R.string.security_settings_face_enroll_education_title_accessibility final int descriptionRes;
: R.string.security_settings_face_enroll_education_title; if (isChecked) {
getLayout().setHeaderText(titleRes); headerRes = R.string
setTitle(titleRes); .security_settings_face_enroll_education_title_accessibility;
descriptionRes = R.string
.security_settings_face_enroll_education_message_accessibility;
} else {
headerRes = R.string.security_settings_face_enroll_education_title;
descriptionRes = R.string.security_settings_face_enroll_education_message;
}
updateHeaders(headerRes, descriptionRes);
if (isChecked) { if (isChecked) {
mIllustrationNormal.stop(); mIllustrationNormal.stop();
mIllustrationNormal.setVisibility(View.INVISIBLE); mIllustrationNormal.setVisibility(View.INVISIBLE);
mIllustrationAccessibility.setVisibility(View.VISIBLE); mIllustrationAccessibility.setVisibility(View.VISIBLE);
mDescriptionText.setVisibility(View.INVISIBLE);
} else { } else {
mIllustrationNormal.setVisibility(View.VISIBLE); mIllustrationNormal.setVisibility(View.VISIBLE);
mIllustrationNormal.start(); mIllustrationNormal.start();
mIllustrationAccessibility.setVisibility(View.INVISIBLE); mIllustrationAccessibility.setVisibility(View.INVISIBLE);
mDescriptionText.setVisibility(View.VISIBLE);
} }
} }
}; };
@@ -86,8 +93,11 @@ public class FaceEnrollEducation extends BiometricEnrollBase {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.face_enroll_education); setContentView(R.layout.face_enroll_education);
getLayout().setHeaderText(R.string.security_settings_face_enroll_education_title);
setTitle(R.string.security_settings_face_enroll_education_title); final int headerRes = R.string.security_settings_face_enroll_education_title;
final int descriptionRes = R.string.security_settings_face_enroll_education_message;
updateHeaders(headerRes, descriptionRes);
mHandler = new Handler(); mHandler = new Handler();
mFaceManager = Utils.getFaceManagerOrNull(this); mFaceManager = Utils.getFaceManagerOrNull(this);
@@ -237,4 +247,13 @@ public class FaceEnrollEducation extends BiometricEnrollBase {
public int getMetricsCategory() { public int getMetricsCategory() {
return SettingsEnums.FACE_ENROLL_INTRO; return SettingsEnums.FACE_ENROLL_INTRO;
} }
private void updateHeaders(@StringRes int headerRes, @StringRes int descriptionRes) {
final CharSequence headerText = getText(headerRes);
setTitle(headerText);
final GlifLayout layout = getLayout();
layout.setHeaderText(headerText);
layout.setDescriptionText(descriptionRes);
}
} }

View File

@@ -37,6 +37,8 @@ import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.animation.AnimationUtils; import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator; import android.view.animation.Interpolator;
import android.widget.ProgressBar; import android.widget.ProgressBar;
@@ -111,6 +113,8 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
private boolean mRestoring; private boolean mRestoring;
private Vibrator mVibrator; private Vibrator mVibrator;
private boolean mIsSetupWizard; private boolean mIsSetupWizard;
private AccessibilityManager mAccessibilityManager;
private boolean mIsAccessibilityEnabled;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@@ -121,6 +125,9 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
fingerprintManager.getSensorPropertiesInternal(); fingerprintManager.getSensorPropertiesInternal();
mCanAssumeUdfps = props.size() == 1 && props.get(0).isAnyUdfpsType(); mCanAssumeUdfps = props.size() == 1 && props.get(0).isAnyUdfpsType();
mAccessibilityManager = getSystemService(AccessibilityManager.class);
mIsAccessibilityEnabled = mAccessibilityManager.isEnabled();
if (mCanAssumeUdfps) { if (mCanAssumeUdfps) {
if (BiometricUtils.isReverseLandscape(getApplicationContext())) { if (BiometricUtils.isReverseLandscape(getApplicationContext())) {
setContentView(R.layout.udfps_enroll_enrolling_land); setContentView(R.layout.udfps_enroll_enrolling_land);
@@ -134,8 +141,8 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
} }
mIsSetupWizard = WizardManagerHelper.isAnySetupWizard(getIntent()); mIsSetupWizard = WizardManagerHelper.isAnySetupWizard(getIntent());
if (mCanAssumeUdfps && !mIsSetupWizard) { if (mCanAssumeUdfps) {
setHeaderText(R.string.security_settings_udfps_enroll_find_sensor_title); updateTitleAndDescription();
} else { } else {
setHeaderText(R.string.security_settings_fingerprint_enroll_repeat_title); setHeaderText(R.string.security_settings_fingerprint_enroll_repeat_title);
} }
@@ -282,7 +289,18 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
private void updateTitleAndDescription() { private void updateTitleAndDescription() {
if (mSidecar == null || mSidecar.getEnrollmentSteps() == -1) { if (mSidecar == null || mSidecar.getEnrollmentSteps() == -1) {
if (mCanAssumeUdfps) { if (mCanAssumeUdfps) {
// setHeaderText(R.string.security_settings_fingerprint_enroll_udfps_title);
// Don't use BiometricEnrollBase#setHeaderText, since that invokes setTitle,
// which gets announced for a11y upon entering the page. For UDFPS, we want to
// announce a different string for a11y upon entering the page.
getLayout().setHeaderText(
R.string.security_settings_fingerprint_enroll_udfps_title);
setDescriptionText(R.string.security_settings_udfps_enroll_start_message); setDescriptionText(R.string.security_settings_udfps_enroll_start_message);
final CharSequence description = getString(
R.string.security_settings_udfps_enroll_a11y);
getLayout().getHeaderTextView().setContentDescription(description);
setTitle(description);
} else { } else {
setDescriptionText(R.string.security_settings_fingerprint_enroll_start_message); setDescriptionText(R.string.security_settings_fingerprint_enroll_start_message);
} }
@@ -295,8 +313,12 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
setDescriptionText(R.string.security_settings_udfps_enroll_start_message); setDescriptionText(R.string.security_settings_udfps_enroll_start_message);
} else { } else {
if (mCanAssumeUdfps) { if (mCanAssumeUdfps) {
setHeaderText(R.string.security_settings_udfps_enroll_repeat_title_touch_icon); setHeaderText(R.string.security_settings_fingerprint_enroll_repeat_title);
setDescriptionText(R.string.security_settings_udfps_enroll_repeat_message); if (mIsAccessibilityEnabled) {
setDescriptionText(R.string.security_settings_udfps_enroll_repeat_a11y_message);
} else {
setDescriptionText(R.string.security_settings_udfps_enroll_repeat_message);
}
} else { } else {
setDescriptionText(R.string.security_settings_fingerprint_enroll_repeat_message); setDescriptionText(R.string.security_settings_fingerprint_enroll_repeat_message);
} }
@@ -339,6 +361,18 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
if (!mCanAssumeUdfps) { if (!mCanAssumeUdfps) {
mErrorText.removeCallbacks(mTouchAgainRunnable); mErrorText.removeCallbacks(mTouchAgainRunnable);
mErrorText.postDelayed(mTouchAgainRunnable, HINT_TIMEOUT_DURATION); mErrorText.postDelayed(mTouchAgainRunnable, HINT_TIMEOUT_DURATION);
} else {
if (mIsAccessibilityEnabled) {
final int percent = (int) (((float)(steps - remaining) / (float) steps) * 100);
CharSequence cs = getString(
R.string.security_settings_udfps_enroll_progress_a11y_message, percent);
AccessibilityEvent e = AccessibilityEvent.obtain();
e.setEventType(AccessibilityEvent.TYPE_ANNOUNCEMENT);
e.setClassName(getClass().getName());
e.setPackageName(getPackageName());
e.getText().add(cs);
mAccessibilityManager.sendAccessibilityEvent(e);
}
} }
} }

View File

@@ -62,7 +62,7 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements
mFooterBarMixin = getLayout().getMixin(FooterBarMixin.class); mFooterBarMixin = getLayout().getMixin(FooterBarMixin.class);
mFooterBarMixin.setSecondaryButton( mFooterBarMixin.setSecondaryButton(
new FooterButton.Builder(this) new FooterButton.Builder(this)
.setText(R.string.skip_label) .setText(R.string.security_settings_fingerprint_enroll_enrolling_skip)
.setListener(this::onSkipButtonClick) .setListener(this::onSkipButtonClick)
.setButtonType(FooterButton.ButtonType.SKIP) .setButtonType(FooterButton.ButtonType.SKIP)
.setTheme(R.style.SudGlifButton_Secondary) .setTheme(R.style.SudGlifButton_Secondary)
@@ -72,8 +72,14 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements
if (mCanAssumeUdfps) { if (mCanAssumeUdfps) {
setHeaderText(R.string.security_settings_udfps_enroll_find_sensor_title); setHeaderText(R.string.security_settings_udfps_enroll_find_sensor_title);
setDescriptionText(R.string.security_settings_udfps_enroll_find_sensor_message); setDescriptionText(R.string.security_settings_udfps_enroll_find_sensor_message);
final CharSequence description = getString(R.string.security_settings_udfps_enroll_find_sensor_a11y); mFooterBarMixin.setPrimaryButton(
getLayout().getDescriptionTextView().setContentDescription(description); new FooterButton.Builder(this)
.setText(R.string.security_settings_udfps_enroll_find_sensor_start_button)
.setListener(this::onStartButtonClick)
.setButtonType(FooterButton.ButtonType.NEXT)
.setTheme(R.style.SudGlifButton_Primary)
.build()
);
} else { } else {
setHeaderText(R.string.security_settings_fingerprint_enroll_find_sensor_title); setHeaderText(R.string.security_settings_fingerprint_enroll_find_sensor_title);
setDescriptionText(R.string.security_settings_fingerprint_enroll_find_sensor_message); setDescriptionText(R.string.security_settings_fingerprint_enroll_find_sensor_message);
@@ -148,6 +154,11 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements
} }
private void startLookingForFingerprint() { private void startLookingForFingerprint() {
if (mCanAssumeUdfps) {
// UDFPS devices use this screen as an educational screen. Users should tap the
// "Start" button to move to the next screen to begin enrollment.
return;
}
mSidecar = (FingerprintEnrollSidecar) getSupportFragmentManager().findFragmentByTag( mSidecar = (FingerprintEnrollSidecar) getSupportFragmentManager().findFragmentByTag(
FingerprintEnrollEnrolling.TAG_SIDECAR); FingerprintEnrollEnrolling.TAG_SIDECAR);
if (mSidecar == null) { if (mSidecar == null) {
@@ -201,6 +212,10 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements
} }
} }
private void onStartButtonClick(View view) {
startActivityForResult(getFingerprintEnrollingIntent(), ENROLL_REQUEST);
}
protected void onSkipButtonClick(View view) { protected void onSkipButtonClick(View view) {
stopLookingForFingerprint(); stopLookingForFingerprint();
setResult(RESULT_SKIP); setResult(RESULT_SKIP);

View File

@@ -16,6 +16,8 @@
package com.android.settings.core; package com.android.settings.core;
import static com.android.internal.jank.InteractionJankMonitor.CUJ_SETTINGS_PAGE_SCROLL;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.text.TextUtils; import android.text.TextUtils;
@@ -24,7 +26,9 @@ import android.util.Log;
import androidx.annotation.XmlRes; import androidx.annotation.XmlRes;
import androidx.preference.Preference; import androidx.preference.Preference;
import androidx.preference.PreferenceScreen; import androidx.preference.PreferenceScreen;
import androidx.recyclerview.widget.RecyclerView;
import com.android.internal.jank.InteractionJankMonitor;
import com.android.settings.overlay.FeatureFactory; import com.android.settings.overlay.FeatureFactory;
import com.android.settings.survey.SurveyMixin; import com.android.settings.survey.SurveyMixin;
import com.android.settingslib.core.instrumentation.Instrumentable; import com.android.settingslib.core.instrumentation.Instrumentable;
@@ -47,6 +51,7 @@ public abstract class InstrumentedPreferenceFragment extends ObservablePreferenc
protected final int PLACEHOLDER_METRIC = 10000; protected final int PLACEHOLDER_METRIC = 10000;
private VisibilityLoggerMixin mVisibilityLoggerMixin; private VisibilityLoggerMixin mVisibilityLoggerMixin;
private RecyclerView.OnScrollListener mOnScrollListener;
@Override @Override
public void onAttach(Context context) { public void onAttach(Context context) {
@@ -62,9 +67,25 @@ public abstract class InstrumentedPreferenceFragment extends ObservablePreferenc
@Override @Override
public void onResume() { public void onResume() {
mVisibilityLoggerMixin.setSourceMetricsCategory(getActivity()); mVisibilityLoggerMixin.setSourceMetricsCategory(getActivity());
// Add scroll listener to trace interaction jank.
final RecyclerView recyclerView = getListView();
if (recyclerView != null) {
mOnScrollListener = new OnScrollListener(getClass().getName());
recyclerView.addOnScrollListener(mOnScrollListener);
}
super.onResume(); super.onResume();
} }
@Override
public void onPause() {
final RecyclerView recyclerView = getListView();
if (mOnScrollListener != null) {
recyclerView.removeOnScrollListener(mOnScrollListener);
mOnScrollListener = null;
}
super.onPause();
}
@Override @Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
final int resId = getPreferenceScreenResId(); final int resId = getPreferenceScreenResId();
@@ -123,4 +144,26 @@ public abstract class InstrumentedPreferenceFragment extends ObservablePreferenc
} }
} }
private static final class OnScrollListener extends RecyclerView.OnScrollListener {
private final InteractionJankMonitor mMonitor = InteractionJankMonitor.getInstance();
private final String mClassName;
private OnScrollListener(String className) {
mClassName = className;
}
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
switch (newState) {
case RecyclerView.SCROLL_STATE_DRAGGING:
// TODO: Update API with tag parameter (class name).
mMonitor.begin(recyclerView, CUJ_SETTINGS_PAGE_SCROLL);
break;
case RecyclerView.SCROLL_STATE_IDLE:
mMonitor.end(CUJ_SETTINGS_PAGE_SCROLL);
break;
default:
}
}
}
} }

View File

@@ -77,6 +77,7 @@ public class SettingsBaseActivity extends FragmentActivity {
protected CollapsingToolbarLayout mCollapsingToolbarLayout; protected CollapsingToolbarLayout mCollapsingToolbarLayout;
private int mCategoriesUpdateTaskCount; private int mCategoriesUpdateTaskCount;
private Toolbar mToolbar;
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -129,21 +130,39 @@ public class SettingsBaseActivity extends FragmentActivity {
} }
} }
@Override
public void setActionBar(@androidx.annotation.Nullable Toolbar toolbar) {
super.setActionBar(toolbar);
mToolbar = toolbar;
}
@Override @Override
public boolean onNavigateUp() { public boolean onNavigateUp() {
if (!super.onNavigateUp()) { if (!super.onNavigateUp()) {
finish(); finishAfterTransition();
} }
return true; return true;
} }
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
final int id = item.getItemId();
if (id == android.R.id.home) {
// Make the up button behave the same as the back button.
finishAfterTransition();
return true;
}
return super.onOptionsItemSelected(item);
}
@Override @Override
public void startActivity(Intent intent) { public void startActivity(Intent intent) {
if (!Utils.isPageTransitionEnabled(this)) { if (!Utils.isPageTransitionEnabled(this)) {
super.startActivity(intent); super.startActivity(intent);
return; return;
} }
super.startActivity(intent, getActivityOptionsBundle()); super.startActivity(intent, createActivityOptionsBundleForTransition(null));
} }
@Override @Override
@@ -152,11 +171,7 @@ public class SettingsBaseActivity extends FragmentActivity {
super.startActivity(intent, options); super.startActivity(intent, options);
return; return;
} }
if (options != null) { super.startActivity(intent, createActivityOptionsBundleForTransition(options));
super.startActivity(intent, getMergedBundleForTransition(options));
return;
}
super.startActivity(intent, getActivityOptionsBundle());
} }
@Override @Override
@@ -167,7 +182,8 @@ public class SettingsBaseActivity extends FragmentActivity {
super.startActivityForResult(intent, requestCode); super.startActivityForResult(intent, requestCode);
return; return;
} }
super.startActivityForResult(intent, requestCode, getActivityOptionsBundle()); super.startActivityForResult(intent, requestCode,
createActivityOptionsBundleForTransition(null));
} }
@Override @Override
@@ -177,12 +193,8 @@ public class SettingsBaseActivity extends FragmentActivity {
super.startActivityForResult(intent, requestCode, options); super.startActivityForResult(intent, requestCode, options);
return; return;
} }
if (options != null) { super.startActivityForResult(intent, requestCode,
super.startActivityForResult(intent, requestCode, createActivityOptionsBundleForTransition(options));
getMergedBundleForTransition(options));
return;
}
super.startActivityForResult(intent, requestCode, getActivityOptionsBundle());
} }
@Override @Override
@@ -192,7 +204,8 @@ public class SettingsBaseActivity extends FragmentActivity {
super.startActivityForResultAsUser(intent, requestCode, userHandle); super.startActivityForResultAsUser(intent, requestCode, userHandle);
return; return;
} }
super.startActivityForResultAsUser(intent, requestCode, getActivityOptionsBundle(), super.startActivityForResultAsUser(intent, requestCode,
createActivityOptionsBundleForTransition(null),
userHandle); userHandle);
} }
@@ -242,17 +255,6 @@ public class SettingsBaseActivity extends FragmentActivity {
((ViewGroup) findViewById(R.id.content_frame)).addView(view, params); ((ViewGroup) findViewById(R.id.content_frame)).addView(view, params);
} }
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
final int id = item.getItemId();
if (id == android.R.id.home) {
// Make the up button behave the same as the back button.
onBackPressed();
return true;
}
return super.onOptionsItemSelected(item);
}
@Override @Override
public void setTitle(CharSequence title) { public void setTitle(CharSequence title) {
if (mCollapsingToolbarLayout != null) { if (mCollapsingToolbarLayout != null) {
@@ -341,20 +343,21 @@ public class SettingsBaseActivity extends FragmentActivity {
} }
} }
private Bundle getActivityOptionsBundle() { @androidx.annotation.Nullable
final Toolbar toolbar = findViewById(R.id.action_bar); private Bundle createActivityOptionsBundleForTransition(
return ActivityOptions.makeSceneTransitionAnimation(this, toolbar, @androidx.annotation.Nullable Bundle options) {
"shared_element_view").toBundle(); if (mToolbar == null) {
} Log.w(TAG, "setActionBar(Toolbar) is not called. Cannot apply settings transition!");
return options;
private Bundle getMergedBundleForTransition(@NonNull Bundle options) {
final Bundle mergedBundle = new Bundle();
mergedBundle.putAll(options);
final Bundle activityOptionsBundle = getActivityOptionsBundle();
if (activityOptionsBundle != null) {
mergedBundle.putAll(activityOptionsBundle);
} }
return mergedBundle; final Bundle transitionOptions = ActivityOptions.makeSceneTransitionAnimation(this,
mToolbar, "shared_element_view").toBundle();
if (options == null) {
return transitionOptions;
}
final Bundle mergedOptions = new Bundle(options);
mergedOptions.putAll(transitionOptions);
return mergedOptions;
} }
public interface CategoryListener { public interface CategoryListener {

View File

@@ -26,6 +26,8 @@ import android.os.storage.VolumeInfo;
import android.os.storage.VolumeRecord; import android.os.storage.VolumeRecord;
import android.text.TextUtils; import android.text.TextUtils;
import com.android.settings.R;
import java.io.File; import java.io.File;
/** /**
@@ -44,8 +46,15 @@ public class StorageEntry implements Comparable<StorageEntry>, Parcelable {
mVolumeInfo = volumeInfo; mVolumeInfo = volumeInfo;
mUnsupportedDiskInfo = null; mUnsupportedDiskInfo = null;
mMissingVolumeRecord = null; mMissingVolumeRecord = null;
mVolumeInfoDescription = context.getSystemService(StorageManager.class)
.getBestVolumeDescription(mVolumeInfo); if (isDefaultInternalStorage()) {
// Shows "This device" for default internal storage.
mVolumeInfoDescription = context.getResources()
.getString(R.string.storage_default_internal_storage);
} else {
mVolumeInfoDescription = context.getSystemService(StorageManager.class)
.getBestVolumeDescription(mVolumeInfo);
}
} }
public StorageEntry(@NonNull DiskInfo diskInfo) { public StorageEntry(@NonNull DiskInfo diskInfo) {

View File

@@ -32,23 +32,20 @@ import com.android.settingslib.widget.BannerMessagePreference;
public class AdaptiveSleepBatterySaverPreferenceController { public class AdaptiveSleepBatterySaverPreferenceController {
@VisibleForTesting @VisibleForTesting
final BannerMessagePreference mPreference; BannerMessagePreference mPreference;
private final PowerManager mPowerManager; private final PowerManager mPowerManager;
private final Context mContext;
public AdaptiveSleepBatterySaverPreferenceController(Context context) { public AdaptiveSleepBatterySaverPreferenceController(Context context) {
mPreference = new BannerMessagePreference(context);
mPreference.setTitle(R.string.ambient_camera_summary_battery_saver_on);
mPreference.setPositiveButtonText(R.string.disable_text);
mPowerManager = context.getSystemService(PowerManager.class); mPowerManager = context.getSystemService(PowerManager.class);
mPreference.setPositiveButtonOnClickListener(p -> { mContext = context;
mPowerManager.setPowerSaveModeEnabled(false);
});
} }
/** /**
* Adds the controlled preference to the provided preference screen. * Adds the controlled preference to the provided preference screen.
*/ */
public void addToScreen(PreferenceScreen screen) { public void addToScreen(PreferenceScreen screen) {
initializePreference();
screen.addPreference(mPreference); screen.addPreference(mPreference);
updateVisibility(); updateVisibility();
} }
@@ -66,6 +63,17 @@ public class AdaptiveSleepBatterySaverPreferenceController {
* Refreshes the visibility of the preference. * Refreshes the visibility of the preference.
*/ */
public void updateVisibility() { public void updateVisibility() {
initializePreference();
mPreference.setVisible(isPowerSaveMode()); mPreference.setVisible(isPowerSaveMode());
} }
private void initializePreference() {
if (mPreference == null) {
mPreference = new BannerMessagePreference(mContext);
mPreference.setTitle(R.string.ambient_camera_summary_battery_saver_on);
mPreference.setPositiveButtonText(R.string.disable_text);
mPreference.setPositiveButtonOnClickListener(
p -> mPowerManager.setPowerSaveModeEnabled(false));
}
}
} }

View File

@@ -33,26 +33,22 @@ import com.android.settingslib.widget.BannerMessagePreference;
*/ */
public class AdaptiveSleepCameraStatePreferenceController { public class AdaptiveSleepCameraStatePreferenceController {
@VisibleForTesting @VisibleForTesting
final BannerMessagePreference mPreference; BannerMessagePreference mPreference;
private final SensorPrivacyManager mPrivacyManager; private final SensorPrivacyManager mPrivacyManager;
private final Context mContext;
public AdaptiveSleepCameraStatePreferenceController(Context context) { public AdaptiveSleepCameraStatePreferenceController(Context context) {
mPreference = new BannerMessagePreference(context);
mPreference.setTitle(R.string.auto_rotate_camera_lock_title);
mPreference.setSummary(R.string.adaptive_sleep_camera_lock_summary);
mPreference.setPositiveButtonText(R.string.allow);
mPrivacyManager = SensorPrivacyManager.getInstance(context); mPrivacyManager = SensorPrivacyManager.getInstance(context);
mPrivacyManager.addSensorPrivacyListener(CAMERA, mPrivacyManager.addSensorPrivacyListener(CAMERA,
(sensor, enabled) -> updateVisibility()); (sensor, enabled) -> updateVisibility());
mPreference.setPositiveButtonOnClickListener(p -> { mContext = context;
mPrivacyManager.setSensorPrivacy(CAMERA, false);
});
} }
/** /**
* Adds the controlled preference to the provided preference screen. * Adds the controlled preference to the provided preference screen.
*/ */
public void addToScreen(PreferenceScreen screen) { public void addToScreen(PreferenceScreen screen) {
initializePreference();
screen.addPreference(mPreference); screen.addPreference(mPreference);
updateVisibility(); updateVisibility();
} }
@@ -70,6 +66,18 @@ public class AdaptiveSleepCameraStatePreferenceController {
* Refreshes the visibility of the preference. * Refreshes the visibility of the preference.
*/ */
public void updateVisibility() { public void updateVisibility() {
initializePreference();
mPreference.setVisible(isCameraLocked()); mPreference.setVisible(isCameraLocked());
} }
private void initializePreference() {
if (mPreference == null) {
mPreference = new BannerMessagePreference(mContext);
mPreference.setTitle(R.string.auto_rotate_camera_lock_title);
mPreference.setSummary(R.string.adaptive_sleep_camera_lock_summary);
mPreference.setPositiveButtonText(R.string.allow);
mPreference.setPositiveButtonOnClickListener(
p -> mPrivacyManager.setSensorPrivacy(CAMERA, false));
}
}
} }

View File

@@ -65,19 +65,6 @@ public class AdaptiveSleepPreferenceController {
mMetricsFeatureProvider = FeatureFactory.getFactory(context).getMetricsFeatureProvider(); mMetricsFeatureProvider = FeatureFactory.getFactory(context).getMetricsFeatureProvider();
mPrivacyManager = SensorPrivacyManager.getInstance(context); mPrivacyManager = SensorPrivacyManager.getInstance(context);
mPowerManager = context.getSystemService(PowerManager.class); mPowerManager = context.getSystemService(PowerManager.class);
mPreference = new RestrictedSwitchPreference(context);
mPreference.setTitle(R.string.adaptive_sleep_title);
mPreference.setSummary(R.string.adaptive_sleep_description);
mPreference.setChecked(isChecked());
mPreference.setKey(PREFERENCE_KEY);
mPreference.setOnPreferenceClickListener(preference -> {
final boolean isChecked = ((RestrictedSwitchPreference) preference).isChecked();
mMetricsFeatureProvider.action(context, SettingsEnums.ACTION_SCREEN_ATTENTION_CHANGED,
isChecked);
Settings.Secure.putInt(context.getContentResolver(),
Settings.Secure.ADAPTIVE_SLEEP, isChecked ? 1 : DEFAULT_VALUE);
return true;
});
mPackageManager = context.getPackageManager(); mPackageManager = context.getPackageManager();
} }
@@ -116,8 +103,8 @@ public class AdaptiveSleepPreferenceController {
mPreference.setSummary(R.string.adaptive_sleep_description); mPreference.setSummary(R.string.adaptive_sleep_description);
mPreference.setChecked(isChecked()); mPreference.setChecked(isChecked());
mPreference.setKey(PREFERENCE_KEY); mPreference.setKey(PREFERENCE_KEY);
mPreference.setOnPreferenceChangeListener((preference, value) -> { mPreference.setOnPreferenceClickListener(preference -> {
final boolean isChecked = (Boolean) value; final boolean isChecked = ((RestrictedSwitchPreference) preference).isChecked();
mMetricsFeatureProvider.action(mContext, mMetricsFeatureProvider.action(mContext,
SettingsEnums.ACTION_SCREEN_ATTENTION_CHANGED, SettingsEnums.ACTION_SCREEN_ATTENTION_CHANGED,
isChecked); isChecked);

View File

@@ -48,6 +48,7 @@ import com.android.settingslib.core.lifecycle.events.OnDestroy;
import com.android.settingslib.core.lifecycle.events.OnResume; import com.android.settingslib.core.lifecycle.events.OnResume;
import com.android.settingslib.core.lifecycle.events.OnSaveInstanceState; import com.android.settingslib.core.lifecycle.events.OnSaveInstanceState;
import com.android.settingslib.utils.StringUtil; import com.android.settingslib.utils.StringUtil;
import com.android.settingslib.widget.FooterPreference;
import java.util.Arrays; import java.util.Arrays;
import java.util.ArrayList; import java.util.ArrayList;
@@ -62,6 +63,9 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
OnSaveInstanceState, BatteryChartView.OnSelectListener, OnResume, OnSaveInstanceState, BatteryChartView.OnSelectListener, OnResume,
ExpandDividerPreference.OnExpandListener { ExpandDividerPreference.OnExpandListener {
private static final String TAG = "BatteryChartPreferenceController"; private static final String TAG = "BatteryChartPreferenceController";
private static final String KEY_FOOTER_PREF = "battery_graph_footer";
private static final int ADD_FOOTER_DELAYED_MS = 250;
/** Desired battery history size for timestamp slots. */ /** Desired battery history size for timestamp slots. */
public static final int DESIRED_HISTORY_SIZE = 25; public static final int DESIRED_HISTORY_SIZE = 25;
private static final int CHART_LEVEL_ARRAY_SIZE = 13; private static final int CHART_LEVEL_ARRAY_SIZE = 13;
@@ -90,6 +94,9 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
@VisibleForTesting int mTrapezoidIndex = BatteryChartView.SELECTED_INDEX_INVALID; @VisibleForTesting int mTrapezoidIndex = BatteryChartView.SELECTED_INDEX_INVALID;
private boolean mIs24HourFormat = false; private boolean mIs24HourFormat = false;
private boolean mIsFooterPrefAdded = false;
private PreferenceScreen mPreferenceScreen;
private FooterPreference mFooterPreference;
private final String mPreferenceKey; private final String mPreferenceKey;
private final SettingsActivity mActivity; private final SettingsActivity mActivity;
@@ -178,9 +185,15 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
@Override @Override
public void displayPreference(PreferenceScreen screen) { public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen); super.displayPreference(screen);
mPreferenceScreen = screen;
mPrefContext = screen.getContext(); mPrefContext = screen.getContext();
mAppListPrefGroup = screen.findPreference(mPreferenceKey); mAppListPrefGroup = screen.findPreference(mPreferenceKey);
mAppListPrefGroup.setOrderingAsAdded(false); mAppListPrefGroup.setOrderingAsAdded(false);
mFooterPreference = screen.findPreference(KEY_FOOTER_PREF);
// Removes footer first until usage data is loaded to avoid flashing.
if (mFooterPreference != null) {
screen.removePreference(mFooterPreference);
}
} }
@Override @Override
@@ -264,6 +277,7 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
mBatteryIndexedMap = null; mBatteryIndexedMap = null;
mBatteryHistoryKeys = null; mBatteryHistoryKeys = null;
mBatteryHistoryLevels = null; mBatteryHistoryLevels = null;
addFooterPreferenceIfNeeded(false);
return; return;
} }
mBatteryHistoryKeys = getBatteryHistoryKeys(batteryHistoryMap); mBatteryHistoryKeys = getBatteryHistoryKeys(batteryHistoryMap);
@@ -347,6 +361,7 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
private void addAllPreferences() { private void addAllPreferences() {
final List<BatteryDiffEntry> entries = final List<BatteryDiffEntry> entries =
mBatteryIndexedMap.get(Integer.valueOf(mTrapezoidIndex)); mBatteryIndexedMap.get(Integer.valueOf(mTrapezoidIndex));
addFooterPreferenceIfNeeded(!entries.isEmpty());
if (entries == null) { if (entries == null) {
Log.w(TAG, "cannot find BatteryDiffEntry for:" + mTrapezoidIndex); Log.w(TAG, "cannot find BatteryDiffEntry for:" + mTrapezoidIndex);
return; return;
@@ -575,6 +590,20 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
mBatteryChartView.setLatestTimestamp(latestTimestamp); mBatteryChartView.setLatestTimestamp(latestTimestamp);
} }
private void addFooterPreferenceIfNeeded(boolean containAppItems) {
if (mIsFooterPrefAdded || mFooterPreference == null) {
return;
}
mIsFooterPrefAdded = true;
mFooterPreference.setTitle(mPrefContext.getString(
containAppItems
? R.string.battery_usage_screen_footer
: R.string.battery_usage_screen_footer_empty));
mHandler.postDelayed(
() -> mPreferenceScreen.addPreference(mFooterPreference),
ADD_FOOTER_DELAYED_MS);
}
private static String utcToLocalTime(long[] timestamps) { private static String utcToLocalTime(long[] timestamps) {
final StringBuilder builder = new StringBuilder(); final StringBuilder builder = new StringBuilder();
for (int index = 0; index < timestamps.length; index++) { for (int index = 0; index < timestamps.length; index++) {

View File

@@ -20,10 +20,10 @@ package com.android.settings.homepage.contextualcards;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager;
import android.hardware.face.Face; import android.hardware.face.Face;
import android.hardware.face.FaceManager; import android.hardware.face.FaceManager;
import android.os.Bundle; import android.os.Bundle;
import android.provider.Settings;
import android.util.Log; import android.util.Log;
import com.android.internal.app.AlertActivity; import com.android.internal.app.AlertActivity;
@@ -53,11 +53,15 @@ public class FaceReEnrollDialog extends AlertActivity implements
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
final PackageManager pm = getApplicationContext().getPackageManager();
final int dialogMessageRes = pm.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)
? R.string.security_settings_face_enroll_improve_face_alert_body_fingerprint
: R.string.security_settings_face_enroll_improve_face_alert_body;
final AlertController.AlertParams alertParams = mAlertParams; final AlertController.AlertParams alertParams = mAlertParams;
alertParams.mTitle = getText( alertParams.mTitle = getText(
R.string.security_settings_face_enroll_improve_face_alert_title); R.string.security_settings_face_enroll_improve_face_alert_title);
alertParams.mMessage = getText( alertParams.mMessage = getText(dialogMessageRes);
R.string.security_settings_face_enroll_improve_face_alert_body);
alertParams.mPositiveButtonText = getText(R.string.storage_menu_set_up); alertParams.mPositiveButtonText = getText(R.string.storage_menu_set_up);
alertParams.mNegativeButtonText = getText(R.string.cancel); alertParams.mNegativeButtonText = getText(R.string.cancel);
alertParams.mPositiveButtonListener = this; alertParams.mPositiveButtonListener = this;

View File

@@ -86,7 +86,11 @@ public class EmergencyBroadcastPreferenceController extends AbstractPreferenceCo
private boolean isCellBroadcastAppLinkEnabled() { private boolean isCellBroadcastAppLinkEnabled() {
// Enable link to CMAS app settings depending on the value in config.xml. // Enable link to CMAS app settings depending on the value in config.xml.
boolean enabled = mContext.getResources().getBoolean( boolean enabled = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_cellBroadcastAppLinks); com.android.internal.R.bool.config_cellBroadcastAppLinks) &&
// For data-only tablet devices which need to not forwarding any WEA-alert and hide from
// settings menu.
!mContext.getResources().getBoolean(
com.android.internal.R.bool.config_disable_all_cb_messages);
if (enabled) { if (enabled) {
try { try {
String packageName = CellBroadcastUtils String packageName = CellBroadcastUtils

View File

@@ -92,6 +92,7 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC
} }
} }
} }
button.announceForAccessibility(mContext.getString(R.string.recent_convos_removed));
} catch (RemoteException e) { } catch (RemoteException e) {
Slog.w(TAG, "Could not clear recents", e); Slog.w(TAG, "Could not clear recents", e);
} }

View File

@@ -65,8 +65,8 @@ public class InternetConnectivityPanel implements PanelContent, LifecycleObserve
private static final String TAG = "InternetConnectivityPanel"; private static final String TAG = "InternetConnectivityPanel";
private static final int SUBTITLE_TEXT_NONE = -1; private static final int SUBTITLE_TEXT_NONE = -1;
private static final int SUBTITLE_TEXT_WIFI_IS_TURNED_ON = R.string.wifi_is_turned_on_subtitle; private static final int SUBTITLE_TEXT_WIFI_IS_TURNED_ON = R.string.wifi_is_turned_on_subtitle;
private static final int SUBTITLE_TEXT_SELECT_NETWORK_TO_CONNECT_INTERNET = private static final int SUBTITLE_TEXT_TAP_A_NETWORK_TO_CONNECT =
R.string.select_network_to_connect_internet; R.string.tap_a_network_to_connect;
private static final int SUBTITLE_TEXT_SEARCHING_FOR_NETWORKS = private static final int SUBTITLE_TEXT_SEARCHING_FOR_NETWORKS =
R.string.wifi_empty_list_wifi_on; R.string.wifi_empty_list_wifi_on;
private static final int SUBTITLE_TEXT_NON_CARRIER_NETWORK_UNAVAILABLE = private static final int SUBTITLE_TEXT_NON_CARRIER_NETWORK_UNAVAILABLE =
@@ -326,7 +326,7 @@ public class InternetConnectivityPanel implements PanelContent, LifecycleObserve
if (wifiList != null && wifiList.size() != 0) { if (wifiList != null && wifiList.size() != 0) {
// When the Wi-Fi scan result is not empty // When the Wi-Fi scan result is not empty
// Sub-Title: Select the network you want to use for data // Sub-Title: Select the network you want to use for data
mSubtitle = SUBTITLE_TEXT_SELECT_NETWORK_TO_CONNECT_INTERNET; mSubtitle = SUBTITLE_TEXT_TAP_A_NETWORK_TO_CONNECT;
return; return;
} }

View File

@@ -23,6 +23,7 @@ import android.content.DialogInterface;
import android.os.Bundle; import android.os.Bundle;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.StringRes;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager;
@@ -77,22 +78,20 @@ public class SetupSkipDialog extends InstrumentedDialogFragment
final boolean forBiometrics = final boolean forBiometrics =
args.getBoolean(ChooseLockSettingsHelper.EXTRA_KEY_FOR_BIOMETRICS); args.getBoolean(ChooseLockSettingsHelper.EXTRA_KEY_FOR_BIOMETRICS);
if (forFace || forFingerprint || forBiometrics) { if (forFace || forFingerprint || forBiometrics) {
final boolean hasFace = forFace || forBiometrics;
final boolean hasFingerprint = forFingerprint || forBiometrics;
final int titleId; final int titleId;
if (args.getBoolean(ARG_LOCK_TYPE_PATTERN)) {
titleId = R.string.lock_screen_pattern_skip_title;
} else {
titleId = args.getBoolean(ARG_LOCK_TYPE_ALPHANUMERIC) ?
R.string.lock_screen_password_skip_title : R.string.lock_screen_pin_skip_title;
}
final int msgResId; final int msgResId;
if (forBiometrics) { if (args.getBoolean(ARG_LOCK_TYPE_PATTERN)) {
msgResId = R.string.biometrics_lock_screen_setup_skip_dialog_text; titleId = getPatternSkipTitleRes(hasFace, hasFingerprint);
} else if (forFace) { msgResId = getPatternSkipMessageRes(hasFace, hasFingerprint);
msgResId = R.string.face_lock_screen_setup_skip_dialog_text; } else if (args.getBoolean(ARG_LOCK_TYPE_ALPHANUMERIC)) {
titleId = getPasswordSkipTitleRes(hasFace, hasFingerprint);
msgResId = getPasswordSkipMessageRes(hasFace, hasFingerprint);
} else { } else {
msgResId = R.string.fingerprint_lock_screen_setup_skip_dialog_text; titleId = getPinSkipTitleRes(hasFace, hasFingerprint);
msgResId = getPinSkipMessageRes(hasFace, hasFingerprint);
} }
return new AlertDialog.Builder(getContext()) return new AlertDialog.Builder(getContext())
@@ -111,6 +110,84 @@ public class SetupSkipDialog extends InstrumentedDialogFragment
} }
} }
@StringRes
private int getPatternSkipTitleRes(boolean hasFace, boolean hasFingerprint) {
if (hasFace && hasFingerprint) {
return R.string.lock_screen_pattern_skip_biometrics_title;
} else if (hasFace) {
return R.string.lock_screen_pattern_skip_face_title;
} else if (hasFingerprint) {
return R.string.lock_screen_pattern_skip_fingerprint_title;
} else {
return R.string.lock_screen_pattern_skip_title;
}
}
@StringRes
private int getPatternSkipMessageRes(boolean hasFace, boolean hasFingerprint) {
if (hasFace && hasFingerprint) {
return R.string.lock_screen_pattern_skip_biometrics_message;
} else if (hasFace) {
return R.string.lock_screen_pattern_skip_face_message;
} else if (hasFingerprint) {
return R.string.lock_screen_pattern_skip_fingerprint_message;
} else {
return R.string.lock_screen_pattern_skip_message;
}
}
@StringRes
private int getPasswordSkipTitleRes(boolean hasFace, boolean hasFingerprint) {
if (hasFace && hasFingerprint) {
return R.string.lock_screen_password_skip_biometrics_title;
} else if (hasFace) {
return R.string.lock_screen_password_skip_face_title;
} else if (hasFingerprint) {
return R.string.lock_screen_password_skip_fingerprint_title;
} else {
return R.string.lock_screen_password_skip_title;
}
}
@StringRes
private int getPasswordSkipMessageRes(boolean hasFace, boolean hasFingerprint) {
if (hasFace && hasFingerprint) {
return R.string.lock_screen_password_skip_biometrics_message;
} else if (hasFace) {
return R.string.lock_screen_password_skip_face_message;
} else if (hasFingerprint) {
return R.string.lock_screen_password_skip_fingerprint_message;
} else {
return R.string.lock_screen_password_skip_message;
}
}
@StringRes
private int getPinSkipTitleRes(boolean hasFace, boolean hasFingerprint) {
if (hasFace && hasFingerprint) {
return R.string.lock_screen_pin_skip_biometrics_title;
} else if (hasFace) {
return R.string.lock_screen_pin_skip_face_title;
} else if (hasFingerprint) {
return R.string.lock_screen_pin_skip_fingerprint_title;
} else {
return R.string.lock_screen_pin_skip_title;
}
}
@StringRes
private int getPinSkipMessageRes(boolean hasFace, boolean hasFingerprint) {
if (hasFace && hasFingerprint) {
return R.string.lock_screen_pin_skip_biometrics_message;
} else if (hasFace) {
return R.string.lock_screen_pin_skip_face_message;
} else if (hasFingerprint) {
return R.string.lock_screen_pin_skip_fingerprint_message;
} else {
return R.string.lock_screen_pin_skip_message;
}
}
@Override @Override
public void onClick(DialogInterface dialog, int button) { public void onClick(DialogInterface dialog, int button) {
switch (button) { switch (button) {

View File

@@ -87,14 +87,10 @@ import com.android.settingslib.widget.ActionButtonsPreference;
import com.android.settingslib.widget.LayoutPreference; import com.android.settingslib.widget.LayoutPreference;
import com.android.wifitrackerlib.WifiEntry; import com.android.wifitrackerlib.WifiEntry;
import com.android.wifitrackerlib.WifiEntry.ConnectCallback; import com.android.wifitrackerlib.WifiEntry.ConnectCallback;
import com.android.wifitrackerlib.WifiEntry.ConnectCallback.ConnectStatus;
import com.android.wifitrackerlib.WifiEntry.ConnectedInfo; import com.android.wifitrackerlib.WifiEntry.ConnectedInfo;
import com.android.wifitrackerlib.WifiEntry.DisconnectCallback; import com.android.wifitrackerlib.WifiEntry.DisconnectCallback;
import com.android.wifitrackerlib.WifiEntry.DisconnectCallback.DisconnectStatus;
import com.android.wifitrackerlib.WifiEntry.ForgetCallback; import com.android.wifitrackerlib.WifiEntry.ForgetCallback;
import com.android.wifitrackerlib.WifiEntry.ForgetCallback.ForgetStatus;
import com.android.wifitrackerlib.WifiEntry.SignInCallback; import com.android.wifitrackerlib.WifiEntry.SignInCallback;
import com.android.wifitrackerlib.WifiEntry.SignInCallback.SignInStatus;
import com.android.wifitrackerlib.WifiEntry.WifiEntryCallback; import com.android.wifitrackerlib.WifiEntry.WifiEntryCallback;
import java.net.Inet4Address; import java.net.Inet4Address;
@@ -390,8 +386,6 @@ public class WifiDetailPreferenceController2 extends AbstractPreferenceControlle
mIpv6Category = screen.findPreference(KEY_IPV6_CATEGORY); mIpv6Category = screen.findPreference(KEY_IPV6_CATEGORY);
mIpv6AddressPref = screen.findPreference(KEY_IPV6_ADDRESSES_PREF); mIpv6AddressPref = screen.findPreference(KEY_IPV6_ADDRESSES_PREF);
mSecurityPref.setSummary(mWifiEntry.getSecurityString(false /* concise */));
} }
/** /**
@@ -545,6 +539,8 @@ public class WifiDetailPreferenceController2 extends AbstractPreferenceControlle
refreshRssiViews(); refreshRssiViews();
// Frequency Pref // Frequency Pref
refreshFrequency(); refreshFrequency();
// Security Pref
refreshSecurity();
// Transmit Link Speed Pref // Transmit Link Speed Pref
refreshTxSpeed(); refreshTxSpeed();
// Receive Link Speed Pref // Receive Link Speed Pref
@@ -646,6 +642,10 @@ public class WifiDetailPreferenceController2 extends AbstractPreferenceControlle
mFrequencyPref.setVisible(true); mFrequencyPref.setVisible(true);
} }
private void refreshSecurity() {
mSecurityPref.setSummary(mWifiEntry.getSecurityString(false /* concise */));
}
private void refreshTxSpeed() { private void refreshTxSpeed() {
if (mWifiInfo == null if (mWifiInfo == null
|| mWifiEntry.getConnectedState() != WifiEntry.CONNECTED_STATE_CONNECTED) { || mWifiEntry.getConnectedState() != WifiEntry.CONNECTED_STATE_CONNECTED) {

View File

@@ -69,6 +69,22 @@ public class ApplicationViewHolderTest {
assertThat(mHolder.mSummary.getText()).isEqualTo(mContext.getText(R.string.disabled)); assertThat(mHolder.mSummary.getText()).isEqualTo(mContext.getText(R.string.disabled));
} }
@Test
public void setTitle_titleIsNotEmptyAndContentIsNotEmpty_shouldSetTitleAndContentDescription() {
mHolder.setTitle("title", "content");
assertThat(mHolder.mAppName).isEqualTo("title");
assertThat(mHolder.mAppName.getContentDescription()).isEqualTo("content");
}
@Test
public void setTitle_titleIsNotEmptyButContentIsEmpty_shouldSetTitle() {
mHolder.setTitle("title", "");
assertThat(mHolder.mAppName).isEqualTo("title");
assertThat(mHolder.mAppName.getContentDescription()).isEqualTo("title");
}
@Test @Test
public void updateSize() { public void updateSize() {
final String invalidStr = "invalid"; final String invalidStr = "invalid";

View File

@@ -57,6 +57,7 @@ import com.android.settings.biometrics.BiometricEnrollBase;
import com.android.settings.core.FeatureFlags; import com.android.settings.core.FeatureFlags;
import com.android.settings.password.ChooseLockGeneric.ChooseLockGenericFragment; import com.android.settings.password.ChooseLockGeneric.ChooseLockGenericFragment;
import com.android.settings.search.SearchFeatureProvider; import com.android.settings.search.SearchFeatureProvider;
import com.android.settings.testutils.shadow.ShadowInteractionJankMonitor;
import com.android.settings.testutils.shadow.ShadowLockPatternUtils; import com.android.settings.testutils.shadow.ShadowLockPatternUtils;
import com.android.settings.testutils.shadow.ShadowStorageManager; import com.android.settings.testutils.shadow.ShadowStorageManager;
import com.android.settings.testutils.shadow.ShadowUserManager; import com.android.settings.testutils.shadow.ShadowUserManager;
@@ -81,7 +82,8 @@ import org.robolectric.shadows.ShadowPersistentDataBlockManager;
ShadowPersistentDataBlockManager.class, ShadowPersistentDataBlockManager.class,
ShadowStorageManager.class, ShadowStorageManager.class,
ShadowUserManager.class, ShadowUserManager.class,
ShadowUtils.class ShadowUtils.class,
ShadowInteractionJankMonitor.class
}) })
public class ChooseLockGenericTest { public class ChooseLockGenericTest {

View File

@@ -82,11 +82,10 @@ public class SetupSkipDialogTest {
AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog(); AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(alertDialog).isNotNull(); assertThat(alertDialog).isNotNull();
ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog); ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog);
assertThat(mActivity.getString(R.string.lock_screen_pin_skip_title)).isEqualTo( assertThat(shadowAlertDialog.getTitle()).isEqualTo(
shadowAlertDialog.getTitle()); mActivity.getString(R.string.lock_screen_pin_skip_biometrics_title));
assertThat(shadowAlertDialog.getMessage()).isEqualTo(
assertThat(getSkipDialogMessage(false, true, false)) mActivity.getString(R.string.lock_screen_pin_skip_biometrics_message));
.isEqualTo(shadowAlertDialog.getMessage());
} }
@Test @Test
@@ -98,11 +97,10 @@ public class SetupSkipDialogTest {
AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog(); AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(alertDialog).isNotNull(); assertThat(alertDialog).isNotNull();
ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog); ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog);
assertThat(mActivity.getString(R.string.lock_screen_password_skip_title)).isEqualTo( assertThat(shadowAlertDialog.getTitle()).isEqualTo(
shadowAlertDialog.getTitle()); mActivity.getString(R.string.lock_screen_password_skip_face_title));
assertThat(shadowAlertDialog.getMessage()).isEqualTo(
assertThat(getSkipDialogMessage(false, true, false)) mActivity.getString(R.string.lock_screen_password_skip_face_message));
.isEqualTo(shadowAlertDialog.getMessage());
} }
@Test @Test
@@ -114,11 +112,10 @@ public class SetupSkipDialogTest {
AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog(); AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(alertDialog).isNotNull(); assertThat(alertDialog).isNotNull();
ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog); ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog);
assertThat(mActivity.getString(R.string.lock_screen_pattern_skip_title)).isEqualTo( assertThat(shadowAlertDialog.getTitle()).isEqualTo(
shadowAlertDialog.getTitle()); mActivity.getString(R.string.lock_screen_pattern_skip_face_title));
assertThat(shadowAlertDialog.getMessage()).isEqualTo(
assertThat(getSkipDialogMessage(false, true, false)) mActivity.getString(R.string.lock_screen_pattern_skip_face_message));
.isEqualTo(shadowAlertDialog.getMessage());
} }
@Test @Test
@@ -130,11 +127,10 @@ public class SetupSkipDialogTest {
AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog(); AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(alertDialog).isNotNull(); assertThat(alertDialog).isNotNull();
ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog); ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog);
assertThat(mActivity.getString(R.string.lock_screen_pin_skip_title)).isEqualTo( assertThat(shadowAlertDialog.getTitle()).isEqualTo(
shadowAlertDialog.getTitle()); mActivity.getString(R.string.lock_screen_pin_skip_fingerprint_title));
assertThat(shadowAlertDialog.getMessage()).isEqualTo(
assertThat(getSkipDialogMessage(true, false, false)) mActivity.getString(R.string.lock_screen_pin_skip_fingerprint_message));
.isEqualTo(shadowAlertDialog.getMessage());
} }
@Test @Test
@@ -146,11 +142,10 @@ public class SetupSkipDialogTest {
AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog(); AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(alertDialog).isNotNull(); assertThat(alertDialog).isNotNull();
ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog); ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog);
assertThat(mActivity.getString(R.string.lock_screen_password_skip_title)).isEqualTo( assertThat(shadowAlertDialog.getTitle()).isEqualTo(
shadowAlertDialog.getTitle()); mActivity.getString(R.string.lock_screen_password_skip_fingerprint_title));
assertThat(shadowAlertDialog.getMessage()).isEqualTo(
assertThat(getSkipDialogMessage(true, false, false)) mActivity.getString(R.string.lock_screen_password_skip_fingerprint_message));
.isEqualTo(shadowAlertDialog.getMessage());
} }
@Test @Test
@@ -162,11 +157,10 @@ public class SetupSkipDialogTest {
AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog(); AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(alertDialog).isNotNull(); assertThat(alertDialog).isNotNull();
ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog); ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog);
assertThat(mActivity.getString(R.string.lock_screen_pattern_skip_title)).isEqualTo( assertThat(shadowAlertDialog.getTitle()).isEqualTo(
shadowAlertDialog.getTitle()); mActivity.getString(R.string.lock_screen_pattern_skip_fingerprint_title));
assertThat(shadowAlertDialog.getMessage()).isEqualTo(
assertThat(getSkipDialogMessage(true, false, false)) mActivity.getString(R.string.lock_screen_pattern_skip_fingerprint_message));
.isEqualTo(shadowAlertDialog.getMessage());
} }
@@ -179,11 +173,10 @@ public class SetupSkipDialogTest {
AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog(); AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(alertDialog).isNotNull(); assertThat(alertDialog).isNotNull();
ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog); ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog);
assertThat(mActivity.getString(R.string.lock_screen_pin_skip_title)).isEqualTo( assertThat(shadowAlertDialog.getTitle()).isEqualTo(
shadowAlertDialog.getTitle()); mActivity.getString(R.string.lock_screen_pin_skip_biometrics_title));
assertThat(shadowAlertDialog.getMessage()).isEqualTo(
assertThat(getSkipDialogMessage(false, false, true)) mActivity.getString(R.string.lock_screen_pin_skip_biometrics_message));
.isEqualTo(shadowAlertDialog.getMessage());
} }
@Test @Test
@@ -195,11 +188,10 @@ public class SetupSkipDialogTest {
AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog(); AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(alertDialog).isNotNull(); assertThat(alertDialog).isNotNull();
ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog); ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog);
assertThat(mActivity.getString(R.string.lock_screen_password_skip_title)).isEqualTo( assertThat(shadowAlertDialog.getTitle()).isEqualTo(
shadowAlertDialog.getTitle()); mActivity.getString(R.string.lock_screen_password_skip_biometrics_title));
assertThat(shadowAlertDialog.getMessage()).isEqualTo(
assertThat(getSkipDialogMessage(false, false, true)) mActivity.getString(R.string.lock_screen_password_skip_biometrics_message));
.isEqualTo(shadowAlertDialog.getMessage());
} }
@Test @Test
@@ -211,25 +203,9 @@ public class SetupSkipDialogTest {
AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog(); AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(alertDialog).isNotNull(); assertThat(alertDialog).isNotNull();
ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog); ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog);
assertThat(mActivity.getString(R.string.lock_screen_pattern_skip_title)).isEqualTo( assertThat(shadowAlertDialog.getTitle()).isEqualTo(
shadowAlertDialog.getTitle()); mActivity.getString(R.string.lock_screen_pattern_skip_biometrics_title));
assertThat(shadowAlertDialog.getMessage()).isEqualTo(
assertThat(getSkipDialogMessage(false, false, true)) mActivity.getString(R.string.lock_screen_pattern_skip_biometrics_message));
.isEqualTo(shadowAlertDialog.getMessage());
}
public String getSkipDialogMessage(boolean forFingerprint, boolean forFace,
boolean forBiometrics) {
final int resId;
if (forFingerprint) {
resId = R.string.fingerprint_lock_screen_setup_skip_dialog_text;
} else if (forFace) {
resId = R.string.face_lock_screen_setup_skip_dialog_text;
} else if (forBiometrics) {
resId = R.string.biometrics_lock_screen_setup_skip_dialog_text;
} else {
return null;
}
return String.format(mActivity.getString(resId));
} }
} }

View File

@@ -0,0 +1,33 @@
/*
* Copyright (C) 2021 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.
*/
package com.android.settings.testutils.shadow;
import static org.mockito.Mockito.mock;
import com.android.internal.jank.InteractionJankMonitor;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
@Implements(InteractionJankMonitor.class)
public class ShadowInteractionJankMonitor {
@Implementation
public static InteractionJankMonitor getInstance() {
return mock(InteractionJankMonitor.class);
}
}

View File

@@ -45,6 +45,7 @@ import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import com.android.settings.testutils.XmlTestUtils; import com.android.settings.testutils.XmlTestUtils;
import com.android.settings.testutils.shadow.ShadowInteractionJankMonitor;
import com.android.settingslib.core.AbstractPreferenceController; import com.android.settingslib.core.AbstractPreferenceController;
import org.junit.Before; import org.junit.Before;
@@ -55,11 +56,13 @@ import org.mockito.MockitoAnnotations;
import org.robolectric.Robolectric; import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner; import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment; import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@RunWith(RobolectricTestRunner.class) @RunWith(RobolectricTestRunner.class)
@Config(shadows = ShadowInteractionJankMonitor.class)
public class WifiP2pSettingsTest { public class WifiP2pSettingsTest {
private Context mContext; private Context mContext;

View File

@@ -33,6 +33,7 @@ import androidx.fragment.app.FragmentTransaction;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R; import com.android.settings.R;
import com.android.settings.testutils.shadow.ShadowInteractionJankMonitor;
import com.android.settingslib.core.AbstractPreferenceController; import com.android.settingslib.core.AbstractPreferenceController;
import org.junit.Before; import org.junit.Before;
@@ -43,8 +44,10 @@ import org.mockito.MockitoAnnotations;
import org.robolectric.Robolectric; import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner; import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment; import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
@RunWith(RobolectricTestRunner.class) @RunWith(RobolectricTestRunner.class)
@Config(shadows = ShadowInteractionJankMonitor.class)
public class SavedAccessPointsWifiSettings2Test { public class SavedAccessPointsWifiSettings2Test {
@Mock @Mock

View File

@@ -31,6 +31,8 @@ import android.os.storage.VolumeRecord;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import androidx.test.runner.AndroidJUnit4; import androidx.test.runner.AndroidJUnit4;
import com.android.settings.testutils.ResourcesUtils;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@@ -246,6 +248,17 @@ public class StorageEntryTest {
assertThat(recordStorage.getDescription()).isEqualTo(description); assertThat(recordStorage.getDescription()).isEqualTo(description);
} }
@Test
public void getDescription_defaultInternalStorage_returnThisDevice() {
final VolumeInfo volumeInfo = mock(VolumeInfo.class);
when(volumeInfo.getType()).thenReturn(VolumeInfo.TYPE_PRIVATE);
when(volumeInfo.getId()).thenReturn(VolumeInfo.ID_PRIVATE_INTERNAL);
final StorageEntry volumeStorage = new StorageEntry(mContext, volumeInfo);
assertThat(volumeStorage.getDescription()).isEqualTo(
ResourcesUtils.getResourcesString(mContext, "storage_default_internal_storage"));
}
@Test @Test
public void getDiskId_shouldReturnDiskId() { public void getDiskId_shouldReturnDiskId() {
final VolumeInfo volumeInfo = mock(VolumeInfo.class); final VolumeInfo volumeInfo = mock(VolumeInfo.class);

View File

@@ -63,10 +63,9 @@ public class InternetConnectivityPanelTest {
ApplicationProvider.getApplicationContext(), "airplane_mode"); ApplicationProvider.getApplicationContext(), "airplane_mode");
public static final String SUBTITLE_WIFI_IS_TURNED_ON = ResourcesUtils.getResourcesString( public static final String SUBTITLE_WIFI_IS_TURNED_ON = ResourcesUtils.getResourcesString(
ApplicationProvider.getApplicationContext(), "wifi_is_turned_on_subtitle"); ApplicationProvider.getApplicationContext(), "wifi_is_turned_on_subtitle");
public static final String SUBTITLE_TEXT_SELECT_NETWORK_TO_CONNECT_INTERNET = public static final String SUBTITLE_TEXT_TAP_A_NETWORK_TO_CONNECT =
ResourcesUtils.getResourcesString( ResourcesUtils.getResourcesString(ApplicationProvider.getApplicationContext(),
ApplicationProvider.getApplicationContext(), "tap_a_network_to_connect");
"select_network_to_connect_internet");
public static final String BUTTON_SETTINGS = ResourcesUtils.getResourcesString( public static final String BUTTON_SETTINGS = ResourcesUtils.getResourcesString(
ApplicationProvider.getApplicationContext(), "settings_button"); ApplicationProvider.getApplicationContext(), "settings_button");
public static final String SUBTITLE_NON_CARRIER_NETWORK_UNAVAILABLE = public static final String SUBTITLE_NON_CARRIER_NETWORK_UNAVAILABLE =
@@ -179,7 +178,7 @@ public class InternetConnectivityPanelTest {
} }
@Test @Test
public void getSubTitle_apmOffWifiOnTwoWifiItemsNoCarrierData_selectNetworkToConnectInternet() { public void getSubTitle_apmOffWifiOnTwoWifiItemsNoCarrierData_tapANetworkToConnect() {
List wifiList = new ArrayList<ScanResult>(); List wifiList = new ArrayList<ScanResult>();
wifiList.add(new ScanResult()); wifiList.add(new ScanResult());
wifiList.add(new ScanResult()); wifiList.add(new ScanResult());
@@ -187,8 +186,7 @@ public class InternetConnectivityPanelTest {
mPanel.updatePanelTitle(); mPanel.updatePanelTitle();
assertThat(mPanel.getSubTitle()) assertThat(mPanel.getSubTitle()).isEqualTo(SUBTITLE_TEXT_TAP_A_NETWORK_TO_CONNECT);
.isEqualTo(SUBTITLE_TEXT_SELECT_NETWORK_TO_CONNECT_INTERNET);
} }
@Test @Test