Snap for 12770256 from 97072e434d to 25Q1-release

Change-Id: I5184d43061e5be0a619ada5d3973b5014f98912d
This commit is contained in:
Android Build Coastguard Worker
2024-12-10 00:46:49 +00:00
94 changed files with 874 additions and 369 deletions

View File

@@ -89,6 +89,12 @@
<string name="security_settings_face_enroll_introduction_message_class3" product="tablet">Use your face to unlock your tablet or for authentication in apps, like when you sign in to apps or approve a purchase</string> <string name="security_settings_face_enroll_introduction_message_class3" product="tablet">Use your face to unlock your tablet or for authentication in apps, like when you sign in to apps or approve a purchase</string>
<!-- Subtitle shown on the face enrollment introduction screen with in-app authentication. [CHAR LIMIT=NONE] --> <!-- Subtitle shown on the face enrollment introduction screen with in-app authentication. [CHAR LIMIT=NONE] -->
<string name="security_settings_face_enroll_introduction_message_class3" product="device">Use your face to unlock your device or for authentication in apps, like when you sign in to apps or approve a purchase</string> <string name="security_settings_face_enroll_introduction_message_class3" product="device">Use your face to unlock your device or for authentication in apps, like when you sign in to apps or approve a purchase</string>
<!-- Subtitle shown on the face enrollment introduction screen with in-app authentication. [CHAR LIMIT=NONE] -->
<string name="security_settings_face_enroll_introduction_message_class3_2" product="default"></string>
<!-- Subtitle shown on the face enrollment introduction screen with in-app authentication. [CHAR LIMIT=NONE] -->
<string name="security_settings_face_enroll_introduction_message_class3_2" product="tablet"></string>
<!-- Subtitle shown on the face enrollment introduction screen with in-app authentication. [CHAR LIMIT=NONE] -->
<string name="security_settings_face_enroll_introduction_message_class3_2" product="device"></string>
<!-- Introduction detail message shown in face enrollment dialog when asking for parental consent [CHAR LIMIT=NONE]--> <!-- Introduction detail message shown in face enrollment dialog when asking for parental consent [CHAR LIMIT=NONE]-->
<string name="security_settings_face_enroll_introduction_consent_message_0" product="default">Allow your child to use their face to unlock their phone</string> <string name="security_settings_face_enroll_introduction_consent_message_0" product="default">Allow your child to use their face to unlock their phone</string>
<!-- Introduction detail message shown in face enrollment dialog when asking for parental consent [CHAR LIMIT=NONE]--> <!-- Introduction detail message shown in face enrollment dialog when asking for parental consent [CHAR LIMIT=NONE]-->
@@ -107,6 +113,18 @@
<string name="security_settings_face_enroll_introduction_consent_message" product="tablet">Using your child\u2019s face to unlock their tablet may be less secure than a strong pattern or PIN.</string> <string name="security_settings_face_enroll_introduction_consent_message" product="tablet">Using your child\u2019s face to unlock their tablet may be less secure than a strong pattern or PIN.</string>
<!-- Introduction detail message shown in face enrollment dialog when asking for parental consent [CHAR LIMIT=NONE]--> <!-- Introduction detail message shown in face enrollment dialog when asking for parental consent [CHAR LIMIT=NONE]-->
<string name="security_settings_face_enroll_introduction_consent_message" product="device">Using your child\u2019s face to unlock their device may be less secure than a strong pattern or PIN.</string> <string name="security_settings_face_enroll_introduction_consent_message" product="device">Using your child\u2019s face to unlock their device may be less secure than a strong pattern or PIN.</string>
<!-- Message shown in Secure and helpful section in face enrollment introduction page. [CHAR LIMIT=NONE] -->
<string name="security_settings_face_enroll_introduction_secure_and_helpful_message_1" product="default"></string>
<!-- Message shown in Secure and helpful section in face enrollment introduction page. [CHAR LIMIT=NONE] -->
<string name="security_settings_face_enroll_introduction_secure_and_helpful_message_1" product="tablet"></string>
<!-- Message shown in Secure and helpful section in face enrollment introduction page. [CHAR LIMIT=NONE] -->
<string name="security_settings_face_enroll_introduction_secure_and_helpful_message_1" product="device"></string>
<!-- Message shown in Secure and helpful section in face enrollment introduction page. [CHAR LIMIT=NONE] -->
<string name="security_settings_face_enroll_introduction_secure_and_helpful_message_2" product="default"></string>
<!-- Message shown in Secure and helpful section in face enrollment introduction page. [CHAR LIMIT=NONE] -->
<string name="security_settings_face_enroll_introduction_secure_and_helpful_message_2" product="tablet"></string>
<!-- Message shown in Secure and helpful section in face enrollment introduction page. [CHAR LIMIT=NONE] -->
<string name="security_settings_face_enroll_introduction_secure_and_helpful_message_2" product="device"></string>
<!-- Message on the face enrollment introduction page that provides information about what could cause the phone to unlock. [CHAR LIMIT=NONE] --> <!-- Message on the face enrollment introduction page that provides information about what could cause the phone to unlock. [CHAR LIMIT=NONE] -->
<string name="security_settings_face_enroll_introduction_info_looking" product="default"></string> <string name="security_settings_face_enroll_introduction_info_looking" product="default"></string>
<!-- Message on the face enrollment introduction page that provides information about what could cause the phone to unlock. [CHAR LIMIT=NONE] --> <!-- Message on the face enrollment introduction page that provides information about what could cause the phone to unlock. [CHAR LIMIT=NONE] -->
@@ -161,6 +179,12 @@
<string name="security_settings_face_enroll_introduction_control_message" product="tablet"></string> <string name="security_settings_face_enroll_introduction_control_message" product="tablet"></string>
<!-- Message on the face enrollment introduction page that explains privacy controls for face unlock [CHAR LIMIT=NONE] --> <!-- Message on the face enrollment introduction page that explains privacy controls for face unlock [CHAR LIMIT=NONE] -->
<string name="security_settings_face_enroll_introduction_control_message" product="device"></string> <string name="security_settings_face_enroll_introduction_control_message" product="device"></string>
<!-- Message on the face enrollment introduction page that explains privacy controls for face unlock [CHAR LIMIT=NONE] -->
<string name="security_settings_face_enroll_introduction_control_message_2" product="default"></string>
<!-- Message on the face enrollment introduction page that explains privacy controls for face unlock [CHAR LIMIT=NONE] -->
<string name="security_settings_face_enroll_introduction_control_message_2" product="tablet"></string>
<!-- Message on the face enrollment introduction page that explains privacy controls for face unlock [CHAR LIMIT=NONE] -->
<string name="security_settings_face_enroll_introduction_control_message_2" product="device"></string>
<!-- Message on the face enrollment introduction page that explains privacy controls for face unlock when asking for parental consent. [CHAR LIMIT=NONE] --> <!-- Message on the face enrollment introduction page that explains privacy controls for face unlock when asking for parental consent. [CHAR LIMIT=NONE] -->
<string name="security_settings_face_enroll_introduction_control_consent_message" product="default"></string> <string name="security_settings_face_enroll_introduction_control_consent_message" product="default"></string>
<!-- Message on the face enrollment introduction page that explains privacy controls for face unlock when asking for parental consent. [CHAR LIMIT=NONE] --> <!-- Message on the face enrollment introduction page that explains privacy controls for face unlock when asking for parental consent. [CHAR LIMIT=NONE] -->
@@ -193,6 +217,8 @@
<string name="security_settings_face_settings_footer_class3_attention_not_supported" product="device">Use your face to unlock your device or verify it\u2019s you, like when you sign in to apps 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 device can unlock it when you don\u2019t intend to.\n\nYour device can be unlocked by someone else if it\u2019s held up to your face, even if your eyes are closed.\n\nYour device can be unlocked by someone who looks a lot like you, like an identical sibling.</string> <string name="security_settings_face_settings_footer_class3_attention_not_supported" product="device">Use your face to unlock your device or verify it\u2019s you, like when you sign in to apps 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 device can unlock it when you don\u2019t intend to.\n\nYour device can be unlocked by someone else if it\u2019s held up to your face, even if your eyes are closed.\n\nYour device can be unlocked by someone who looks a lot like you, like an identical sibling.</string>
<!-- Introduction detail message shown in fingerprint enrollment dialog [CHAR LIMIT=NONE]--> <!-- Introduction detail message shown in fingerprint enrollment dialog [CHAR LIMIT=NONE]-->
<string name="security_settings_fingerprint_enroll_introduction_v3_message">Use your fingerprint to unlock your <xliff:g id="deviceName" example="Pixel">%s</xliff:g> or verify it\u2019s you, like when you sign in to apps or approve a purchase</string> <string name="security_settings_fingerprint_enroll_introduction_v3_message">Use your fingerprint to unlock your <xliff:g id="deviceName" example="Pixel">%s</xliff:g> or verify it\u2019s you, like when you sign in to apps or approve a purchase</string>
<!-- Introduction detail message shown in fingerprint enrollment dialog [CHAR LIMIT=NONE]-->
<string name="security_settings_fingerprint_enroll_introduction_v3_message_2">Use your fingerprints to unlock your <xliff:g id="deviceName" example="Pixel">%s</xliff:g> or verify it\u2019s you in apps</string>
<!-- Introduction detail message shown in fingerprint enrollment dialog when asking for parental consent [CHAR LIMIT=NONE]--> <!-- Introduction detail message shown in fingerprint enrollment dialog when asking for parental consent [CHAR LIMIT=NONE]-->
<string name="security_settings_fingerprint_enroll_introduction_consent_message" product="default">Allow your child to use their fingerprint to unlock their phone or verify it\u2019s them. This happens when they sign in to apps, approve a purchase, and more.</string> <string name="security_settings_fingerprint_enroll_introduction_consent_message" product="default">Allow your child to use their fingerprint to unlock their phone or verify it\u2019s them. This happens when they sign in to apps, approve a purchase, and more.</string>
<!-- Introduction detail message shown in fingerprint enrollment dialog when asking for parental consent [CHAR LIMIT=NONE]--> <!-- Introduction detail message shown in fingerprint enrollment dialog when asking for parental consent [CHAR LIMIT=NONE]-->
@@ -241,6 +267,18 @@
<string name="security_settings_fingerprint_v2_enroll_introduction_footer_message_consent_5" product="tablet">Your child\u2019s tablet can be unlocked when they don\u2019t intend to, like if someone holds it up to their finger.</string> <string name="security_settings_fingerprint_v2_enroll_introduction_footer_message_consent_5" product="tablet">Your child\u2019s tablet can be unlocked when they don\u2019t intend to, like if someone holds it up to their finger.</string>
<!-- Introduction description message shown in fingerprint enrollment introduction screen in setup wizard when asking for parental consent. [CHAR LIMIT=NONE] --> <!-- Introduction description message shown in fingerprint enrollment introduction screen in setup wizard when asking for parental consent. [CHAR LIMIT=NONE] -->
<string name="security_settings_fingerprint_v2_enroll_introduction_footer_message_consent_5" product="device">Your child\u2019s device can be unlocked when they don\u2019t intend to, like if someone holds it up to their finger.</string> <string name="security_settings_fingerprint_v2_enroll_introduction_footer_message_consent_5" product="device">Your child\u2019s device can be unlocked when they don\u2019t intend to, like if someone holds it up to their finger.</string>
<!-- Introduction description message shown in fingerprint enrollment introduction screen in setup wizard. [CHAR LIMIT=NONE] -->
<string name="security_settings_fingerprint_v2_enroll_introduction_footer_message_7" product="default"></string>
<!-- Introduction description message shown in fingerprint enrollment introduction screen in setup wizard. [CHAR LIMIT=NONE] -->
<string name="security_settings_fingerprint_v2_enroll_introduction_footer_message_7" product="tablet"></string>
<!-- Introduction description message shown in fingerprint enrollment introduction screen in setup wizard. [CHAR LIMIT=NONE] -->
<string name="security_settings_fingerprint_v2_enroll_introduction_footer_message_7" product="device"></string>
<!-- Introduction description message shown in fingerprint enrollment introduction screen in setup wizard. [CHAR LIMIT=NONE] -->
<string name="security_settings_fingerprint_v2_enroll_introduction_footer_message_8" product="default"></string>
<!-- Introduction description message shown in fingerprint enrollment introduction screen in setup wizard. [CHAR LIMIT=NONE] -->
<string name="security_settings_fingerprint_v2_enroll_introduction_footer_message_8" product="tablet"></string>
<!-- Introduction description message shown in fingerprint enrollment introduction screen in setup wizard. [CHAR LIMIT=NONE] -->
<string name="security_settings_fingerprint_v2_enroll_introduction_footer_message_8" product="device"></string>
<!-- Message text only shown in fingerprint security settings home screen. (tablet) [CHAR LIMIT=NONE]--> <!-- Message text only shown in fingerprint security settings home screen. (tablet) [CHAR LIMIT=NONE]-->
<string name="security_settings_fingerprint_v2_home_screen_text" product="tablet">Use your fingerprint to unlock your tablet or verify it\u2019s you, like when you sign in to apps</string> <string name="security_settings_fingerprint_v2_home_screen_text" product="tablet">Use your fingerprint to unlock your tablet or verify it\u2019s you, like when you sign in to apps</string>
<!-- Message text only shown in fingerprint security settings home screen. (device) [CHAR LIMIT=NONE]--> <!-- Message text only shown in fingerprint security settings home screen. (device) [CHAR LIMIT=NONE]-->

View File

@@ -17,6 +17,6 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android" <selector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"> xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
<item android:state_selected="true" android:color="?androidprv:attr/materialColorPrimaryContainer"/> <item android:state_selected="true" android:color="@androidprv:color/materialColorPrimaryContainer"/>
<item android:color="?androidprv:attr/materialColorSurfaceBright"/> <item android:color="@androidprv:color/materialColorSurfaceBright"/>
</selector> </selector>

View File

@@ -17,6 +17,6 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android" <selector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"> xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
<item android:state_selected="true" android:color="?androidprv:attr/materialColorOnPrimaryContainer"/> <item android:state_selected="true" android:color="@androidprv:color/materialColorOnPrimaryContainer"/>
<item android:color="?androidprv:attr/materialColorPrimary"/> <item android:color="@androidprv:color/materialColorPrimary"/>
</selector> </selector>

View File

@@ -17,6 +17,6 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android" <selector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"> xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
<item android:state_selected="true" android:color="?androidprv:attr/materialColorOnPrimaryContainer"/> <item android:state_selected="true" android:color="@androidprv:color/materialColorOnPrimaryContainer"/>
<item android:color="?androidprv:attr/materialColorOnSurfaceVariant"/> <item android:color="@androidprv:color/materialColorOnSurfaceVariant"/>
</selector> </selector>

View File

@@ -17,6 +17,6 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android" <selector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"> xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
<item android:state_selected="true" android:color="?androidprv:attr/materialColorOnPrimaryContainer"/> <item android:state_selected="true" android:color="@androidprv:color/materialColorOnPrimaryContainer"/>
<item android:color="?androidprv:attr/materialColorOnSurface"/> <item android:color="@androidprv:color/materialColorOnSurface"/>
</selector> </selector>

View File

@@ -19,7 +19,7 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"> xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
<item android:state_pressed="true" android:color="?androidprv:attr/materialColorPrimary" /> <item android:state_pressed="true" android:color="@androidprv:color/materialColorPrimary" />
<item android:state_selected="true" android:color="?androidprv:attr/materialColorPrimary" /> <item android:state_selected="true" android:color="@androidprv:color/materialColorPrimary" />
<item android:color="?androidprv:attr/materialColorSecondaryContainer" /> <item android:color="@androidprv:color/materialColorSecondaryContainer" />
</selector> </selector>

View File

@@ -19,7 +19,7 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"> xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
<item android:state_pressed="true" android:color="?androidprv:attr/materialColorOnPrimary" /> <item android:state_pressed="true" android:color="@androidprv:color/materialColorOnPrimary" />
<item android:state_selected="true" android:color="?androidprv:attr/materialColorOnPrimary" /> <item android:state_selected="true" android:color="@androidprv:color/materialColorOnPrimary" />
<item android:color="?androidprv:attr/materialColorOnSecondaryContainer" /> <item android:color="@androidprv:color/materialColorOnSecondaryContainer" />
</selector> </selector>

View File

@@ -22,9 +22,9 @@
<layer-list> <layer-list>
<item> <item>
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="?androidprv:attr/materialColorSurfaceContainerHighest" /> <solid android:color="@androidprv:color/materialColorSurfaceContainerHighest" />
<stroke <stroke
android:color="?androidprv:attr/materialColorSecondary" android:color="@androidprv:color/materialColorSecondary"
android:width="@dimen/contrast_button_stroke_width" /> android:width="@dimen/contrast_button_stroke_width" />
<corners android:radius="@dimen/contrast_button_radius"/> <corners android:radius="@dimen/contrast_button_radius"/>
</shape> </shape>
@@ -41,7 +41,7 @@
android:viewportHeight="24" android:viewportHeight="24"
android:tint="?attr/colorControlNormal"> android:tint="?attr/colorControlNormal">
<path <path
android:fillColor="?androidprv:attr/materialColorPrimary" android:fillColor="@androidprv:color/materialColorPrimary"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10c5.52,0 10,-4.48 10,-10S17.52,2 12,2zM10.59,16.6l-4.24,-4.24l1.41,-1.41l2.83,2.83l5.66,-5.66l1.41,1.41L10.59,16.6z"/> android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10c5.52,0 10,-4.48 10,-10S17.52,2 12,2zM10.59,16.6l-4.24,-4.24l1.41,-1.41l2.83,2.83l5.66,-5.66l1.41,1.41L10.59,16.6z"/>
</vector> </vector>
</item> </item>
@@ -55,7 +55,7 @@
android:left="@dimen/contrast_button_stroke_width" android:left="@dimen/contrast_button_stroke_width"
android:right="@dimen/contrast_button_stroke_width"> android:right="@dimen/contrast_button_stroke_width">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="?androidprv:attr/materialColorSurfaceContainerHighest" /> <solid android:color="@androidprv:color/materialColorSurfaceContainerHighest" />
<corners android:radius="@dimen/contrast_button_radius"/> <corners android:radius="@dimen/contrast_button_radius"/>
</shape> </shape>
</item> </item>

View File

@@ -29,7 +29,7 @@
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="24dp"/> <corners android:radius="24dp"/>
<solid android:color="@android:color/transparent"/> <solid android:color="@android:color/transparent"/>
<stroke android:color="?androidprv:attr/materialColorPrimaryContainer" <stroke android:color="@androidprv:color/materialColorPrimaryContainer"
android:width="1dp" android:width="1dp"
/> />
<padding android:left="16dp" <padding android:left="16dp"

View File

@@ -17,6 +17,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:shape="rectangle" > android:shape="rectangle" >
<solid android:color="?androidprv:attr/materialColorSurfaceContainerHigh"/> <solid android:color="@androidprv:color/materialColorSurfaceContainerHigh"/>
<corners android:radius="20dp" /> <corners android:radius="20dp" />
</shape> </shape>

View File

@@ -17,7 +17,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:shape="rectangle" > android:shape="rectangle" >
<solid android:color="?androidprv:attr/materialColorSurfaceContainer"/> <solid android:color="@androidprv:color/materialColorSurfaceContainer"/>
<corners <corners
android:bottomLeftRadius="20dp" android:bottomLeftRadius="20dp"
android:bottomRightRadius="20dp" android:bottomRightRadius="20dp"

View File

@@ -17,6 +17,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:shape="rectangle" > android:shape="rectangle" >
<solid android:color="?androidprv:attr/materialColorTertiaryContainer"/> <solid android:color="@androidprv:color/materialColorTertiaryContainer"/>
<corners android:radius="7dp" /> <corners android:radius="7dp" />
</shape> </shape>

View File

@@ -17,6 +17,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:shape="rectangle" > android:shape="rectangle" >
<solid android:color="?androidprv:attr/materialColorSurfaceContainerLow"/> <solid android:color="@androidprv:color/materialColorSurfaceContainerLow"/>
<corners android:radius="12dp" /> <corners android:radius="12dp" />
</shape> </shape>

View File

@@ -17,6 +17,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:shape="rectangle" > android:shape="rectangle" >
<solid android:color="?androidprv:attr/materialColorPrimaryContainer"/> <solid android:color="@androidprv:color/materialColorPrimaryContainer"/>
<corners android:radius="24dp" /> <corners android:radius="24dp" />
</shape> </shape>

View File

@@ -17,6 +17,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:shape="oval" > android:shape="oval" >
<solid android:color="?androidprv:attr/materialColorSurfaceContainerHighest"/> <solid android:color="@androidprv:color/materialColorSurfaceContainerHighest"/>
<size android:width="36dp" android:height="36dp" /> <size android:width="36dp" android:height="36dp" />
</shape> </shape>

View File

@@ -17,7 +17,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:shape="rectangle" > android:shape="rectangle" >
<solid android:color="?androidprv:attr/materialColorSecondaryContainer"/> <solid android:color="@androidprv:color/materialColorSecondaryContainer"/>
<corners android:radius="20dp" /> <corners android:radius="20dp" />
<size android:height="30dp" android:width="60dp" /> <size android:height="30dp" android:width="60dp" />
</shape> </shape>

View File

@@ -17,6 +17,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:shape="oval" > android:shape="oval" >
<solid android:color="?androidprv:attr/materialColorPrimary"/> <solid android:color="@androidprv:color/materialColorPrimary"/>
<size android:width="36dp" android:height="36dp" /> <size android:width="36dp" android:height="36dp" />
</shape> </shape>

View File

@@ -17,6 +17,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:shape="rectangle" > android:shape="rectangle" >
<solid android:color="?androidprv:attr/materialColorSurfaceContainerHighest"/> <solid android:color="@androidprv:color/materialColorSurfaceContainerHighest"/>
<corners android:radius="4dp" /> <corners android:radius="4dp" />
</shape> </shape>

View File

@@ -20,6 +20,6 @@
android:height="24dp" android:height="24dp"
android:viewportWidth="24" android:viewportWidth="24"
android:viewportHeight="24"> android:viewportHeight="24">
<path android:fillColor="?androidprv:attr/materialColorOnSurfaceVariant" <path android:fillColor="@androidprv:color/materialColorOnSurfaceVariant"
android:pathData="M3,19Q2.175,19 1.588,18.413Q1,17.825 1,17V7Q1,6.175 1.588,5.588Q2.175,5 3,5H13Q13.825,5 14.413,5.588Q15,6.175 15,7V17Q15,17.825 14.413,18.413Q13.825,19 13,19ZM3,17H13Q13,17 13,17Q13,17 13,17V7Q13,7 13,7Q13,7 13,7H3Q3,7 3,7Q3,7 3,7V17Q3,17 3,17Q3,17 3,17ZM17,19V5H19V19ZM21,19V5H23V19ZM4,15H12L9.4,11.5L7.5,14L6.1,12.15ZM3,7Q3,7 3,7Q3,7 3,7V17Q3,17 3,17Q3,17 3,17Q3,17 3,17Q3,17 3,17V7Q3,7 3,7Q3,7 3,7Z"/> android:pathData="M3,19Q2.175,19 1.588,18.413Q1,17.825 1,17V7Q1,6.175 1.588,5.588Q2.175,5 3,5H13Q13.825,5 14.413,5.588Q15,6.175 15,7V17Q15,17.825 14.413,18.413Q13.825,19 13,19ZM3,17H13Q13,17 13,17Q13,17 13,17V7Q13,7 13,7Q13,7 13,7H3Q3,7 3,7Q3,7 3,7V17Q3,17 3,17Q3,17 3,17ZM17,19V5H19V19ZM21,19V5H23V19ZM4,15H12L9.4,11.5L7.5,14L6.1,12.15ZM3,7Q3,7 3,7Q3,7 3,7V17Q3,17 3,17Q3,17 3,17Q3,17 3,17Q3,17 3,17V7Q3,7 3,7Q3,7 3,7Z"/>
</vector> </vector>

View File

@@ -17,6 +17,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:shape="rectangle"> android:shape="rectangle">
<solid android:color="?androidprv:attr/materialColorSurfaceContainer" /> <solid android:color="@androidprv:color/materialColorSurfaceContainer" />
<corners android:radius="@dimen/dream_item_corner_radius"/> <corners android:radius="@dimen/dream_item_corner_radius"/>
</shape> </shape>

View File

@@ -22,6 +22,6 @@
android:tint="?attr/colorControlNormal" android:tint="?attr/colorControlNormal"
android:autoMirrored="true"> android:autoMirrored="true">
<path <path
android:fillColor="?androidprv:attr/materialColorOnSurfaceVariant" android:fillColor="@androidprv:color/materialColorOnSurfaceVariant"
android:pathData="M19,5v14L5,19L5,5h14m0,-2L5,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM14,17L7,17v-2h7v2zM17,13L7,13v-2h10v2zM17,9L7,9L7,7h10v2z"/> android:pathData="M19,5v14L5,19L5,5h14m0,-2L5,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM14,17L7,17v-2h7v2zM17,13L7,13v-2h10v2zM17,9L7,9L7,7h10v2z"/>
</vector> </vector>

View File

@@ -21,6 +21,6 @@
android:viewportHeight="24" android:viewportHeight="24"
android:tint="?attr/colorControlNormal"> android:tint="?attr/colorControlNormal">
<path <path
android:fillColor="?androidprv:attr/materialColorOnTertiaryContainer" android:fillColor="@androidprv:color/materialColorOnTertiaryContainer"
android:pathData="M19,3H5C3.9,3 3,3.9 3,5v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2V5C21,3.9 20.1,3 19,3zM14,17H7v-2h7V17zM17,13H7v-2h10V13zM17,9H7V7h10V9z"/> android:pathData="M19,3H5C3.9,3 3,3.9 3,5v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2V5C21,3.9 20.1,3 19,3zM14,17H7v-2h7V17zM17,13H7v-2h10V13zM17,9H7V7h10V9z"/>
</vector> </vector>

View File

@@ -21,6 +21,6 @@
android:viewportHeight="24" android:viewportHeight="24"
android:tint="?attr/colorControlNormal"> android:tint="?attr/colorControlNormal">
<path <path
android:fillColor="?androidprv:attr/materialColorOnSurfaceVariant" android:fillColor="@androidprv:color/materialColorOnSurfaceVariant"
android:pathData="M20,2L4,2c-1.1,0 -2,0.9 -2,2v18l4,-4h14c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM20,16L4,16L4,4h16v12z"/> android:pathData="M20,2L4,2c-1.1,0 -2,0.9 -2,2v18l4,-4h14c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM20,16L4,16L4,4h16v12z"/>
</vector> </vector>

View File

@@ -21,6 +21,6 @@
android:viewportHeight="24" android:viewportHeight="24"
android:tint="?attr/colorControlNormal"> android:tint="?attr/colorControlNormal">
<path <path
android:fillColor="?androidprv:attr/materialColorOnPrimaryContainer" android:fillColor="@androidprv:color/materialColorOnPrimaryContainer"
android:pathData="M20.41,4.94l-1.35,-1.35c-0.78,-0.78 -2.05,-0.78 -2.83,0L3,16.82L3,21h4.18L20.41,7.77c0.79,-0.78 0.79,-2.05 0,-2.83zM6.41,19.06L5,19v-1.36l9.82,-9.82 1.41,1.41 -9.82,9.83z"/> android:pathData="M20.41,4.94l-1.35,-1.35c-0.78,-0.78 -2.05,-0.78 -2.83,0L3,16.82L3,21h4.18L20.41,7.77c0.79,-0.78 0.79,-2.05 0,-2.83zM6.41,19.06L5,19v-1.36l9.82,-9.82 1.41,1.41 -9.82,9.83z"/>
</vector> </vector>

View File

@@ -0,0 +1,26 @@
<!--
~ Copyright (C) 2024 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M274,600Q305,600 329.5,582Q354,564 364,535L379,489Q395,441 371,400.5Q347,360 302,360L161,360L180,517Q185,552 211.5,576Q238,600 274,600ZM686,600Q722,600 748.5,576Q775,552 780,517L799,360L659,360Q614,360 590,401Q566,442 582,490L596,535Q606,564 630.5,582Q655,600 686,600ZM274,680Q208,680 158.5,636.5Q109,593 101,527L80,360L40,360L40,280L302,280Q346,280 382.5,301.5Q419,323 440,360L521,360Q542,323 578.5,301.5Q615,280 659,280L920,280L920,360L880,360L859,527Q851,593 801.5,636.5Q752,680 686,680Q629,680 583.5,647.5Q538,615 520,561L505,516Q503,509 501,501.5Q499,494 497,480L463,480Q461,492 459,499.5Q457,507 455,514L440,560Q422,614 376.5,647Q331,680 274,680Z"/>
</vector>

View File

@@ -0,0 +1,26 @@
<!--
~ Copyright (C) 2024 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M480,800Q346,800 253,707Q160,614 160,480Q160,346 253,253Q346,160 480,160Q614,160 707,253Q800,346 800,480Q800,614 707,707Q614,800 480,800ZM480,720Q580,720 650,650Q720,580 720,480Q720,463 717.5,446.5Q715,430 710,414Q695,417 680,418.5Q665,420 650,420Q587,420 530,396Q473,372 428,326Q400,383 351,425Q302,467 240,486Q243,584 312.5,652Q382,720 480,720ZM256,394Q300,371 323,340.5Q346,310 368,268Q330,288 301,320.5Q272,353 256,394ZM380,560Q363,560 351.5,548.5Q340,537 340,520Q340,503 351.5,491.5Q363,480 380,480Q397,480 408.5,491.5Q420,503 420,520Q420,537 408.5,548.5Q397,560 380,560ZM650,340Q656,340 662,340Q668,340 674,339Q641,294 590.5,267Q540,240 480,240Q474,240 468,240Q462,240 457,241Q496,286 539.5,313Q583,340 650,340ZM580,560Q563,560 551.5,548.5Q540,537 540,520Q540,503 551.5,491.5Q563,480 580,480Q597,480 608.5,491.5Q620,503 620,520Q620,537 608.5,548.5Q597,560 580,560ZM40,240L40,120Q40,87 63.5,63.5Q87,40 120,40L240,40L240,120L120,120Q120,120 120,120Q120,120 120,120L120,240L40,240ZM240,920L120,920Q87,920 63.5,896.5Q40,873 40,840L40,720L120,720L120,840Q120,840 120,840Q120,840 120,840L240,840L240,920ZM720,920L720,840L840,840Q840,840 840,840Q840,840 840,840L840,720L920,720L920,840Q920,873 896.5,896.5Q873,920 840,920L720,920ZM840,240L840,120Q840,120 840,120Q840,120 840,120L720,120L720,40L840,40Q873,40 896.5,63.5Q920,87 920,120L920,240L840,240ZM457,241Q457,241 457,241Q457,241 457,241Q457,241 457,241Q457,241 457,241Q457,241 457,241Q457,241 457,241Q457,241 457,241Q457,241 457,241ZM368,268Q368,268 368,268Q368,268 368,268Q368,268 368,268Q368,268 368,268Z"/>
</vector>

View File

@@ -21,6 +21,6 @@
android:viewportHeight="24" android:viewportHeight="24"
android:tint="?attr/colorControlNormal"> android:tint="?attr/colorControlNormal">
<path <path
android:fillColor="?androidprv:attr/materialColorSecondary" android:fillColor="@androidprv:color/materialColorSecondary"
android:pathData="M15,8c0,-1.42 -0.5,-2.73 -1.33,-3.76C14.09,4.1 14.53,4 15,4c2.21,0 4,1.79 4,4s-1.79,4 -4,4c-0.43,0 -0.84,-0.09 -1.23,-0.21c-0.03,-0.01 -0.06,-0.02 -0.1,-0.03C14.5,10.73 15,9.42 15,8zM16.66,13.13C18.03,14.06 19,15.32 19,17v3h4v-3C23,14.82 19.42,13.53 16.66,13.13zM9,4c2.21,0 4,1.79 4,4s-1.79,4 -4,4s-4,-1.79 -4,-4S6.79,4 9,4zM9,13c2.67,0 8,1.34 8,4v3H1v-3C1,14.34 6.33,13 9,13z"/> android:pathData="M15,8c0,-1.42 -0.5,-2.73 -1.33,-3.76C14.09,4.1 14.53,4 15,4c2.21,0 4,1.79 4,4s-1.79,4 -4,4c-0.43,0 -0.84,-0.09 -1.23,-0.21c-0.03,-0.01 -0.06,-0.02 -0.1,-0.03C14.5,10.73 15,9.42 15,8zM16.66,13.13C18.03,14.06 19,15.32 19,17v3h4v-3C23,14.82 19.42,13.53 16.66,13.13zM9,4c2.21,0 4,1.79 4,4s-1.79,4 -4,4s-4,-1.79 -4,-4S6.79,4 9,4zM9,13c2.67,0 8,1.34 8,4v3H1v-3C1,14.34 6.33,13 9,13z"/>
</vector> </vector>

View File

@@ -21,6 +21,6 @@
android:viewportHeight="24" android:viewportHeight="24"
android:tint="?attr/colorControlNormal"> android:tint="?attr/colorControlNormal">
<path <path
android:fillColor="?androidprv:attr/materialColorOnSecondaryContainer" android:fillColor="@androidprv:color/materialColorOnSecondaryContainer"
android:pathData="M19,3H5C3.9,3 3,3.9 3,5v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2V5C21,3.9 20.1,3 19,3zM19,5v9h-4.18c-0.41,1.16 -1.51,2 -2.82,2s-2.4,-0.84 -2.82,-2H5V5H19z"/> android:pathData="M19,3H5C3.9,3 3,3.9 3,5v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2V5C21,3.9 20.1,3 19,3zM19,5v9h-4.18c-0.41,1.16 -1.51,2 -2.82,2s-2.4,-0.84 -2.82,-2H5V5H19z"/>
</vector> </vector>

View File

@@ -21,7 +21,7 @@
android:height="24.0dp" android:height="24.0dp"
android:viewportWidth="24.0" android:viewportWidth="24.0"
android:viewportHeight="24.0" android:viewportHeight="24.0"
android:tint="?androidprv:attr/materialColorPrimary"> android:tint="@androidprv:color/materialColorPrimary">
<path <path
android:fillColor="@android:color/white" android:fillColor="@android:color/white"
android:pathData="M18,4C13.58,0.69 7.31,1.58 4,6V4H2v6h6V8H5.09c1.44,-2.47 4.09,-3.98 6.94,-3.97c4.42,0.02 7.99,3.61 7.97,8.03s-3.61,7.99 -8.03,7.97C7.55,20.01 3.98,16.42 4,12H2c0,3.15 1.48,6.11 4,8c4.42,3.31 10.69,2.42 14,-2C23.31,13.58 22.42,7.31 18,4z"/> android:pathData="M18,4C13.58,0.69 7.31,1.58 4,6V4H2v6h6V8H5.09c1.44,-2.47 4.09,-3.98 6.94,-3.97c4.42,0.02 7.99,3.61 7.97,8.03s-3.61,7.99 -8.03,7.97C7.55,20.01 3.98,16.42 4,12H2c0,3.15 1.48,6.11 4,8c4.42,3.31 10.69,2.42 14,-2C23.31,13.58 22.42,7.31 18,4z"/>

View File

@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M440,680L520,680L520,440L440,440L440,680ZM480,360Q497,360 508.5,348.5Q520,337 520,320Q520,303 508.5,291.5Q497,280 480,280Q463,280 451.5,291.5Q440,303 440,320Q440,337 451.5,348.5Q463,360 480,360ZM480,880Q341,845 250.5,720.5Q160,596 160,444L160,200L480,80L800,200L800,444Q800,596 709.5,720.5Q619,845 480,880ZM480,796Q584,763 652,664Q720,565 720,444L720,255L480,165L240,255L240,444Q240,565 308,664Q376,763 480,796ZM480,480Q480,480 480,480Q480,480 480,480L480,480L480,480L480,480L480,480Q480,480 480,480Q480,480 480,480Z"/>
</vector>

View File

@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M426,608L662,376L606,320L426,496L354,426L298,482L426,608ZM480,880Q473,880 466.5,878.5Q460,877 454,874Q306,798 233,685.5Q160,573 160,412L160,248Q160,222 174.5,201Q189,180 213,172L453,86Q460,84 466.5,82Q473,80 480,80Q489,80 507,86L747,172Q771,180 785.5,200.5Q800,221 800,247L800,412Q800,573 725.5,686Q651,799 505,874Q499,877 493,878.5Q487,880 480,880ZM480,797Q601,731 660.5,638.5Q720,546 720,412L720,247Q720,247 720,247Q720,247 720,247L480,161Q480,161 480,161Q480,161 480,161L240,247Q240,247 240,247Q240,247 240,247L240,412Q240,546 299.5,639Q359,732 480,797ZM480,479Q480,479 480,479Q480,479 480,479L480,479Q480,479 480,479Q480,479 480,479L480,479Q480,479 480,479Q480,479 480,479L480,479Q480,479 480,479Q480,479 480,479L480,479Q480,479 480,479Q480,479 480,479Z"/>
</vector>

View File

@@ -21,6 +21,6 @@
android:viewportHeight="24" android:viewportHeight="24"
android:tint="?attr/colorControlNormal"> android:tint="?attr/colorControlNormal">
<path <path
android:fillColor="?androidprv:attr/materialColorOnPrimary" android:fillColor="@androidprv:color/materialColorOnPrimary"
android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21 12,17.27z"/> android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21 12,17.27z"/>
</vector> </vector>

View File

@@ -25,7 +25,7 @@
<solid android:color="@android:color/transparent"/> <solid android:color="@android:color/transparent"/>
<stroke <stroke
android:width="1dp" android:width="1dp"
android:color="?androidprv:attr/materialColorPrimary"/> android:color="@androidprv:color/materialColorPrimary"/>
</shape> </shape>
</item> </item>
</ripple> </ripple>

View File

@@ -22,7 +22,7 @@
<item> <item>
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="24dp"/> <corners android:radius="24dp"/>
<solid android:color="?androidprv:attr/materialColorPrimary"/> <solid android:color="@androidprv:color/materialColorPrimary"/>
</shape> </shape>
</item> </item>
</ripple> </ripple>

View File

@@ -22,7 +22,7 @@
<item> <item>
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="24dp"/> <corners android:radius="24dp"/>
<solid android:color="?androidprv:attr/materialColorSurfaceContainerHighest"/> <solid android:color="@androidprv:color/materialColorSurfaceContainerHighest"/>
</shape> </shape>
</item> </item>
</ripple> </ripple>

View File

@@ -18,5 +18,5 @@
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:shape="rectangle"> android:shape="rectangle">
<corners android:radius="20dp" /> <corners android:radius="20dp" />
<solid android:color="?androidprv:attr/materialColorSurfaceContainerHigh"/> <solid android:color="@androidprv:color/materialColorSurfaceContainerHigh"/>
</shape> </shape>

View File

@@ -21,5 +21,5 @@
<size <size
android:width="@dimen/zen_mode_circular_icon_diameter" android:width="@dimen/zen_mode_circular_icon_diameter"
android:height="@dimen/zen_mode_circular_icon_diameter" /> android:height="@dimen/zen_mode_circular_icon_diameter" />
<solid android:color="?androidprv:attr/materialColorSecondaryContainer" /> <solid android:color="@androidprv:color/materialColorSecondaryContainer" />
</shape> </shape>

View File

@@ -17,7 +17,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:shape="rectangle"> android:shape="rectangle">
<solid android:color="?androidprv:attr/materialColorSurfaceContainer" /> <solid android:color="@androidprv:color/materialColorSurfaceContainer" />
<corners <corners
android:bottomLeftRadius="?android:attr/dialogCornerRadius" android:bottomLeftRadius="?android:attr/dialogCornerRadius"
android:topLeftRadius="?android:attr/dialogCornerRadius" android:topLeftRadius="?android:attr/dialogCornerRadius"

View File

@@ -29,7 +29,7 @@
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="24dp"/> <corners android:radius="24dp"/>
<solid android:color="@android:color/transparent"/> <solid android:color="@android:color/transparent"/>
<stroke android:color="?androidprv:attr/materialColorPrimaryContainer" <stroke android:color="@androidprv:color/materialColorPrimaryContainer"
android:width="1dp" /> android:width="1dp" />
<padding android:left="16dp" <padding android:left="16dp"
android:top="8dp" android:top="8dp"

View File

@@ -25,7 +25,7 @@
<solid android:color="@android:color/transparent"/> <solid android:color="@android:color/transparent"/>
<stroke <stroke
android:width="1dp" android:width="1dp"
android:color="?androidprv:attr/materialColorPrimary"/> android:color="@androidprv:color/materialColorPrimary"/>
</shape> </shape>
</item> </item>
</ripple> </ripple>

View File

@@ -22,7 +22,7 @@
<item> <item>
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="24dp"/> <corners android:radius="24dp"/>
<solid android:color="?androidprv:attr/materialColorPrimary"/> <solid android:color="@androidprv:color/materialColorPrimary"/>
</shape> </shape>
</item> </item>
</ripple> </ripple>

View File

@@ -19,13 +19,13 @@
android:color="@color/settingslib_ripple_color"> android:color="@color/settingslib_ripple_color">
<item android:id="@android:id/mask"> <item android:id="@android:id/mask">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="?androidprv:attr/materialColorSurfaceContainer"/> <solid android:color="@androidprv:color/materialColorSurfaceContainer"/>
<corners android:radius="20dp"/> <corners android:radius="20dp"/>
</shape> </shape>
</item> </item>
<item android:id="@android:id/background"> <item android:id="@android:id/background">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<stroke android:color="?androidprv:attr/materialColorPrimaryContainer" android:width="1dp"/> <stroke android:color="@androidprv:color/materialColorPrimaryContainer" android:width="1dp"/>
<corners android:radius="20dp"/> <corners android:radius="20dp"/>
</shape> </shape>
</item> </item>

View File

@@ -21,7 +21,7 @@
<shape <shape
android:shape="rectangle"> android:shape="rectangle">
<stroke <stroke
android:color="?androidprv:attr/materialColorPrimaryContainer" android:color="@androidprv:color/materialColorPrimaryContainer"
android:width="1dp"/> android:width="1dp"/>
<corners android:radius="24dp"/> <corners android:radius="24dp"/>
<padding <padding

View File

@@ -31,7 +31,7 @@
android:id="@+id/preview_background" android:id="@+id/preview_background"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:background="?androidprv:attr/materialColorSurface" android:background="@androidprv:color/materialColorSurface"
app:layout_constraintBottom_toTopOf="@+id/bottom_appbar_background" app:layout_constraintBottom_toTopOf="@+id/bottom_appbar_background"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@@ -96,7 +96,7 @@
android:maxLines="1" android:maxLines="1"
android:paddingEnd="10dp" android:paddingEnd="10dp"
android:text="@string/color_contrast_preview_sender_name" android:text="@string/color_contrast_preview_sender_name"
android:textColor="?androidprv:attr/materialColorOnSurface" android:textColor="@androidprv:color/materialColorOnSurface"
android:textSize="12sp" android:textSize="12sp"
app:layout_constraintEnd_toStartOf="@+id/email_tag" app:layout_constraintEnd_toStartOf="@+id/email_tag"
app:layout_constraintHorizontal_bias="0" app:layout_constraintHorizontal_bias="0"
@@ -116,7 +116,7 @@
android:maxLines="1" android:maxLines="1"
android:paddingHorizontal="4dp" android:paddingHorizontal="4dp"
android:text="@string/color_contrast_preview_email_badge" android:text="@string/color_contrast_preview_email_badge"
android:textColor="?androidprv:attr/materialColorOnSurface" android:textColor="@androidprv:color/materialColorOnSurface"
android:textSize="11sp" android:textSize="11sp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/sender_name" app:layout_constraintStart_toEndOf="@+id/sender_name"
@@ -134,7 +134,7 @@
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:text="@string/color_contrast_preview_email_send_date" android:text="@string/color_contrast_preview_email_send_date"
android:textColor="?androidprv:attr/materialColorOnSurfaceVariant" android:textColor="@androidprv:color/materialColorOnSurfaceVariant"
android:textSize="11sp" android:textSize="11sp"
app:layout_constrainedWidth="true" app:layout_constrainedWidth="true"
app:layout_constraintEnd_toEndOf="@+id/email_background" app:layout_constraintEnd_toEndOf="@+id/email_background"
@@ -173,7 +173,7 @@
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:text="@string/color_contrast_preview_email_title" android:text="@string/color_contrast_preview_email_title"
android:textColor="?androidprv:attr/materialColorOnSurface" android:textColor="@androidprv:color/materialColorOnSurface"
android:textSize="16sp" android:textSize="16sp"
app:layout_constrainedWidth="true" app:layout_constrainedWidth="true"
app:layout_constraintEnd_toEndOf="@+id/email_main_background" app:layout_constraintEnd_toEndOf="@+id/email_main_background"
@@ -189,7 +189,7 @@
android:maxLines="2" android:maxLines="2"
android:paddingBottom="8dp" android:paddingBottom="8dp"
android:text="@string/color_contrast_preview_email_body" android:text="@string/color_contrast_preview_email_body"
android:textColor="?androidprv:attr/materialColorOnSurfaceVariant" android:textColor="@androidprv:color/materialColorOnSurfaceVariant"
android:textSize="12sp" android:textSize="12sp"
app:layout_constrainedWidth="true" app:layout_constrainedWidth="true"
app:layout_constraintEnd_toEndOf="@+id/email_main_background" app:layout_constraintEnd_toEndOf="@+id/email_main_background"
@@ -228,7 +228,7 @@
android:maxLines="1" android:maxLines="1"
android:paddingEnd="10dp" android:paddingEnd="10dp"
android:text="@string/color_contrast_preview_email_attachment_name" android:text="@string/color_contrast_preview_email_attachment_name"
android:textColor="?androidprv:attr/materialColorOnTertiaryContainer" android:textColor="@androidprv:color/materialColorOnTertiaryContainer"
android:textSize="12sp" android:textSize="12sp"
app:layout_constrainedWidth="true" app:layout_constrainedWidth="true"
app:layout_constraintBottom_toBottomOf="@+id/attachment_background" app:layout_constraintBottom_toBottomOf="@+id/attachment_background"

View File

@@ -72,7 +72,7 @@
android:singleLine="true" android:singleLine="true"
android:textSize="@dimen/contrast_button_text_size" android:textSize="@dimen/contrast_button_text_size"
android:text="@string/contrast_default" android:text="@string/contrast_default"
android:textColor="?androidprv:attr/materialColorOnSurface"/> android:textColor="@androidprv:color/materialColorOnSurface"/>
</LinearLayout> </LinearLayout>
<Space <Space
@@ -107,7 +107,7 @@
android:singleLine="true" android:singleLine="true"
android:textSize="@dimen/contrast_button_text_size" android:textSize="@dimen/contrast_button_text_size"
android:text="@string/contrast_medium" android:text="@string/contrast_medium"
android:textColor="?androidprv:attr/materialColorOnSurface"/> android:textColor="@androidprv:color/materialColorOnSurface"/>
</LinearLayout> </LinearLayout>
<Space <Space
@@ -142,7 +142,7 @@
android:singleLine="true" android:singleLine="true"
android:textSize="@dimen/contrast_button_text_size" android:textSize="@dimen/contrast_button_text_size"
android:text="@string/contrast_high" android:text="@string/contrast_high"
android:textColor="?androidprv:attr/materialColorOnSurface"/> android:textColor="@androidprv:color/materialColorOnSurface"/>
</LinearLayout> </LinearLayout>
<Space <Space

View File

@@ -0,0 +1,334 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2024 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<com.google.android.setupdesign.GlifLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
style="?attr/face_layout_theme"
android:id="@+id/setup_wizard_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:sudDescriptionText="@string/security_settings_face_enroll_introduction_message">
<LinearLayout
style="@style/SudContentFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical">
<com.google.android.setupdesign.view.RichTextView
android:id="@+id/error_text"
style="@style/SudDescription.Glif"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
style="@style/SudContentIllustration"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@null"
android:src="@drawable/face_enroll_intro_illustration"
android:layout_marginBottom="@dimen/face_enroll_intro_illustration_margin_bottom"/>
</FrameLayout>
<!-- Contains the extra information text at the bottom -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- Secure and helpful -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/BiometricEnrollIntroTitle"
android:text="@string/security_settings_fingerprint_enroll_introduction_footer_title_3"/>
<Space
android:layout_width="wrap_content"
android:layout_height="16dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/icon_security_privacy_safe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@null"
android:background="@drawable/ic_security_privacy_safe"/>
<Space
android:layout_width="16dp"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/footer_message_7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/security_settings_face_enroll_introduction_secure_and_helpful_message_1"
style="@style/BiometricEnrollIntroMessage" />
</LinearLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="16dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/icon_privacy_tip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@null"
android:background="@drawable/ic_privacy_tip"/>
<Space
android:layout_width="16dp"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/footer_message_8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/security_settings_face_enroll_introduction_secure_and_helpful_message_2"
style="@style/BiometricEnrollIntroMessage" />
</LinearLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="16dp"/>
<!-- Keep in mind -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/BiometricEnrollIntroTitle"
android:text="@string/security_settings_face_enroll_introduction_info_title" />
<Space
android:layout_width="wrap_content"
android:layout_height="16dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/icon_glasses"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ic_eyeglasses"/>
<Space
android:layout_width="16dp"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/info_message_glasses"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/BiometricEnrollIntroMessage" />
</LinearLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="16dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/icon_looking"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ic_face_enroll_introduction_visibility"/>
<Space
android:layout_width="16dp"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/info_message_looking"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/BiometricEnrollIntroMessage" />
</LinearLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="16dp"/>
<LinearLayout
android:id="@+id/info_row_less_secure"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone">
<ImageView
android:id="@+id/icon_less_secure"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ic_info_outline_24dp"/>
<Space
android:layout_width="16dp"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/info_message_less_secure"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/BiometricEnrollIntroMessage"
android:text="@string/security_settings_face_enroll_introduction_info_less_secure" />
</LinearLayout>
<LinearLayout
android:id="@+id/info_row_require_eyes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone">
<ImageView
android:id="@+id/icon_require_eyes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ic_settings_24dp"/>
<Space
android:layout_width="16dp"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/info_message_require_eyes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/BiometricEnrollIntroMessage" />
</LinearLayout>
<!-- How it works -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/BiometricEnrollIntroTitle"
android:text="@string/security_settings_face_enroll_introduction_how_title" />
<Space
android:layout_width="wrap_content"
android:layout_height="16dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/icon_familiar_face_and_zone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@null"
android:background="@drawable/ic_familiar_face_and_zone"/>
<Space
android:layout_width="16dp"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/how_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/BiometricEnrollIntroMessage" />
</LinearLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="16dp"/>
<!-- You're in control -->
<TextView
android:id="@+id/title_in_control"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/BiometricEnrollIntroTitle" />
<Space
android:layout_width="wrap_content"
android:layout_height="16dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/icon_trash_can"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@null"
android:background="@drawable/ic_trash_can"/>
<Space
android:layout_width="16dp"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/message_in_control"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/BiometricEnrollIntroMessage"
android:paddingBottom="0dp" />
</LinearLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="16dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/icon_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@null"
android:background="@drawable/ic_info_outline_24dp"/>
<Space
android:layout_width="wrap_content"
android:layout_height="4dp"/>
<TextView
android:id="@+id/message_learn_more"
android:linksClickable="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/BiometricEnrollIntroMessage"
android:paddingBottom="0dp"
android:text="@string/security_settings_face_enroll_introduction_learn_more_message" />
</LinearLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="16dp"/>
</LinearLayout>
</LinearLayout>
</com.google.android.setupdesign.GlifLayout>

View File

@@ -78,7 +78,7 @@
android:layout_gravity="start" android:layout_gravity="start"
android:textAlignment="viewStart" android:textAlignment="viewStart"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?androidprv:attr/materialColorOnSurfaceVariant" android:textColor="@androidprv:color/materialColorOnSurfaceVariant"
android:maxLines="4" android:maxLines="4"
android:hyphenationFrequency="normalFast" android:hyphenationFrequency="normalFast"
android:lineBreakWordStyle="phrase" android:lineBreakWordStyle="phrase"

View File

@@ -78,7 +78,7 @@
android:layout_gravity="start" android:layout_gravity="start"
android:textAlignment="viewStart" android:textAlignment="viewStart"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?androidprv:attr/materialColorOnSurfaceVariant" android:textColor="@androidprv:color/materialColorOnSurfaceVariant"
android:maxLines="4" android:maxLines="4"
android:hyphenationFrequency="normalFast" android:hyphenationFrequency="normalFast"
android:lineBreakWordStyle="phrase" android:lineBreakWordStyle="phrase"

View File

@@ -31,7 +31,7 @@
android:ellipsize="marquee" android:ellipsize="marquee"
android:fadingEdge="horizontal" android:fadingEdge="horizontal"
android:src="@drawable/ic_check_24dp" android:src="@drawable/ic_check_24dp"
android:tint="?androidprv:attr/materialColorPrimary"/> android:tint="@androidprv:color/materialColorPrimary"/>
<TextView <TextView
android:id="@+id/modifier_key_text" android:id="@+id/modifier_key_text"

View File

@@ -107,7 +107,7 @@
android:paddingVertical="14dp" android:paddingVertical="14dp"
android:drawablePadding="9dp" android:drawablePadding="9dp"
style="@style/ModifierKeyButtonDone" style="@style/ModifierKeyButtonDone"
android:textColor="?androidprv:attr/materialColorOnPrimary" android:textColor="@androidprv:color/materialColorOnPrimary"
android:text="@string/modifier_keys_done"/> android:text="@string/modifier_keys_done"/>
</RelativeLayout> </RelativeLayout>

View File

@@ -74,7 +74,7 @@
android:singleLine="true" android:singleLine="true"
android:textSize="@dimen/contrast_button_text_size" android:textSize="@dimen/contrast_button_text_size"
android:text="@string/lock_screen_notifs_show_compact" android:text="@string/lock_screen_notifs_show_compact"
android:textColor="?androidprv:attr/materialColorOnSurface"/> android:textColor="@androidprv:color/materialColorOnSurface"/>
</LinearLayout> </LinearLayout>
<Space <Space
@@ -109,7 +109,7 @@
android:singleLine="true" android:singleLine="true"
android:textSize="@dimen/contrast_button_text_size" android:textSize="@dimen/contrast_button_text_size"
android:text="@string/lock_screen_notifs_show_full_list" android:text="@string/lock_screen_notifs_show_full_list"
android:textColor="?androidprv:attr/materialColorOnSurface"/> android:textColor="@androidprv:color/materialColorOnSurface"/>
</LinearLayout> </LinearLayout>
<Space <Space

View File

@@ -32,7 +32,7 @@
android:layout_marginTop="@dimen/pointer_fill_style_circle_padding" android:layout_marginTop="@dimen/pointer_fill_style_circle_padding"
android:text="@string/pointer_fill_style" android:text="@string/pointer_fill_style"
android:textSize="14sp" android:textSize="14sp"
android:textColor="?androidprv:attr/materialColorPrimary" android:textColor="@androidprv:color/materialColorPrimary"
android:textAlignment="viewStart" android:textAlignment="viewStart"
android:fontWeight="500" /> android:fontWeight="500" />

View File

@@ -31,7 +31,7 @@
android:layout_marginTop="@dimen/pointer_stroke_style_padding" android:layout_marginTop="@dimen/pointer_stroke_style_padding"
android:text="@string/pointer_stroke_style" android:text="@string/pointer_stroke_style"
android:textSize="14sp" android:textSize="14sp"
android:textColor="?androidprv:attr/materialColorPrimary" android:textColor="@androidprv:color/materialColorPrimary"
android:textAlignment="viewStart" android:textAlignment="viewStart"
android:fontWeight="500" android:fontWeight="500"
android:textAppearance="?android:attr/textAppearanceListItem" /> android:textAppearance="?android:attr/textAppearanceListItem" />

View File

@@ -65,7 +65,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceListItem" android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="?androidprv:attr/materialColorOnPrimaryContainer" android:textColor="@androidprv:color/materialColorOnPrimaryContainer"
android:ellipsize="marquee" android:ellipsize="marquee"
android:fadingEdge="horizontal" android:fadingEdge="horizontal"
android:hyphenationFrequency="normalFast" android:hyphenationFrequency="normalFast"
@@ -78,7 +78,7 @@
android:layout_alignStart="@android:id/title" android:layout_alignStart="@android:id/title"
android:layout_alignLeft="@android:id/title" android:layout_alignLeft="@android:id/title"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?androidprv:attr/materialColorOnPrimaryContainer" android:textColor="@androidprv:color/materialColorOnPrimaryContainer"
android:hyphenationFrequency="normalFast" android:hyphenationFrequency="normalFast"
android:lineBreakWordStyle="phrase" android:lineBreakWordStyle="phrase"
android:maxLines="4" android:maxLines="4"

View File

@@ -26,7 +26,7 @@
android:padding="4dp" android:padding="4dp"
android:drawablePadding="0dp" android:drawablePadding="0dp"
android:background="@drawable/preference_circular_icons_plus_item_background" android:background="@drawable/preference_circular_icons_plus_item_background"
android:textColor="?androidprv:attr/materialColorOnSecondaryContainer" android:textColor="@androidprv:color/materialColorOnSecondaryContainer"
android:maxLines="1" android:maxLines="1"
android:autoSizeTextType="uniform" android:autoSizeTextType="uniform"
android:autoSizeMinTextSize="6sp" /> android:autoSizeMinTextSize="6sp" />

View File

@@ -23,5 +23,5 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:contentDescription="@null" android:contentDescription="@null"
android:scaleType="center" android:scaleType="center"
android:tint="?androidprv:attr/materialColorOnPrimaryContainer" android:tint="@androidprv:color/materialColorOnPrimaryContainer"
android:src="@drawable/ic_arrow_forward" /> android:src="@drawable/ic_arrow_forward" />

View File

@@ -82,7 +82,7 @@
android:paddingVertical="14dp" android:paddingVertical="14dp"
android:drawablePadding="9dp" android:drawablePadding="9dp"
style="@style/TrackpadButtonDone" style="@style/TrackpadButtonDone"
android:textColor="?androidprv:attr/materialColorOnPrimary" android:textColor="@androidprv:color/materialColorOnPrimary"
android:text="@string/gesture_button_next"/> android:text="@string/gesture_button_next"/>
<Button <Button
@@ -96,7 +96,7 @@
android:paddingVertical="14dp" android:paddingVertical="14dp"
android:drawablePadding="9dp" android:drawablePadding="9dp"
style="@style/TrackpadButtonDone" style="@style/TrackpadButtonDone"
android:textColor="?androidprv:attr/materialColorOnPrimary" android:textColor="@androidprv:color/materialColorOnPrimary"
android:text="@string/gesture_button_done"/> android:text="@string/gesture_button_done"/>
</RelativeLayout> </RelativeLayout>

View File

@@ -19,7 +19,7 @@
<color name="homepage_accessibility_background">#783BE5</color> <color name="homepage_accessibility_background">#783BE5</color>
<color name="homepage_support_background">#3F5FBD</color> <color name="homepage_support_background">#3F5FBD</color>
<color name="contextual_card_background">@*android:color/material_grey_900</color> <color name="contextual_card_background">@*android:color/material_grey_900</color>
<color name="search_bar_background">?androidprv:attr/materialColorSurfaceBright</color> <color name="search_bar_background">@androidprv:color/materialColorSurfaceBright</color>
<color name="notification_importance_button_unselected">#5F6368</color> <color name="notification_importance_button_unselected">#5F6368</color>
<!-- Palette list preference colors. --> <!-- Palette list preference colors. -->

View File

@@ -94,7 +94,7 @@
<color name="icon_launcher_setting_color">@*android:color/accent_device_default_light</color> <color name="icon_launcher_setting_color">@*android:color/accent_device_default_light</color>
<!-- Search bar background color --> <!-- Search bar background color -->
<color name="search_bar_background">?androidprv:attr/materialColorSurfaceBright</color> <color name="search_bar_background">@androidprv:color/materialColorSurfaceBright</color>
<color name="face_enroll_icon_color">#42a5f5</color> <!-- Blue 400 --> <color name="face_enroll_icon_color">#42a5f5</color> <!-- Blue 400 -->
@@ -166,7 +166,7 @@
<color name="battery_info_error_color_black">@*android:color/primary_text_default_material_light</color> <color name="battery_info_error_color_black">@*android:color/primary_text_default_material_light</color>
<!-- Background for multiple user settings page avatars --> <!-- Background for multiple user settings page avatars -->
<color name="user_avatar_color_bg">?androidprv:attr/materialColorSurfaceContainer</color> <color name="user_avatar_color_bg">@androidprv:color/materialColorSurfaceContainer</color>
<!-- Icon tint color for battery usage system icon --> <!-- Icon tint color for battery usage system icon -->
<color name="battery_usage_system_icon_color">?android:attr/textColorPrimary</color> <color name="battery_usage_system_icon_color">?android:attr/textColorPrimary</color>

View File

@@ -771,6 +771,8 @@
<string name="security_settings_face_enroll_introduction_accessibility_diversity"></string> <string name="security_settings_face_enroll_introduction_accessibility_diversity"></string>
<!-- Message shown for a toggle which when enabled, allows the user to enroll using a simpler flow for accessibility [CHAR LIMIT=NONE] --> <!-- Message shown for a toggle which when enabled, allows the user to enroll using a simpler flow for accessibility [CHAR LIMIT=NONE] -->
<string name="security_settings_face_enroll_introduction_accessibility_vision"></string> <string name="security_settings_face_enroll_introduction_accessibility_vision"></string>
<!-- Message on the face enrollment introduction page that explains privacy controls for face unlock [CHAR LIMIT=NONE] -->
<string name="security_settings_face_enroll_introduction_learn_more_message"></string>
<!-- Button text to cancel enrollment from the introduction [CHAR LIMIT=22] --> <!-- Button text to cancel enrollment from the introduction [CHAR LIMIT=22] -->
<string name="security_settings_face_enroll_introduction_cancel">Cancel</string> <string name="security_settings_face_enroll_introduction_cancel">Cancel</string>
<!-- Button text to cancel enrollment [CHAR LIMIT=30] --> <!-- Button text to cancel enrollment [CHAR LIMIT=30] -->
@@ -898,6 +900,8 @@
<string name="security_settings_fingerprint_enroll_introduction_footer_title_consent_1">You and your child are in control</string> <string name="security_settings_fingerprint_enroll_introduction_footer_title_consent_1">You and your child are in control</string>
<!-- Introduction title shown in the bottom of fingerprint enrollment dialog [CHAR LIMIT=NONE]--> <!-- Introduction title shown in the bottom of fingerprint enrollment dialog [CHAR LIMIT=NONE]-->
<string name="security_settings_fingerprint_enroll_introduction_footer_title_2">Keep in mind</string> <string name="security_settings_fingerprint_enroll_introduction_footer_title_2">Keep in mind</string>
<!-- Introduction title shown in the bottom of fingerprint enrollment dialog [CHAR LIMIT=NONE]-->
<string name="security_settings_fingerprint_enroll_introduction_footer_title_3">Secure and helpful</string>
<!-- Introduction detail message shown in fingerprint enrollment dialog, when fingerprint unlock is disabled by device admin [CHAR LIMIT=NONE]--> <!-- Introduction detail message shown in fingerprint enrollment dialog, when fingerprint unlock is disabled by device admin [CHAR LIMIT=NONE]-->
<string name="security_settings_fingerprint_enroll_introduction_message_unlock_disabled">Use your fingerprint to unlock your phone or approve purchases.\n\nNote: You can\u2019t use your fingerprint to unlock this device. For more information, contact your organization\u2019s admin.</string> <string name="security_settings_fingerprint_enroll_introduction_message_unlock_disabled">Use your fingerprint to unlock your phone or approve purchases.\n\nNote: You can\u2019t use your fingerprint to unlock this device. For more information, contact your organization\u2019s admin.</string>
<!-- Button text to cancel enrollment from the introduction [CHAR LIMIT=22] --> <!-- Button text to cancel enrollment from the introduction [CHAR LIMIT=22] -->
@@ -928,6 +932,8 @@
<string name="security_settings_fingerprint_v2_enroll_introduction_footer_message_consent_6">For best results, use a screen protector that\u2019s Made for Google certified. With other screen protectors, your child\u2019s fingerprint may not work.</string> <string name="security_settings_fingerprint_v2_enroll_introduction_footer_message_consent_6">For best results, use a screen protector that\u2019s Made for Google certified. With other screen protectors, your child\u2019s fingerprint may not work.</string>
<!-- Introduction detail message shown in fingerprint enrollment introduction to learn more about fingerprint [CHAR LIMIT=NONE]--> <!-- Introduction detail message shown in fingerprint enrollment introduction to learn more about fingerprint [CHAR LIMIT=NONE]-->
<string name="security_settings_fingerprint_v2_enroll_introduction_message_learn_more"></string> <string name="security_settings_fingerprint_v2_enroll_introduction_message_learn_more"></string>
<!-- Introduction detail message shown in fingerprint enrollment introduction to learn more about fingerprint [CHAR LIMIT=NONE]-->
<string name="security_settings_fingerprint_v2_enroll_introduction_message_learn_more_2"></string>
<!-- Watch unlock enrollment and settings --><skip /> <!-- Watch unlock enrollment and settings --><skip />
<!-- Title shown for menu item that launches watch unlock settings. [CHAR LIMIT=40] --> <!-- Title shown for menu item that launches watch unlock settings. [CHAR LIMIT=40] -->

View File

@@ -249,7 +249,7 @@
<item name="android:layout_gravity">center</item> <item name="android:layout_gravity">center</item>
<item name="android:fontFamily">@*android:string/config_headlineFontFamily</item> <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
<item name="android:textSize">@dimen/search_bar_text_size</item> <item name="android:textSize">@dimen/search_bar_text_size</item>
<item name="android:textColor">?androidprv:attr/materialColorOnSurfaceVariant</item> <item name="android:textColor">@androidprv:color/materialColorOnSurfaceVariant</item>
<item name="android:singleLine">true</item> <item name="android:singleLine">true</item>
</style> </style>
@@ -448,7 +448,7 @@
<item name="android:layout_marginBottom">@dimen/contextual_card_vertical_margin</item> <item name="android:layout_marginBottom">@dimen/contextual_card_vertical_margin</item>
<item name="android:layout_marginStart">@dimen/contextual_card_side_margin</item> <item name="android:layout_marginStart">@dimen/contextual_card_side_margin</item>
<item name="android:layout_marginEnd">@dimen/contextual_card_side_margin</item> <item name="android:layout_marginEnd">@dimen/contextual_card_side_margin</item>
<item name="cardBackgroundColor">?androidprv:attr/materialColorSurfaceContainer</item> <item name="cardBackgroundColor">@androidprv:color/materialColorSurfaceContainer</item>
<item name="cardCornerRadius">@dimen/contextual_card_corner_radius</item> <item name="cardCornerRadius">@dimen/contextual_card_corner_radius</item>
<item name="cardElevation">0dp</item> <item name="cardElevation">0dp</item>
<item name="rippleColor">?android:attr/colorControlHighlight</item> <item name="rippleColor">?android:attr/colorControlHighlight</item>

View File

@@ -67,12 +67,12 @@
<item name="sliceViewStyle">@style/Widget.SliceView.Settings</item> <item name="sliceViewStyle">@style/Widget.SliceView.Settings</item>
<item name="notification_importance_button_background_color_unselected">@android:color/transparent</item> <item name="notification_importance_button_background_color_unselected">@android:color/transparent</item>
<item name="notification_importance_button_border_color_unselected">?androidprv:attr/materialColorOutlineVariant</item> <item name="notification_importance_button_border_color_unselected">@androidprv:color/materialColorOutlineVariant</item>
<item name="notification_importance_button_foreground_color_unselected">?androidprv:attr/materialColorOnSurfaceVariant</item> <item name="notification_importance_button_foreground_color_unselected">@androidprv:color/materialColorOnSurfaceVariant</item>
<item name="notification_importance_button_background_color_selected">?androidprv:attr/materialColorSecondaryContainer</item> <item name="notification_importance_button_background_color_selected">@androidprv:color/materialColorSecondaryContainer</item>
<item name="notification_importance_button_border_color_selected">?androidprv:attr/materialColorOnSecondaryContainer</item> <item name="notification_importance_button_border_color_selected">@androidprv:color/materialColorOnSecondaryContainer</item>
<item name="notification_importance_button_foreground_color_selected">?androidprv:attr/materialColorOnSecondaryContainer</item> <item name="notification_importance_button_foreground_color_selected">@androidprv:color/materialColorOnSecondaryContainer</item>
<!-- For AppCompat widgets, e.g. TextInputLayout --> <!-- For AppCompat widgets, e.g. TextInputLayout -->
<item name="colorAccent">?android:attr/colorAccent</item> <item name="colorAccent">?android:attr/colorAccent</item>

View File

@@ -59,12 +59,12 @@
<item name="sliceViewStyle">@style/Widget.SliceView.Settings</item> <item name="sliceViewStyle">@style/Widget.SliceView.Settings</item>
<item name="notification_importance_button_background_color_unselected">@android:color/transparent</item> <item name="notification_importance_button_background_color_unselected">@android:color/transparent</item>
<item name="notification_importance_button_border_color_unselected">?androidprv:attr/materialColorOutlineVariant</item> <item name="notification_importance_button_border_color_unselected">@androidprv:color/materialColorOutlineVariant</item>
<item name="notification_importance_button_foreground_color_unselected">?androidprv:attr/materialColorOnSurfaceVariant</item> <item name="notification_importance_button_foreground_color_unselected">@androidprv:color/materialColorOnSurfaceVariant</item>
<item name="notification_importance_button_background_color_selected">?androidprv:attr/materialColorSecondaryContainer</item> <item name="notification_importance_button_background_color_selected">@androidprv:color/materialColorSecondaryContainer</item>
<item name="notification_importance_button_border_color_selected">?androidprv:attr/materialColorOnSecondaryContainer</item> <item name="notification_importance_button_border_color_selected">@androidprv:color/materialColorOnSecondaryContainer</item>
<item name="notification_importance_button_foreground_color_selected">?androidprv:attr/materialColorOnSecondaryContainer</item> <item name="notification_importance_button_foreground_color_selected">@androidprv:color/materialColorOnSecondaryContainer</item>
<!-- For AppCompat widgets, e.g. TextInputLayout --> <!-- For AppCompat widgets, e.g. TextInputLayout -->
<item name="colorAccent">?android:attr/colorAccent</item> <item name="colorAccent">?android:attr/colorAccent</item>

View File

@@ -18,7 +18,7 @@
xmlns:settings="http://schemas.android.com/apk/res-auto" xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="mobile_network_pref_screen"> android:key="mobile_network_pref_screen">
<com.android.settings.spa.preference.ComposePreference <com.android.settings.spa.preference.ComposeMainSwitchPreference
android:key="use_sim_switch" android:key="use_sim_switch"
settings:controller="com.android.settings.network.telephony.MobileNetworkSwitchController"/> settings:controller="com.android.settings.network.telephony.MobileNetworkSwitchController"/>

View File

@@ -1330,8 +1330,7 @@ public final class Utils extends com.android.settingslib.Utils {
*/ */
@ColorInt @ColorInt
public static int getHomepageIconColor(Context context) { public static int getHomepageIconColor(Context context) {
return getColorAttrDefaultColor( return context.getColor(com.android.internal.R.color.materialColorOnSurface);
context, com.android.internal.R.attr.materialColorOnSurface);
} }
/** /**

View File

@@ -66,7 +66,6 @@ public class TextReadingPreferenceFragment extends DashboardFragment {
static final String RESET_KEY = "reset"; static final String RESET_KEY = "reset";
static final String PREVIEW_KEY = "preview"; static final String PREVIEW_KEY = "preview";
private static final String NEED_RESET_SETTINGS = "need_reset_settings"; private static final String NEED_RESET_SETTINGS = "need_reset_settings";
private static final String LAST_PREVIEW_INDEX = "last_preview_index";
private static final int UNKNOWN_INDEX = -1; private static final int UNKNOWN_INDEX = -1;
private FontWeightAdjustmentPreferenceController mFontWeightAdjustmentController; private FontWeightAdjustmentPreferenceController mFontWeightAdjustmentController;
@@ -111,13 +110,6 @@ public class TextReadingPreferenceFragment extends DashboardFragment {
if (savedInstanceState.getBoolean(NEED_RESET_SETTINGS)) { if (savedInstanceState.getBoolean(NEED_RESET_SETTINGS)) {
mResetStateListeners.forEach(ResetStateListener::resetState); mResetStateListeners.forEach(ResetStateListener::resetState);
} }
if (savedInstanceState.containsKey(LAST_PREVIEW_INDEX)) {
final int lastPreviewIndex = savedInstanceState.getInt(LAST_PREVIEW_INDEX);
if (lastPreviewIndex != UNKNOWN_INDEX) {
mPreviewController.setCurrentItem(lastPreviewIndex);
}
}
} }
} }
@@ -252,8 +244,6 @@ public class TextReadingPreferenceFragment extends DashboardFragment {
if (mNeedResetSettings) { if (mNeedResetSettings) {
outState.putBoolean(NEED_RESET_SETTINGS, true); outState.putBoolean(NEED_RESET_SETTINGS, true);
} }
outState.putInt(LAST_PREVIEW_INDEX, mPreviewController.getCurrentItem());
} }
@Override @Override

View File

@@ -17,6 +17,8 @@
package com.android.settings.accessibility; package com.android.settings.accessibility;
import android.content.Context; import android.content.Context;
import android.os.Bundle;
import android.os.Parcelable;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.View; import android.view.View;
import android.widget.FrameLayout; import android.widget.FrameLayout;
@@ -36,6 +38,7 @@ import com.android.settings.widget.DotsPageIndicator;
* A {@link Preference} that could show the preview related to the text and reading options. * A {@link Preference} that could show the preview related to the text and reading options.
*/ */
public class TextReadingPreviewPreference extends Preference { public class TextReadingPreviewPreference extends Preference {
private static final String KEY_LAST_INDEX = "last_preview_index";
private int mCurrentItem; private int mCurrentItem;
private int mLastLayerIndex; private int mLastLayerIndex;
private PreviewPagerAdapter mPreviewAdapter; private PreviewPagerAdapter mPreviewAdapter;
@@ -98,6 +101,22 @@ public class TextReadingPreviewPreference extends Preference {
updatePagerAndIndicator(viewPager, pageIndicator); updatePagerAndIndicator(viewPager, pageIndicator);
} }
@Override
protected Parcelable onSaveInstanceState() {
Bundle state = new Bundle();
state.putParcelable(null, super.onSaveInstanceState());
state.putInt(KEY_LAST_INDEX, getCurrentItem());
return state;
}
@Override
protected void onRestoreInstanceState(Parcelable state) {
Bundle bundle = (Bundle) state;
super.onRestoreInstanceState(bundle.getParcelable(null));
setCurrentItem(bundle.getInt(KEY_LAST_INDEX));
}
/** /**
* Set the minimum preview layout horizontal inner padding. * Set the minimum preview layout horizontal inner padding.
*/ */

View File

@@ -18,9 +18,11 @@ package com.android.settings.applications.manageapplications;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.text.TextUtils; import android.text.TextUtils;
import androidx.preference.Preference; import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
import com.android.settings.core.PreferenceControllerMixin; import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.core.AbstractPreferenceController; import com.android.settingslib.core.AbstractPreferenceController;
@@ -70,4 +72,19 @@ public class ResetAppPrefPreferenceController extends AbstractPreferenceControll
public void onSaveInstanceState(Bundle outState) { public void onSaveInstanceState(Bundle outState) {
mResetAppsHelper.onSaveInstanceState(outState); mResetAppsHelper.onSaveInstanceState(outState);
} }
@Override
public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen);
Preference preference = screen.findPreference(getPreferenceKey());
if (preference != null) {
preference.setEnabled(!isInCallState());
}
}
boolean isInCallState() {
TelephonyManager telephonyManager = mContext.getSystemService(TelephonyManager.class);
return telephonyManager.getCallState(telephonyManager.getSubscriptionId())
!= TelephonyManager.CALL_STATE_IDLE;
}
} }

View File

@@ -37,6 +37,7 @@ import com.android.internal.widget.LockPatternUtils;
import com.android.settings.R; import com.android.settings.R;
import com.android.settings.SetupWizardUtils; import com.android.settings.SetupWizardUtils;
import com.android.settings.Utils; import com.android.settings.Utils;
import com.android.settings.flags.Flags;
import com.android.settings.password.ChooseLockGeneric; import com.android.settings.password.ChooseLockGeneric;
import com.android.settings.password.ChooseLockSettingsHelper; import com.android.settings.password.ChooseLockSettingsHelper;
import com.android.settings.password.ConfirmDeviceCredentialActivity; import com.android.settings.password.ConfirmDeviceCredentialActivity;
@@ -551,8 +552,11 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
@NonNull @NonNull
protected PorterDuffColorFilter getIconColorFilter() { protected PorterDuffColorFilter getIconColorFilter() {
if (mIconColorFilter == null) { if (mIconColorFilter == null) {
final int colorType = Flags.biometricsOnboardingEducation()
? DynamicColorPalette.ColorType.PRIMARY_TEXT
: DynamicColorPalette.ColorType.ACCENT;
mIconColorFilter = new PorterDuffColorFilter( mIconColorFilter = new PorterDuffColorFilter(
DynamicColorPalette.getColor(this, DynamicColorPalette.ColorType.ACCENT), DynamicColorPalette.getColor(this, colorType),
PorterDuff.Mode.SRC_IN); PorterDuff.Mode.SRC_IN);
} }
return mIconColorFilter; return mIconColorFilter;

View File

@@ -53,6 +53,7 @@ import com.android.settings.biometrics.BiometricEnrollActivity;
import com.android.settings.biometrics.BiometricEnrollIntroduction; import com.android.settings.biometrics.BiometricEnrollIntroduction;
import com.android.settings.biometrics.BiometricUtils; import com.android.settings.biometrics.BiometricUtils;
import com.android.settings.biometrics.MultiBiometricEnrollHelper; import com.android.settings.biometrics.MultiBiometricEnrollHelper;
import com.android.settings.flags.Flags;
import com.android.settings.password.ChooseLockSettingsHelper; import com.android.settings.password.ChooseLockSettingsHelper;
import com.android.settings.password.SetupSkipDialog; import com.android.settings.password.SetupSkipDialog;
import com.android.settings.utils.SensorPrivacyManagerHelper; import com.android.settings.utils.SensorPrivacyManagerHelper;
@@ -144,6 +145,19 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
final ImageView iconLooking = findViewById(R.id.icon_looking); final ImageView iconLooking = findViewById(R.id.icon_looking);
iconGlasses.getBackground().setColorFilter(getIconColorFilter()); iconGlasses.getBackground().setColorFilter(getIconColorFilter());
iconLooking.getBackground().setColorFilter(getIconColorFilter()); iconLooking.getBackground().setColorFilter(getIconColorFilter());
if (Flags.biometricsOnboardingEducation()) {
final ImageView iconSecurityPrivacySafe = findViewById(R.id.icon_security_privacy_safe);
final ImageView iconPrivacyTip = findViewById(R.id.icon_privacy_tip);
final ImageView iconFamiliarFaceAndZone =
findViewById(R.id.icon_familiar_face_and_zone);
final ImageView iconTrashCan = findViewById(R.id.icon_trash_can);
final ImageView iconLink = findViewById(R.id.icon_link);
iconSecurityPrivacySafe.getBackground().setColorFilter(getIconColorFilter());
iconPrivacyTip.getBackground().setColorFilter(getIconColorFilter());
iconFamiliarFaceAndZone.getBackground().setColorFilter(getIconColorFilter());
iconTrashCan.getBackground().setColorFilter(getIconColorFilter());
iconLink.getBackground().setColorFilter(getIconColorFilter());
}
// Set text for views with multiple variations. // Set text for views with multiple variations.
final TextView infoMessageGlasses = findViewById(R.id.info_message_glasses); final TextView infoMessageGlasses = findViewById(R.id.info_message_glasses);
@@ -156,9 +170,19 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
infoMessageLooking.setText(getInfoMessageLooking()); infoMessageLooking.setText(getInfoMessageLooking());
inControlTitle.setText(getInControlTitle()); inControlTitle.setText(getInControlTitle());
howMessage.setText(getHowMessage()); howMessage.setText(getHowMessage());
inControlMessage.setText(Html.fromHtml(getString(getInControlMessage()), if (Flags.biometricsOnboardingEducation()) {
Html.FROM_HTML_MODE_LEGACY)); inControlMessage.setText(
inControlMessage.setMovementMethod(LinkMovementMethod.getInstance()); R.string.security_settings_face_enroll_introduction_control_message_2);
final TextView learnMore = findViewById(R.id.message_learn_more);
learnMore.setText(Html.fromHtml(getString(
R.string.security_settings_face_enroll_introduction_learn_more_message),
Html.FROM_HTML_MODE_LEGACY));
learnMore.setMovementMethod(LinkMovementMethod.getInstance());
} else {
inControlMessage.setText(Html.fromHtml(getString(getInControlMessage()),
Html.FROM_HTML_MODE_LEGACY));
inControlMessage.setMovementMethod(LinkMovementMethod.getInstance());
}
lessSecure.setText(getLessSecureMessage()); lessSecure.setText(getLessSecureMessage());
final ScrollView scrollView = final ScrollView scrollView =
@@ -411,7 +435,11 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
@Override @Override
protected int getLayoutResource() { protected int getLayoutResource() {
return R.layout.face_enroll_introduction; if (Flags.biometricsOnboardingEducation()) {
return R.layout.face_enroll_introduction_2;
} else {
return R.layout.face_enroll_introduction;
}
} }
@Override @Override
@@ -594,8 +622,13 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
setDescriptionText(getString( setDescriptionText(getString(
R.string.private_space_face_enroll_introduction_message)); R.string.private_space_face_enroll_introduction_message));
} else if (mIsFaceStrong) { } else if (mIsFaceStrong) {
setDescriptionText(getString( final int messageRes;
R.string.security_settings_face_enroll_introduction_message_class3)); if (Flags.biometricsOnboardingEducation()) {
messageRes = R.string.security_settings_face_enroll_introduction_message_class3_2;
} else {
messageRes = R.string.security_settings_face_enroll_introduction_message_class3;
}
setDescriptionText(getString(messageRes));
} }
super.updateDescriptionText(); super.updateDescriptionText();
} }

View File

@@ -39,7 +39,6 @@ import android.widget.TextView;
import com.android.internal.util.UserIcons; import com.android.internal.util.UserIcons;
import com.android.internal.widget.RecyclerView; import com.android.internal.widget.RecyclerView;
import com.android.settings.R; import com.android.settings.R;
import com.android.settingslib.Utils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -62,8 +61,8 @@ public class UserAdapter extends BaseAdapter {
mUserHandle = userHandle; mUserHandle = userHandle;
mUserManager = um; mUserManager = um;
UserInfo userInfo = um.getUserInfo(mUserHandle.getIdentifier()); UserInfo userInfo = um.getUserInfo(mUserHandle.getIdentifier());
int tintColor = Utils.getColorAttrDefaultColor(context, int tintColor = context.getColor(com.android.internal.R.color.materialColorPrimary);
com.android.internal.R.attr.materialColorPrimary);
if (userInfo.isManagedProfile() if (userInfo.isManagedProfile()
|| (android.os.Flags.allowPrivateProfile() || (android.os.Flags.allowPrivateProfile()
&& android.multiuser.Flags.enablePrivateSpaceFeatures() && android.multiuser.Flags.enablePrivateSpaceFeatures()

View File

@@ -19,18 +19,14 @@ package com.android.settings.datausage
import android.content.Context import android.content.Context
import com.android.settings.R import com.android.settings.R
import com.android.settings.widget.MainSwitchBarMetadata import com.android.settings.widget.MainSwitchBarMetadata
import com.android.settingslib.datastore.AbstractKeyedDataObservable
import com.android.settingslib.datastore.DataChangeReason
import com.android.settingslib.datastore.KeyValueStore import com.android.settingslib.datastore.KeyValueStore
import com.android.settingslib.datastore.NoOpKeyedObservable
import com.android.settingslib.metadata.PreferenceLifecycleContext
import com.android.settingslib.metadata.PreferenceLifecycleProvider import com.android.settingslib.metadata.PreferenceLifecycleProvider
import com.android.settingslib.metadata.ReadWritePermit import com.android.settingslib.metadata.ReadWritePermit
import com.android.settingslib.metadata.SensitivityLevel import com.android.settingslib.metadata.SensitivityLevel
class DataSaverMainSwitchPreference(context: Context) : class DataSaverMainSwitchPreference : MainSwitchBarMetadata, PreferenceLifecycleProvider {
MainSwitchBarMetadata, PreferenceLifecycleProvider {
private val dataSaverBackend = DataSaverBackend(context)
private var dataSaverBackendListener: DataSaverBackend.Listener? = null
override val key override val key
get() = KEY get() = KEY
@@ -38,7 +34,7 @@ class DataSaverMainSwitchPreference(context: Context) :
override val title override val title
get() = R.string.data_saver_switch_title get() = R.string.data_saver_switch_title
override fun storage(context: Context): KeyValueStore = DataSaverStore(dataSaverBackend) override fun storage(context: Context) = createDataStore(context)
override fun getReadPermit(context: Context, myUid: Int, callingUid: Int) = override fun getReadPermit(context: Context, myUid: Int, callingUid: Int) =
ReadWritePermit.ALLOW ReadWritePermit.ALLOW
@@ -49,24 +45,11 @@ class DataSaverMainSwitchPreference(context: Context) :
override val sensitivityLevel override val sensitivityLevel
get() = SensitivityLevel.NO_SENSITIVITY get() = SensitivityLevel.NO_SENSITIVITY
override fun onStart(context: PreferenceLifecycleContext) {
val listener = DataSaverBackend.Listener { context.notifyPreferenceChange(KEY) }
dataSaverBackendListener = listener
dataSaverBackend.addListener(listener)
}
override fun onStop(context: PreferenceLifecycleContext) {
dataSaverBackendListener?.let {
dataSaverBackend.remListener(it)
dataSaverBackendListener = null
}
}
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
private class DataSaverStore(private val dataSaverBackend: DataSaverBackend) : private class DataSaverStore(private val dataSaverBackend: DataSaverBackend) :
NoOpKeyedObservable<String>(), KeyValueStore { AbstractKeyedDataObservable<String>(), KeyValueStore, DataSaverBackend.Listener {
override fun contains(key: String) = true // just assume the datastore contains the value override fun contains(key: String) = key == KEY
override fun <T : Any> getValue(key: String, valueType: Class<T>): T? = override fun <T : Any> getValue(key: String, valueType: Class<T>): T? =
dataSaverBackend.isDataSaverEnabled as T? dataSaverBackend.isDataSaverEnabled as T?
@@ -74,9 +57,20 @@ class DataSaverMainSwitchPreference(context: Context) :
override fun <T : Any> setValue(key: String, valueType: Class<T>, value: T?) { override fun <T : Any> setValue(key: String, valueType: Class<T>, value: T?) {
dataSaverBackend.isDataSaverEnabled = value as Boolean dataSaverBackend.isDataSaverEnabled = value as Boolean
} }
override fun onFirstObserverAdded() = dataSaverBackend.addListener(this)
override fun onLastObserverRemoved() = dataSaverBackend.remListener(this)
override fun onDataSaverChanged(isDataSaving: Boolean) =
notifyChange(KEY, DataChangeReason.UPDATE)
} }
companion object { companion object {
const val KEY = "use_data_saver" const val KEY = "use_data_saver"
/** Creates [KeyValueStore] for data saver preference. */
fun createDataStore(context: Context): KeyValueStore =
DataSaverStore(DataSaverBackend(context))
} }
} }

View File

@@ -19,24 +19,30 @@ package com.android.settings.datausage
import android.content.Context import android.content.Context
import android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID import android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID
import com.android.settings.R import com.android.settings.R
import com.android.settings.Settings.DataSaverSummaryActivity
import com.android.settings.flags.Flags import com.android.settings.flags.Flags
import com.android.settings.utils.makeLaunchIntent
import com.android.settingslib.datastore.HandlerExecutor
import com.android.settingslib.datastore.KeyedObserver
import com.android.settingslib.metadata.PreferenceAvailabilityProvider import com.android.settingslib.metadata.PreferenceAvailabilityProvider
import com.android.settingslib.metadata.PreferenceLifecycleContext import com.android.settingslib.metadata.PreferenceLifecycleContext
import com.android.settingslib.metadata.PreferenceLifecycleProvider import com.android.settingslib.metadata.PreferenceLifecycleProvider
import com.android.settingslib.metadata.PreferenceMetadata
import com.android.settingslib.metadata.PreferenceSummaryProvider import com.android.settingslib.metadata.PreferenceSummaryProvider
import com.android.settingslib.metadata.ProvidePreferenceScreen import com.android.settingslib.metadata.ProvidePreferenceScreen
import com.android.settingslib.metadata.preferenceHierarchy import com.android.settingslib.metadata.preferenceHierarchy
import com.android.settingslib.preference.PreferenceScreenCreator import com.android.settingslib.preference.PreferenceScreenCreator
import com.android.settings.datausage.DataSaverMainSwitchPreference.Companion.KEY as DATA_SAVER_KEY
@ProvidePreferenceScreen @ProvidePreferenceScreen
class DataSaverScreen : class DataSaverScreen(context: Context) :
PreferenceScreenCreator, PreferenceScreenCreator,
PreferenceAvailabilityProvider, PreferenceAvailabilityProvider,
PreferenceSummaryProvider, PreferenceSummaryProvider,
PreferenceLifecycleProvider { PreferenceLifecycleProvider {
private var dataSaverBackend: DataSaverBackend? = null private val dataSaverStore = DataSaverMainSwitchPreference.createDataStore(context)
private var dataSaverBackendListener: DataSaverBackend.Listener? = null private lateinit var keyedObserver: KeyedObserver<String>
override val key override val key
get() = KEY get() = KEY
@@ -53,7 +59,7 @@ class DataSaverScreen :
override fun getSummary(context: Context): CharSequence? = override fun getSummary(context: Context): CharSequence? =
when { when {
DataSaverBackend(context).isDataSaverEnabled -> dataSaverStore.getBoolean(DATA_SAVER_KEY) == true ->
context.getString(R.string.data_saver_on) context.getString(R.string.data_saver_on)
else -> context.getString(R.string.data_saver_off) else -> context.getString(R.string.data_saver_off)
} }
@@ -65,21 +71,21 @@ class DataSaverScreen :
override fun fragmentClass() = DataSaverSummary::class.java override fun fragmentClass() = DataSaverSummary::class.java
override fun getLaunchIntent(context: Context, metadata: PreferenceMetadata?) =
makeLaunchIntent(context, DataSaverSummaryActivity::class.java, metadata?.key)
override fun getPreferenceHierarchy(context: Context) = override fun getPreferenceHierarchy(context: Context) =
preferenceHierarchy(this) { +DataSaverMainSwitchPreference(context) } preferenceHierarchy(this) { +DataSaverMainSwitchPreference() }
override fun hasCompleteHierarchy() = false override fun hasCompleteHierarchy() = false
override fun onStart(context: PreferenceLifecycleContext) { override fun onCreate(context: PreferenceLifecycleContext) {
val listener = DataSaverBackend.Listener { context.notifyPreferenceChange(KEY) } keyedObserver = KeyedObserver { _, _ -> context.notifyPreferenceChange(KEY) }
dataSaverBackendListener = listener dataSaverStore.addObserver(DATA_SAVER_KEY, keyedObserver, HandlerExecutor.main)
dataSaverBackend = DataSaverBackend(context).apply { addListener(listener) }
} }
override fun onStop(context: PreferenceLifecycleContext) { override fun onDestroy(context: PreferenceLifecycleContext) {
dataSaverBackend?.remListener(dataSaverBackendListener) dataSaverStore.removeObserver(DATA_SAVER_KEY, keyedObserver)
dataSaverBackend = null
dataSaverBackendListener = null
} }
companion object { companion object {

View File

@@ -90,11 +90,6 @@ public class NightDisplayActivationPreferenceController extends
} }
} }
@Override
public final void updateState(Preference preference) {
updateStateInternal();
}
/** FOR SLICES */ /** FOR SLICES */
@Override @Override
@@ -112,14 +107,4 @@ public class NightDisplayActivationPreferenceController extends
return mTimeFormatter.getAutoModeSummary(mContext, mColorDisplayManager); return mTimeFormatter.getAutoModeSummary(mContext, mColorDisplayManager);
} }
private void updateStateInternal() {
final boolean isActivated = mColorDisplayManager.isNightDisplayActivated();
final int autoMode = mColorDisplayManager.getNightDisplayAutoMode();
if (autoMode == ColorDisplayManager.AUTO_MODE_CUSTOM_TIME) {
mTimeFormatter.getFormattedTimeString(isActivated
? mColorDisplayManager.getNightDisplayCustomStartTime()
: mColorDisplayManager.getNightDisplayCustomEndTime());
}
}
} }

View File

@@ -332,9 +332,8 @@ public class BatteryChartView extends AppCompatImageView implements View.OnClick
setBackgroundColor(Color.TRANSPARENT); setBackgroundColor(Color.TRANSPARENT);
mTrapezoidSolidColor = Utils.getColorAccentDefaultColor(context); mTrapezoidSolidColor = Utils.getColorAccentDefaultColor(context);
mTrapezoidColor = Utils.getDisabled(context, mTrapezoidSolidColor); mTrapezoidColor = Utils.getDisabled(context, mTrapezoidSolidColor);
mTrapezoidHoverColor = mTrapezoidHoverColor = context.getColor(
Utils.getColorAttrDefaultColor( com.android.internal.R.color.materialColorSecondaryContainer);
context, com.android.internal.R.attr.materialColorSecondaryContainer);
// Initializes the divider line paint. // Initializes the divider line paint.
final Resources resources = getContext().getResources(); final Resources resources = getContext().getResources();
mDividerWidth = resources.getDimensionPixelSize(R.dimen.chartview_divider_width); mDividerWidth = resources.getDimensionPixelSize(R.dimen.chartview_divider_width);

View File

@@ -316,7 +316,6 @@ public class ModifierKeysPickerDialogFragment extends DialogFragment {
} }
private int getColorOfMaterialColorPrimary() { private int getColorOfMaterialColorPrimary() {
return Utils.getColorAttrDefaultColor( return mActivity.getColor(com.android.internal.R.color.materialColorPrimary);
mActivity, com.android.internal.R.attr.materialColorPrimary);
} }
} }

View File

@@ -36,7 +36,6 @@ import androidx.preference.PreferenceScreen;
import com.android.settings.R; import com.android.settings.R;
import com.android.settings.core.BasePreferenceController; import com.android.settings.core.BasePreferenceController;
import com.android.settings.overlay.FeatureFactory; import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.Utils;
import com.android.settingslib.widget.LayoutPreference; import com.android.settingslib.widget.LayoutPreference;
import java.util.ArrayList; import java.util.ArrayList;
@@ -202,8 +201,7 @@ public class ModifierKeysPreferenceController extends BasePreferenceController {
} }
private int getColorOfMaterialColorPrimary() { private int getColorOfMaterialColorPrimary() {
return Utils.getColorAttrDefaultColor( return mContext.getColor(com.android.internal.R.color.materialColorPrimary);
mContext, com.android.internal.R.attr.materialColorPrimary);
} }
private static boolean isCtrl(int keyCode) { private static boolean isCtrl(int keyCode) {

View File

@@ -28,7 +28,6 @@ import androidx.preference.PreferenceScreen;
import com.android.settings.R; import com.android.settings.R;
import com.android.settings.core.BasePreferenceController; import com.android.settings.core.BasePreferenceController;
import com.android.settingslib.Utils;
public class ModifierKeysRestorePreferenceController extends BasePreferenceController { public class ModifierKeysRestorePreferenceController extends BasePreferenceController {
@@ -88,7 +87,6 @@ public class ModifierKeysRestorePreferenceController extends BasePreferenceContr
} }
private int getColorOfMaterialColorPrimary() { private int getColorOfMaterialColorPrimary() {
return Utils.getColorAttrDefaultColor( return mParent.getActivity().getColor(com.android.internal.R.color.materialColorPrimary);
mParent.getActivity(), com.android.internal.R.attr.materialColorPrimary);
} }
} }

View File

@@ -152,7 +152,7 @@ class AirplaneModePreference :
data: Intent?, data: Intent?,
): Boolean { ): Boolean {
if (requestCode == REQUEST_CODE_EXIT_ECM && resultCode == Activity.RESULT_OK) { if (requestCode == REQUEST_CODE_EXIT_ECM && resultCode == Activity.RESULT_OK) {
storage(context).setValue(KEY, Boolean::class.javaObjectType, true) context.getKeyValueStore(KEY)?.setBoolean(KEY, true)
} }
return true return true
} }

View File

@@ -20,19 +20,27 @@ import android.net.TetheringManager
import android.os.UserManager import android.os.UserManager
import com.android.settings.PreferenceRestrictionMixin import com.android.settings.PreferenceRestrictionMixin
import com.android.settings.R import com.android.settings.R
import com.android.settings.Settings.TetherSettingsActivity
import com.android.settings.datausage.DataSaverMainSwitchPreference
import com.android.settings.flags.Flags import com.android.settings.flags.Flags
import com.android.settings.network.TetherPreferenceController import com.android.settings.network.TetherPreferenceController
import com.android.settings.utils.makeLaunchIntent
import com.android.settings.wifi.tether.WifiHotspotSwitchPreference import com.android.settings.wifi.tether.WifiHotspotSwitchPreference
import com.android.settingslib.TetherUtil import com.android.settingslib.TetherUtil
import com.android.settingslib.Utils import com.android.settingslib.Utils
import com.android.settingslib.metadata.PreferenceAvailabilityProvider import com.android.settingslib.metadata.PreferenceAvailabilityProvider
import com.android.settingslib.metadata.PreferenceMetadata
import com.android.settingslib.metadata.PreferenceTitleProvider
import com.android.settingslib.metadata.ProvidePreferenceScreen import com.android.settingslib.metadata.ProvidePreferenceScreen
import com.android.settingslib.metadata.preferenceHierarchy import com.android.settingslib.metadata.preferenceHierarchy
import com.android.settingslib.preference.PreferenceScreenCreator import com.android.settingslib.preference.PreferenceScreenCreator
@ProvidePreferenceScreen @ProvidePreferenceScreen
class TetherScreen : class TetherScreen :
PreferenceScreenCreator, PreferenceAvailabilityProvider, PreferenceRestrictionMixin { PreferenceScreenCreator,
PreferenceTitleProvider,
PreferenceAvailabilityProvider,
PreferenceRestrictionMixin {
override val key: String override val key: String
get() = KEY get() = KEY
@@ -43,7 +51,7 @@ class TetherScreen :
override val keywords: Int override val keywords: Int
get() = R.string.keywords_hotspot_tethering get() = R.string.keywords_hotspot_tethering
override fun getPreferenceTitle(context: Context): CharSequence? = override fun getTitle(context: Context): CharSequence? =
if (TetherPreferenceController.isTetherConfigDisallowed(context)) { if (TetherPreferenceController.isTetherConfigDisallowed(context)) {
context.getText(R.string.tether_settings_title_all) context.getText(R.string.tether_settings_title_all)
} else { } else {
@@ -64,9 +72,14 @@ class TetherScreen :
override fun fragmentClass() = TetherSettings::class.java override fun fragmentClass() = TetherSettings::class.java
override fun getPreferenceHierarchy(context: Context) = preferenceHierarchy(this) { override fun getLaunchIntent(context: Context, metadata: PreferenceMetadata?) =
+WifiHotspotSwitchPreference(context) makeLaunchIntent(context, TetherSettingsActivity::class.java, metadata?.key)
}
override fun getPreferenceHierarchy(context: Context) =
preferenceHierarchy(this) {
val dataSaverStore = DataSaverMainSwitchPreference.createDataStore(context)
+WifiHotspotSwitchPreference(context, dataSaverStore)
}
companion object { companion object {
const val KEY = "tether_settings" const val KEY = "tether_settings"

View File

@@ -23,6 +23,7 @@ import android.content.res.ColorStateList;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint; import android.graphics.Paint;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.Typeface; import android.graphics.Typeface;
@@ -36,6 +37,7 @@ import android.util.StateSet;
import android.view.Gravity; import android.view.Gravity;
import androidx.annotation.AttrRes; import androidx.annotation.AttrRes;
import androidx.annotation.ColorInt;
import androidx.annotation.DrawableRes; import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
@@ -81,21 +83,19 @@ class IconUtil {
Drawable base = composeIcons( Drawable base = composeIcons(
context.getResources(), context.getResources(),
background, background,
Utils.getColorAttr(context, context.getColor(com.android.internal.R.color.materialColorSecondaryContainer),
com.android.internal.R.attr.materialColorSecondaryContainer),
outerSizePx, outerSizePx,
modeIcon, modeIcon,
Utils.getColorAttr(context, context.getColor(com.android.internal.R.color.materialColorOnSecondaryContainer),
com.android.internal.R.attr.materialColorOnSecondaryContainer),
innerSizePx); innerSizePx);
Drawable selected = composeIcons( Drawable selected = composeIcons(
context.getResources(), context.getResources(),
background, background,
Utils.getColorAttr(context, com.android.internal.R.attr.materialColorPrimary), context.getColor(com.android.internal.R.color.materialColorPrimary),
outerSizePx, outerSizePx,
modeIcon, modeIcon,
Utils.getColorAttr(context, com.android.internal.R.attr.materialColorOnPrimary), context.getColor(com.android.internal.R.color.materialColorOnPrimary),
innerSizePx); innerSizePx);
StateListDrawable result = new StateListDrawable(); StateListDrawable result = new StateListDrawable();
@@ -114,13 +114,11 @@ class IconUtil {
static Drawable makeIconPickerHeader(@NonNull Context context, Drawable icon) { static Drawable makeIconPickerHeader(@NonNull Context context, Drawable icon) {
return composeIconCircle( return composeIconCircle(
context.getResources(), context.getResources(),
Utils.getColorAttr(context, context.getColor(com.android.internal.R.color.materialColorSecondaryContainer),
com.android.internal.R.attr.materialColorSecondaryContainer),
context.getResources().getDimensionPixelSize( context.getResources().getDimensionPixelSize(
R.dimen.zen_mode_icon_list_header_circle_diameter), R.dimen.zen_mode_icon_list_header_circle_diameter),
icon, icon,
Utils.getColorAttr(context, context.getColor(com.android.internal.R.color.materialColorOnSecondaryContainer),
com.android.internal.R.attr.materialColorOnSecondaryContainer),
context.getResources().getDimensionPixelSize( context.getResources().getDimensionPixelSize(
R.dimen.zen_mode_icon_list_header_icon_size)); R.dimen.zen_mode_icon_list_header_icon_size));
} }
@@ -151,13 +149,11 @@ class IconUtil {
@DrawableRes int iconResId) { @DrawableRes int iconResId) {
return composeIconCircle( return composeIconCircle(
context.getResources(), context.getResources(),
Utils.getColorAttr(context, context.getColor(com.android.internal.R.color.materialColorSecondaryContainer),
com.android.internal.R.attr.materialColorSecondaryContainer),
context.getResources().getDimensionPixelSize( context.getResources().getDimensionPixelSize(
R.dimen.zen_mode_circular_icon_diameter), R.dimen.zen_mode_circular_icon_diameter),
checkNotNull(context.getDrawable(iconResId)), checkNotNull(context.getDrawable(iconResId)),
Utils.getColorAttr(context, context.getColor(com.android.internal.R.color.materialColorOnSecondaryContainer),
com.android.internal.R.attr.materialColorOnSecondaryContainer),
context.getResources().getDimensionPixelSize( context.getResources().getDimensionPixelSize(
R.dimen.zen_mode_circular_icon_inner_icon_size)); R.dimen.zen_mode_circular_icon_inner_icon_size));
} }
@@ -172,12 +168,10 @@ class IconUtil {
if (Strings.isNullOrEmpty(displayName)) { if (Strings.isNullOrEmpty(displayName)) {
return composeIconCircle( return composeIconCircle(
context.getResources(), context.getResources(),
Utils.getColorAttr(context, context.getColor(com.android.internal.R.color.materialColorTertiaryContainer),
com.android.internal.R.attr.materialColorTertiaryContainer),
res.getDimensionPixelSize(R.dimen.zen_mode_circular_icon_diameter), res.getDimensionPixelSize(R.dimen.zen_mode_circular_icon_diameter),
checkNotNull(context.getDrawable(R.drawable.ic_zen_mode_generic_contact)), checkNotNull(context.getDrawable(R.drawable.ic_zen_mode_generic_contact)),
Utils.getColorAttr(context, context.getColor(com.android.internal.R.color.materialColorOnTertiaryContainer),
com.android.internal.R.attr.materialColorOnTertiaryContainer),
res.getDimensionPixelSize(R.dimen.zen_mode_circular_icon_inner_icon_size)); res.getDimensionPixelSize(R.dimen.zen_mode_circular_icon_inner_icon_size));
} }
@@ -187,14 +181,14 @@ class IconUtil {
Canvas canvas = new Canvas(bitmap); Canvas canvas = new Canvas(bitmap);
Paint circlePaint = new Paint(); Paint circlePaint = new Paint();
circlePaint.setColor(Utils.getColorAttrDefaultColor(context, circlePaint.setColor(context.getColor(
com.android.internal.R.attr.materialColorTertiaryContainer)); com.android.internal.R.color.materialColorTertiaryContainer));
circlePaint.setFlags(Paint.ANTI_ALIAS_FLAG); circlePaint.setFlags(Paint.ANTI_ALIAS_FLAG);
canvas.drawCircle(diameter / 2f, diameter / 2f, diameter / 2f, circlePaint); canvas.drawCircle(diameter / 2f, diameter / 2f, diameter / 2f, circlePaint);
Paint textPaint = new Paint(); Paint textPaint = new Paint();
textPaint.setColor(Utils.getColorAttrDefaultColor(context, textPaint.setColor(context.getColor(
com.android.internal.R.attr.materialColorOnTertiaryContainer)); com.android.internal.R.color.materialColorOnTertiaryContainer));
textPaint.setTypeface(Typeface.create("sans-serif", Typeface.NORMAL)); textPaint.setTypeface(Typeface.create("sans-serif", Typeface.NORMAL));
textPaint.setTextAlign(Paint.Align.LEFT); textPaint.setTextAlign(Paint.Align.LEFT);
textPaint.setTextSize(res.getDimensionPixelSize(R.dimen.zen_mode_circular_icon_text_size)); textPaint.setTextSize(res.getDimensionPixelSize(R.dimen.zen_mode_circular_icon_text_size));
@@ -210,12 +204,24 @@ class IconUtil {
return new BitmapDrawable(context.getResources(), bitmap); return new BitmapDrawable(context.getResources(), bitmap);
} }
private static Drawable composeIconCircle(Resources res, @ColorInt int circleColor,
@Px int circleDiameterPx, Drawable icon, @ColorInt int iconColor, @Px int iconSizePx) {
return composeIconCircle(res, ColorStateList.valueOf(circleColor), circleDiameterPx, icon,
ColorStateList.valueOf(iconColor), iconSizePx);
}
private static Drawable composeIconCircle(Resources res, ColorStateList circleColor, private static Drawable composeIconCircle(Resources res, ColorStateList circleColor,
@Px int circleDiameterPx, Drawable icon, ColorStateList iconColor, @Px int iconSizePx) { @Px int circleDiameterPx, Drawable icon, ColorStateList iconColor, @Px int iconSizePx) {
return composeIcons(res, new ShapeDrawable(new OvalShape()), circleColor, circleDiameterPx, return composeIcons(res, new ShapeDrawable(new OvalShape()), circleColor, circleDiameterPx,
icon, iconColor, iconSizePx); icon, iconColor, iconSizePx);
} }
private static Drawable composeIcons(Resources res, Drawable outer, @ColorInt int outerColor,
@Px int outerSizePx, Drawable icon, @ColorInt int iconColor, @Px int iconSizePx) {
return composeIcons(res, outer, ColorStateList.valueOf(outerColor), outerSizePx, icon,
ColorStateList.valueOf(iconColor), iconSizePx);
}
private static Drawable composeIcons(Resources res, Drawable outer, ColorStateList outerColor, private static Drawable composeIcons(Resources res, Drawable outer, ColorStateList outerColor,
@Px int outerSizePx, Drawable icon, ColorStateList iconColor, @Px int iconSizePx) { @Px int outerSizePx, Drawable icon, ColorStateList iconColor, @Px int iconSizePx) {
Drawable background = mutateDrawable(res, outer); Drawable background = mutateDrawable(res, outer);

View File

@@ -26,6 +26,14 @@ import androidx.preference.Preference
import androidx.preference.PreferenceViewHolder import androidx.preference.PreferenceViewHolder
import com.android.settings.R import com.android.settings.R
import com.android.settingslib.spa.framework.theme.SettingsTheme import com.android.settingslib.spa.framework.theme.SettingsTheme
import com.android.settingslib.widget.GroupSectionDividerMixin
open class ComposeMainSwitchPreference @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0,
defStyleRes: Int = 0,
) : ComposePreference(context, attrs, defStyleAttr, defStyleRes), GroupSectionDividerMixin
open class ComposePreference @JvmOverloads constructor( open class ComposePreference @JvmOverloads constructor(
context: Context, context: Context,

View File

@@ -56,10 +56,10 @@ public class LabeledSeekBarPreference extends SeekBarPreference {
private final int mTextStartId; private final int mTextStartId;
private final int mTextEndId; private final int mTextEndId;
private final int mTickMarkId; private final int mTickMarkId;
private final int mIconStartId; private int mIconStartId;
private final int mIconEndId; private int mIconEndId;
private final int mIconStartContentDescriptionId; private int mIconStartContentDescriptionId;
private final int mIconEndContentDescriptionId; private int mIconEndContentDescriptionId;
private OnPreferenceChangeListener mStopListener; private OnPreferenceChangeListener mStopListener;
private SeekBar.OnSeekBarChangeListener mSeekBarChangeListener; private SeekBar.OnSeekBarChangeListener mSeekBarChangeListener;
@@ -110,6 +110,38 @@ public class LabeledSeekBarPreference extends SeekBarPreference {
return mSeekBar; return mSeekBar;
} }
/** Set the start icon of the Seekbar. */
public void setIconStart(int iconStartId) {
if (mIconStartId != iconStartId) {
mIconStartId = iconStartId;
notifyChanged();
}
}
/** Set the description resource id of the start icon. */
public void setIconStartContentDescription(int iconStartContentDescriptionId) {
if (mIconStartContentDescriptionId != iconStartContentDescriptionId) {
mIconStartContentDescriptionId = iconStartContentDescriptionId;
notifyChanged();
}
}
/** Set the end icon of the Seekbar. */
public void setIconEnd(int iconEndId) {
if (mIconEndId != iconEndId) {
mIconEndId = iconEndId;
notifyChanged();
}
}
/** Set the description resource id of the end icon. */
public void setIconEndContentDescription(int iconEndContentDescriptionId) {
if (mIconEndContentDescriptionId != iconEndContentDescriptionId) {
mIconEndContentDescriptionId = iconEndContentDescriptionId;
notifyChanged();
}
}
@Override @Override
public void onBindViewHolder(PreferenceViewHolder holder) { public void onBindViewHolder(PreferenceViewHolder holder) {
super.onBindViewHolder(holder); super.onBindViewHolder(holder);

View File

@@ -25,8 +25,6 @@ import android.os.Looper
import android.os.Process import android.os.Process
import android.os.SimpleClock import android.os.SimpleClock
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.width
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableIntStateOf
@@ -34,7 +32,6 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalLifecycleOwner import androidx.compose.ui.platform.LocalLifecycleOwner
import androidx.compose.ui.res.stringArrayResource import androidx.compose.ui.res.stringArrayResource
@@ -44,14 +41,13 @@ import androidx.navigation.navArgument
import com.android.settings.R import com.android.settings.R
import com.android.settings.overlay.FeatureFactory.Companion.featureFactory import com.android.settings.overlay.FeatureFactory.Companion.featureFactory
import com.android.settingslib.spa.framework.common.SettingsPageProvider import com.android.settingslib.spa.framework.common.SettingsPageProvider
import com.android.settingslib.spa.framework.theme.SettingsDimension
import com.android.settingslib.spa.widget.preference.ListPreferenceModel import com.android.settingslib.spa.widget.preference.ListPreferenceModel
import com.android.settingslib.spa.widget.preference.ListPreferenceOption import com.android.settingslib.spa.widget.preference.ListPreferenceOption
import com.android.settingslib.spa.widget.preference.RadioPreferences import com.android.settingslib.spa.widget.preference.RadioPreferences
import com.android.settingslib.spa.widget.preference.SwitchPreference import com.android.settingslib.spa.widget.preference.SwitchPreference
import com.android.settingslib.spa.widget.preference.SwitchPreferenceModel import com.android.settingslib.spa.widget.preference.SwitchPreferenceModel
import com.android.settingslib.spa.widget.scaffold.RegularScaffold import com.android.settingslib.spa.widget.scaffold.RegularScaffold
import com.android.settingslib.spa.widget.ui.CategoryTitle import com.android.settingslib.spa.widget.ui.Category
import com.android.wifitrackerlib.WifiEntry import com.android.wifitrackerlib.WifiEntry
import java.time.Clock import java.time.Clock
import java.time.ZoneOffset import java.time.ZoneOffset
@@ -123,34 +119,34 @@ fun WifiPrivacyPage(wifiEntry: WifiEntry) {
@Composable @Composable
fun DeviceNameSwitchPreference(wifiEntry: WifiEntry) { fun DeviceNameSwitchPreference(wifiEntry: WifiEntry) {
Spacer(modifier = Modifier.width(SettingsDimension.itemDividerHeight)) val title = stringResource(id = R.string.wifi_privacy_device_name_settings)
CategoryTitle(title = stringResource(R.string.wifi_privacy_device_name_settings)) Category(title = title) {
Spacer(modifier = Modifier.width(SettingsDimension.itemDividerHeight)) var checked by remember {
var checked by remember { mutableStateOf(wifiEntry.wifiConfiguration?.isSendDhcpHostnameEnabled)
mutableStateOf(wifiEntry.wifiConfiguration?.isSendDhcpHostnameEnabled)
}
val context = LocalContext.current
val wifiManager = context.getSystemService(WifiManager::class.java)!!
SwitchPreference(object : SwitchPreferenceModel {
override val title =
context.resources.getString(
R.string.wifi_privacy_send_device_name_toggle_title
)
override val summary =
{
context.resources.getString(
R.string.wifi_privacy_send_device_name_toggle_summary
)
}
override val checked = { checked }
override val onCheckedChange: (Boolean) -> Unit = { newChecked ->
wifiEntry.wifiConfiguration?.let {
it.isSendDhcpHostnameEnabled = newChecked
wifiManager.save(it, null /* listener */)
checked = newChecked
}
} }
}) val context = LocalContext.current
val wifiManager = context.getSystemService(WifiManager::class.java)!!
SwitchPreference(object : SwitchPreferenceModel {
override val title =
context.resources.getString(
R.string.wifi_privacy_send_device_name_toggle_title
)
override val summary =
{
context.resources.getString(
R.string.wifi_privacy_send_device_name_toggle_summary
)
}
override val checked = { checked }
override val onCheckedChange: (Boolean) -> Unit = { newChecked ->
wifiEntry.wifiConfiguration?.let {
it.isSendDhcpHostnameEnabled = newChecked
wifiManager.save(it, null /* listener */)
checked = newChecked
}
}
})
}
} }
fun onSelectedChange(wifiEntry: WifiEntry, privacy: Int) { fun onSelectedChange(wifiEntry: WifiEntry, privacy: Int) {

View File

@@ -20,6 +20,7 @@ import android.app.settings.SettingsEnums
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.net.TetheringManager import android.net.TetheringManager
import android.net.TetheringManager.TETHERING_WIFI
import android.net.wifi.WifiClient import android.net.wifi.WifiClient
import android.net.wifi.WifiManager import android.net.wifi.WifiManager
import android.os.UserManager import android.os.UserManager
@@ -30,7 +31,7 @@ import com.android.settings.PreferenceRestrictionMixin
import com.android.settings.R import com.android.settings.R
import com.android.settings.Utils import com.android.settings.Utils
import com.android.settings.core.SubSettingLauncher import com.android.settings.core.SubSettingLauncher
import com.android.settings.datausage.DataSaverBackend import com.android.settings.datausage.DataSaverMainSwitchPreference.Companion.KEY as DATA_SAVER_KEY
import com.android.settings.wifi.WifiUtils.canShowWifiHotspot import com.android.settings.wifi.WifiUtils.canShowWifiHotspot
import com.android.settingslib.PrimarySwitchPreference import com.android.settingslib.PrimarySwitchPreference
import com.android.settingslib.TetherUtil import com.android.settingslib.TetherUtil
@@ -38,9 +39,8 @@ import com.android.settingslib.datastore.AbstractKeyedDataObservable
import com.android.settingslib.datastore.DataChangeReason import com.android.settingslib.datastore.DataChangeReason
import com.android.settingslib.datastore.HandlerExecutor import com.android.settingslib.datastore.HandlerExecutor
import com.android.settingslib.datastore.KeyValueStore import com.android.settingslib.datastore.KeyValueStore
import com.android.settingslib.datastore.KeyedObserver
import com.android.settingslib.metadata.PreferenceAvailabilityProvider import com.android.settingslib.metadata.PreferenceAvailabilityProvider
import com.android.settingslib.metadata.PreferenceLifecycleContext
import com.android.settingslib.metadata.PreferenceLifecycleProvider
import com.android.settingslib.metadata.PreferenceMetadata import com.android.settingslib.metadata.PreferenceMetadata
import com.android.settingslib.metadata.PreferenceSummaryProvider import com.android.settingslib.metadata.PreferenceSummaryProvider
import com.android.settingslib.metadata.ReadWritePermit import com.android.settingslib.metadata.ReadWritePermit
@@ -50,20 +50,15 @@ import com.android.settingslib.preference.PreferenceBinding
import com.android.settingslib.wifi.WifiUtils.Companion.getWifiTetherSummaryForConnectedDevices import com.android.settingslib.wifi.WifiUtils.Companion.getWifiTetherSummaryForConnectedDevices
// LINT.IfChange // LINT.IfChange
@Deprecated("Deprecated in Java")
@Suppress("MissingPermission", "NewApi", "UNCHECKED_CAST") @Suppress("MissingPermission", "NewApi", "UNCHECKED_CAST")
class WifiHotspotSwitchPreference(context: Context) : class WifiHotspotSwitchPreference(context: Context, dataSaverStore: KeyValueStore) :
SwitchPreference(KEY, R.string.wifi_hotspot_checkbox_text), SwitchPreference(KEY, R.string.wifi_hotspot_checkbox_text),
PreferenceBinding, PreferenceBinding,
PreferenceAvailabilityProvider, PreferenceAvailabilityProvider,
PreferenceSummaryProvider, PreferenceSummaryProvider,
PreferenceLifecycleProvider,
PreferenceRestrictionMixin { PreferenceRestrictionMixin {
private val wifiHotspotStore = WifiHotspotStore(context) private val wifiHotspotStore = WifiHotspotStore(context, dataSaverStore)
private val dataSaverBackend = DataSaverBackend(context)
private var dataSaverBackendListener: DataSaverBackend.Listener? = null
override fun isAvailable(context: Context) = override fun isAvailable(context: Context) =
canShowWifiHotspot(context) && canShowWifiHotspot(context) &&
@@ -71,22 +66,19 @@ class WifiHotspotSwitchPreference(context: Context) :
!Utils.isMonkeyRunning() !Utils.isMonkeyRunning()
override fun getSummary(context: Context): CharSequence? = override fun getSummary(context: Context): CharSequence? =
when (wifiHotspotStore.sapState) { when (context.wifiManager?.wifiApState) {
WifiManager.WIFI_AP_STATE_ENABLING -> context.getString(R.string.wifi_tether_starting) WifiManager.WIFI_AP_STATE_ENABLING -> context.getString(R.string.wifi_tether_starting)
WifiManager.WIFI_AP_STATE_ENABLED -> WifiManager.WIFI_AP_STATE_ENABLED -> {
when (wifiHotspotStore.sapClientsSize) { val sapClientsSize = wifiHotspotStore.sapClientsSize
null -> if (sapClientsSize == null) {
context.getString( context.getString(
R.string.wifi_tether_enabled_subtext, R.string.wifi_tether_enabled_subtext,
BidiFormatter.getInstance() BidiFormatter.getInstance().unicodeWrap(context.wifiSsid),
.unicodeWrap(context.getSoftApConfiguration()?.ssid), )
) } else {
else -> getWifiTetherSummaryForConnectedDevices(context, sapClientsSize)
getWifiTetherSummaryForConnectedDevices(
context,
wifiHotspotStore.sapClientsSize!!,
)
} }
}
WifiManager.WIFI_AP_STATE_DISABLING -> context.getString(R.string.wifi_tether_stopping) WifiManager.WIFI_AP_STATE_DISABLING -> context.getString(R.string.wifi_tether_stopping)
WifiManager.WIFI_AP_STATE_DISABLED -> WifiManager.WIFI_AP_STATE_DISABLED ->
context.getString(R.string.wifi_hotspot_off_subtext) context.getString(R.string.wifi_hotspot_off_subtext)
@@ -108,7 +100,8 @@ class WifiHotspotSwitchPreference(context: Context) :
.toIntent() .toIntent()
override fun isEnabled(context: Context) = override fun isEnabled(context: Context) =
!dataSaverBackend.isDataSaverEnabled && super<PreferenceRestrictionMixin>.isEnabled(context) wifiHotspotStore.dataSaverStore.getBoolean(DATA_SAVER_KEY) == true &&
super<PreferenceRestrictionMixin>.isEnabled(context)
override val restrictionKeys override val restrictionKeys
get() = arrayOf(UserManager.DISALLOW_WIFI_TETHERING) get() = arrayOf(UserManager.DISALLOW_WIFI_TETHERING)
@@ -117,10 +110,7 @@ class WifiHotspotSwitchPreference(context: Context) :
ReadWritePermit.ALLOW ReadWritePermit.ALLOW
override fun getWritePermit(context: Context, value: Boolean?, myUid: Int, callingUid: Int) = override fun getWritePermit(context: Context, value: Boolean?, myUid: Int, callingUid: Int) =
when { ReadWritePermit.ALLOW
dataSaverBackend.isDataSaverEnabled -> ReadWritePermit.DISALLOW
else -> ReadWritePermit.ALLOW
}
override val sensitivityLevel override val sensitivityLevel
get() = SensitivityLevel.HIGH_SENSITIVITY get() = SensitivityLevel.HIGH_SENSITIVITY
@@ -129,11 +119,17 @@ class WifiHotspotSwitchPreference(context: Context) :
override fun storage(context: Context): KeyValueStore = wifiHotspotStore override fun storage(context: Context): KeyValueStore = wifiHotspotStore
private class WifiHotspotStore(private val context: Context) : private class WifiHotspotStore(
AbstractKeyedDataObservable<String>(), KeyValueStore { private val context: Context,
val dataSaverStore: KeyValueStore,
) :
AbstractKeyedDataObservable<String>(),
KeyValueStore,
WifiTetherSoftApManager.WifiTetherSoftApCallback,
TetheringManager.StartTetheringCallback,
KeyedObserver<String> {
private var wifiTetherSoftApManager: WifiTetherSoftApManager? = null private var wifiTetherSoftApManager: WifiTetherSoftApManager? = null
var sapState: Int = WifiManager.WIFI_AP_STATE_DISABLED
var sapFailureReason: Int? = null var sapFailureReason: Int? = null
var sapClientsSize: Int? = null var sapClientsSize: Int? = null
@@ -150,54 +146,47 @@ class WifiHotspotSwitchPreference(context: Context) :
override fun <T : Any> setValue(key: String, valueType: Class<T>, value: T?) { override fun <T : Any> setValue(key: String, valueType: Class<T>, value: T?) {
if (value !is Boolean) return if (value !is Boolean) return
context.tetheringManager?.let { val tetheringManager = context.tetheringManager ?: return
if (value) { if (value) {
val startTetheringCallback = tetheringManager.startTethering(TETHERING_WIFI, HandlerExecutor.main, this)
object : TetheringManager.StartTetheringCallback { } else {
override fun onTetheringStarted() { tetheringManager.stopTethering(TETHERING_WIFI)
Log.d(TAG, "onTetheringStarted()")
}
override fun onTetheringFailed(error: Int) {
Log.e(TAG, "onTetheringFailed(),error=$error")
}
}
it.startTethering(
TetheringManager.TETHERING_WIFI,
HandlerExecutor.main,
startTetheringCallback,
)
} else {
it.stopTethering(TetheringManager.TETHERING_WIFI)
}
} }
} }
override fun onFirstObserverAdded() { override fun onFirstObserverAdded() {
val wifiSoftApCallback = val apManager = WifiTetherSoftApManager(context.wifiManager, this)
object : WifiTetherSoftApManager.WifiTetherSoftApCallback { wifiTetherSoftApManager = apManager
override fun onStateChanged(state: Int, failureReason: Int) { apManager.registerSoftApCallback()
Log.d(TAG, "onStateChanged(),state=$state,failureReason=$failureReason") dataSaverStore.addObserver(DATA_SAVER_KEY, this, HandlerExecutor.main)
sapState = state
sapFailureReason = failureReason
if (state == WifiManager.WIFI_AP_STATE_DISABLED) sapClientsSize = null
notifyChange(KEY, DataChangeReason.UPDATE)
}
override fun onConnectedClientsChanged(clients: List<WifiClient>?) {
sapClientsSize = clients?.size ?: 0
Log.d(TAG, "onConnectedClientsChanged(),sapClientsSize=$sapClientsSize")
notifyChange(KEY, DataChangeReason.UPDATE)
}
}
wifiTetherSoftApManager =
WifiTetherSoftApManager(context.wifiManager, wifiSoftApCallback)
wifiTetherSoftApManager?.registerSoftApCallback()
} }
override fun onLastObserverRemoved() { override fun onLastObserverRemoved() {
dataSaverStore.removeObserver(DATA_SAVER_KEY, this)
wifiTetherSoftApManager?.unRegisterSoftApCallback() wifiTetherSoftApManager?.unRegisterSoftApCallback()
} }
override fun onStateChanged(state: Int, failureReason: Int) {
Log.d(TAG, "onStateChanged(),state=$state,failureReason=$failureReason")
sapFailureReason = failureReason
if (state == WifiManager.WIFI_AP_STATE_DISABLED) sapClientsSize = null
notifyChange(KEY, DataChangeReason.UPDATE)
}
override fun onConnectedClientsChanged(clients: List<WifiClient>?) {
sapClientsSize = clients?.size ?: 0
Log.d(TAG, "onConnectedClientsChanged(),sapClientsSize=$sapClientsSize")
notifyChange(KEY, DataChangeReason.UPDATE)
}
override fun onTetheringStarted() {}
override fun onTetheringFailed(error: Int) {
Log.e(TAG, "onTetheringFailed(),error=$error")
}
override fun onKeyChanged(key: String, reason: Int) =
notifyChange(KEY, DataChangeReason.UPDATE)
} }
override fun bind(preference: Preference, metadata: PreferenceMetadata) { override fun bind(preference: Preference, metadata: PreferenceMetadata) {
@@ -207,24 +196,6 @@ class WifiHotspotSwitchPreference(context: Context) :
} }
} }
override fun onStart(context: PreferenceLifecycleContext) {
val listener =
DataSaverBackend.Listener { isDataSaving: Boolean ->
context.findPreference<PrimarySwitchPreference>(KEY)?.isSwitchEnabled =
!isDataSaving
context.notifyPreferenceChange(KEY)
}
dataSaverBackendListener = listener
dataSaverBackend.addListener(listener)
}
override fun onStop(context: PreferenceLifecycleContext) {
dataSaverBackendListener?.let {
dataSaverBackend.remListener(it)
dataSaverBackendListener = null
}
}
companion object { companion object {
const val TAG = "WifiHotspotSwitchPreference" const val TAG = "WifiHotspotSwitchPreference"
const val KEY = "wifi_tether" const val KEY = "wifi_tether"
@@ -232,7 +203,9 @@ class WifiHotspotSwitchPreference(context: Context) :
private val Context.wifiManager: WifiManager? private val Context.wifiManager: WifiManager?
get() = applicationContext.getSystemService(WifiManager::class.java) get() = applicationContext.getSystemService(WifiManager::class.java)
private fun Context.getSoftApConfiguration() = wifiManager?.softApConfiguration @Suppress("DEPRECATION")
private val Context.wifiSsid
get() = wifiManager?.softApConfiguration?.ssid
private val Context.tetheringManager: TetheringManager? private val Context.tetheringManager: TetheringManager?
get() = applicationContext.getSystemService(TetheringManager::class.java) get() = applicationContext.getSystemService(TetheringManager::class.java)

View File

@@ -72,6 +72,6 @@ class VibrationMainSwitchPreferenceTest {
preference.createAndBindWidget(context) preference.createAndBindWidget(context)
private fun setVibrateOn(enabled: Boolean?) = private fun setVibrateOn(enabled: Boolean?) =
preference.storage(context).setValue(VIBRATE_ON, Boolean::class.javaObjectType, enabled) preference.storage(context).setBoolean(VIBRATE_ON, enabled)
} }
// LINT.ThenChange(VibrationMainSwitchPreferenceControllerTest.java) // LINT.ThenChange(VibrationMainSwitchPreferenceControllerTest.java)

View File

@@ -64,6 +64,7 @@ import com.android.settings.R;
import com.android.settings.Settings; import com.android.settings.Settings;
import com.android.settings.biometrics.BiometricEnrollBase; import com.android.settings.biometrics.BiometricEnrollBase;
import com.android.settings.biometrics.BiometricUtils; import com.android.settings.biometrics.BiometricUtils;
import com.android.settings.flags.Flags;
import com.android.settings.password.ChooseLockSettingsHelper; import com.android.settings.password.ChooseLockSettingsHelper;
import com.android.settings.testutils.FakeFeatureFactory; import com.android.settings.testutils.FakeFeatureFactory;
import com.android.settings.testutils.shadow.SettingsShadowResources; import com.android.settings.testutils.shadow.SettingsShadowResources;
@@ -402,7 +403,9 @@ public class FaceEnrollIntroductionTest {
assertThat(getGlifLayout(mActivity).getDescriptionText().toString()).isEqualTo( assertThat(getGlifLayout(mActivity).getDescriptionText().toString()).isEqualTo(
mContext.getString( mContext.getString(
R.string.security_settings_face_enroll_introduction_message_class3)); Flags.biometricsOnboardingEducation()
? R.string.security_settings_face_enroll_introduction_message_class3_2
: R.string.security_settings_face_enroll_introduction_message_class3));
assertThat(mActivity.findViewById(R.id.info_row_less_secure).getVisibility()).isEqualTo( assertThat(mActivity.findViewById(R.id.info_row_less_secure).getVisibility()).isEqualTo(
View.GONE); View.GONE);
} }

View File

@@ -29,21 +29,17 @@ import org.junit.runner.RunWith
import org.mockito.kotlin.spy import org.mockito.kotlin.spy
import org.mockito.kotlin.verify import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever import org.mockito.kotlin.whenever
import org.robolectric.RuntimeEnvironment
@RunWith(AndroidJUnit4::class) @RunWith(AndroidJUnit4::class)
class BluetoothMainSwitchPreferenceTest { class BluetoothMainSwitchPreferenceTest {
@get:Rule @get:Rule val setFlagsRule = SetFlagsRule()
val setFlagsRule = SetFlagsRule()
private val context: Context = ApplicationProvider.getApplicationContext() private val context: Context = ApplicationProvider.getApplicationContext()
private lateinit var bluetoothAdapter: BluetoothAdapter private lateinit var bluetoothAdapter: BluetoothAdapter
private lateinit var bluetoothMainSwitchPreference: BluetoothMainSwitchPreference private lateinit var bluetoothMainSwitchPreference: BluetoothMainSwitchPreference
@Before @Before
fun setUp() { fun setUp() {
bluetoothAdapter = spy( bluetoothAdapter = spy(BluetoothAdapter.getDefaultAdapter())
BluetoothAdapter.getDefaultAdapter()
)
whenever(bluetoothAdapter.state).thenReturn(BluetoothAdapter.STATE_ON) whenever(bluetoothAdapter.state).thenReturn(BluetoothAdapter.STATE_ON)
bluetoothMainSwitchPreference = BluetoothMainSwitchPreference(bluetoothAdapter) bluetoothMainSwitchPreference = BluetoothMainSwitchPreference(bluetoothAdapter)
} }
@@ -62,19 +58,19 @@ class BluetoothMainSwitchPreferenceTest {
@Test @Test
fun storageSetOff_turnOff() { fun storageSetOff_turnOff() {
bluetoothMainSwitchPreference.storage(context).setValue( bluetoothMainSwitchPreference
bluetoothMainSwitchPreference.key, Boolean::class.javaObjectType, false .storage(context)
) .setBoolean(bluetoothMainSwitchPreference.key, false)
verify(bluetoothAdapter).disable() verify(bluetoothAdapter).disable()
} }
@Test @Test
fun storageSetOn_turnOn() { fun storageSetOn_turnOn() {
bluetoothMainSwitchPreference.storage(context).setValue( bluetoothMainSwitchPreference
bluetoothMainSwitchPreference.key, Boolean::class.javaObjectType, true .storage(context)
) .setBoolean(bluetoothMainSwitchPreference.key, true)
verify(bluetoothAdapter).enable() verify(bluetoothAdapter).enable()
} }
} }

View File

@@ -16,13 +16,16 @@
package com.android.settings.datausage package com.android.settings.datausage
import androidx.test.core.app.ApplicationProvider
import com.android.settings.flags.Flags import com.android.settings.flags.Flags
import com.android.settingslib.preference.CatalystScreenTestCase import com.android.settingslib.preference.CatalystScreenTestCase
import com.google.common.truth.Truth.assertThat import com.google.common.truth.Truth.assertThat
import org.junit.Test import org.junit.Test
class DataSaverScreenTest : CatalystScreenTestCase() { class DataSaverScreenTest : CatalystScreenTestCase() {
override val preferenceScreenCreator = DataSaverScreen() override val preferenceScreenCreator =
DataSaverScreen(ApplicationProvider.getApplicationContext())
override val flagName override val flagName
get() = Flags.FLAG_CATALYST_RESTRICT_BACKGROUND_PARENT_ENTRY get() = Flags.FLAG_CATALYST_RESTRICT_BACKGROUND_PARENT_ENTRY

View File

@@ -117,11 +117,8 @@ class BatteryPercentageSwitchPreferenceTest {
batteryPercentageSwitchPreference.createAndBindWidget(context) batteryPercentageSwitchPreference.createAndBindWidget(context)
private fun showBatteryPercentage(on: Boolean) = private fun showBatteryPercentage(on: Boolean) =
batteryPercentageSwitchPreference batteryPercentageSwitchPreference.storage(context).setBoolean(
.storage(context)
.setValue(
Settings.System.SHOW_BATTERY_PERCENT, Settings.System.SHOW_BATTERY_PERCENT,
Boolean::class.javaObjectType,
on, on,
) )
} }

View File

@@ -75,18 +75,14 @@ class BatterySaverPreferenceTest {
@Test @Test
fun storeSetOn_setPowerSaveMode() { fun storeSetOn_setPowerSaveMode() {
batterySaverPreference batterySaverPreference.storage(context).setBoolean(batterySaverPreference.key, true)
.storage(context)
.setValue(batterySaverPreference.key, Boolean::class.javaObjectType, true)
verify(powerManager).setPowerSaveModeEnabled(true) verify(powerManager).setPowerSaveModeEnabled(true)
} }
@Test @Test
fun storeSetOff_unsetPowerSaveMode() { fun storeSetOff_unsetPowerSaveMode() {
batterySaverPreference batterySaverPreference.storage(context).setBoolean(batterySaverPreference.key, false)
.storage(context)
.setValue(batterySaverPreference.key, Boolean::class.javaObjectType, false)
verify(powerManager).setPowerSaveModeEnabled(false) verify(powerManager).setPowerSaveModeEnabled(false)
} }

View File

@@ -96,11 +96,11 @@ class AdaptiveConnectivityTogglePreferenceTest {
private fun setAdaptiveConnectivityEnabled(enabled: Boolean) = private fun setAdaptiveConnectivityEnabled(enabled: Boolean) =
adaptiveConnectivityTogglePreference adaptiveConnectivityTogglePreference
.storage(context) .storage(context)
.setValue(ADAPTIVE_CONNECTIVITY_ENABLED, Boolean::class.javaObjectType, enabled) .setBoolean(ADAPTIVE_CONNECTIVITY_ENABLED, enabled)
private fun getAdaptiveConnectivityEnabled() = private fun getAdaptiveConnectivityEnabled() =
adaptiveConnectivityTogglePreference adaptiveConnectivityTogglePreference
.storage(context) .storage(context)
.getValue(ADAPTIVE_CONNECTIVITY_ENABLED, Boolean::class.javaObjectType) .getBoolean(ADAPTIVE_CONNECTIVITY_ENABLED)
} }
// LINT.ThenChange(AdaptiveConnectivityTogglePreferenceControllerTest.java) // LINT.ThenChange(AdaptiveConnectivityTogglePreferenceControllerTest.java)

View File

@@ -88,9 +88,7 @@ class AirplaneModePreferenceTest {
SettingsGlobalStore.get(context).setInt(Settings.Global.AIRPLANE_MODE_ON, 1) SettingsGlobalStore.get(context).setInt(Settings.Global.AIRPLANE_MODE_ON, 1)
val getValue = val getValue =
airplaneModePreference airplaneModePreference.storage(context).getBoolean(AirplaneModePreference.KEY)
.storage(context)
.getValue(AirplaneModePreference.KEY, Boolean::class.javaObjectType)
assertThat(getValue).isTrue() assertThat(getValue).isTrue()
} }
@@ -100,9 +98,7 @@ class AirplaneModePreferenceTest {
SettingsGlobalStore.get(context).setInt(Settings.Global.AIRPLANE_MODE_ON, 0) SettingsGlobalStore.get(context).setInt(Settings.Global.AIRPLANE_MODE_ON, 0)
val getValue = val getValue =
airplaneModePreference airplaneModePreference.storage(context).getBoolean(AirplaneModePreference.KEY)
.storage(context)
.getValue(AirplaneModePreference.KEY, Boolean::class.javaObjectType)
assertThat(getValue).isFalse() assertThat(getValue).isFalse()
} }

View File

@@ -49,9 +49,7 @@ class WifiSwitchPreferenceTest {
fun getValue_defaultOn_returnOn() { fun getValue_defaultOn_returnOn() {
mockWifiManager.stub { on { isWifiEnabled } doReturn true } mockWifiManager.stub { on { isWifiEnabled } doReturn true }
val getValue = wifiSwitchPreference val getValue = wifiSwitchPreference.storage(context).getBoolean(WifiSwitchPreference.KEY)
.storage(context)
.getValue(WifiSwitchPreference.KEY, Boolean::class.javaObjectType)
assertThat(getValue).isTrue() assertThat(getValue).isTrue()
} }
@@ -60,9 +58,7 @@ class WifiSwitchPreferenceTest {
fun getValue_defaultOff_returnOff() { fun getValue_defaultOff_returnOff() {
mockWifiManager.stub { on { isWifiEnabled } doReturn false } mockWifiManager.stub { on { isWifiEnabled } doReturn false }
val getValue = wifiSwitchPreference val getValue = wifiSwitchPreference.storage(context).getBoolean(WifiSwitchPreference.KEY)
.storage(context)
.getValue(WifiSwitchPreference.KEY, Boolean::class.javaObjectType)
assertThat(getValue).isFalse() assertThat(getValue).isFalse()
} }
@@ -87,4 +83,4 @@ class WifiSwitchPreferenceTest {
private fun getSwitchPreference(): SwitchPreferenceCompat = private fun getSwitchPreference(): SwitchPreferenceCompat =
wifiSwitchPreference.createAndBindWidget(context) wifiSwitchPreference.createAndBindWidget(context)
} }