Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1aed580 authored by Angela Wang's avatar Angela Wang
Browse files

Improves Settings search result of Flash Notifications

1. Shows "Accessibility > Flash notifications" instead of "Notifications
   > Flash notifications".
2. Hides intro preference in search result.
3. Adds search keywords on Flash Notifications page entry.

Bug: 275649264
Bug: 275553435
Test: searches some queries and checks UI manually
Change-Id: Ie6616b779af77153126846748d1052fb29974e3b
parent 925fabe0
Loading
Loading
Loading
Loading
+240 −0
Original line number Diff line number Diff line
@@ -1565,6 +1565,22 @@
            column="5"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
        message="Avoid using hardcoded color"
        category="Correctness"
        priority="4"
        summary="Using hardcoded color"
        explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
        errorLine1="    &lt;color name=&quot;screen_flash_color_button_outer_circle_stroke_color&quot;>#FFFFFF&lt;/color>"
        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="res/values-night/colors.xml"
            line="73"
            column="5"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
@@ -3693,6 +3709,38 @@
            column="9"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
        message="Avoid using hardcoded color"
        category="Correctness"
        priority="4"
        summary="Using hardcoded color"
        explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
        errorLine1="                    android:color=&quot;#2E3192&quot;"
        errorLine2="                    ~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="res/drawable-night/flash_notifications_illustration.xml"
            line="37"
            column="21"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
        message="Avoid using hardcoded color"
        category="Correctness"
        priority="4"
        summary="Using hardcoded color"
        explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
        errorLine1="                    android:color=&quot;#000000&quot;"
        errorLine2="                    ~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="res/drawable-night/flash_notifications_illustration.xml"
            line="40"
            column="21"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
@@ -4781,6 +4829,22 @@
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
        message="Avoid using hardcoded color"
        category="Correctness"
        priority="4"
        summary="Using hardcoded color"
        explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
        errorLine1="                android:color=&quot;@color/screen_flash_color_button_outer_circle_stroke_color&quot; />"
        errorLine2="                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="res/drawable/screen_flash_color_01_checked_layer.xml"
            line="41"
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
@@ -4861,6 +4925,22 @@
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
        message="Avoid using hardcoded color"
        category="Correctness"
        priority="4"
        summary="Using hardcoded color"
        explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
        errorLine1="                android:color=&quot;@color/screen_flash_color_button_outer_circle_stroke_color&quot; />"
        errorLine2="                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="res/drawable/screen_flash_color_02_checked_layer.xml"
            line="41"
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
@@ -4941,6 +5021,22 @@
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
        message="Avoid using hardcoded color"
        category="Correctness"
        priority="4"
        summary="Using hardcoded color"
        explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
        errorLine1="                android:color=&quot;@color/screen_flash_color_button_outer_circle_stroke_color&quot; />"
        errorLine2="                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="res/drawable/screen_flash_color_03_checked_layer.xml"
            line="41"
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
@@ -5021,6 +5117,22 @@
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
        message="Avoid using hardcoded color"
        category="Correctness"
        priority="4"
        summary="Using hardcoded color"
        explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
        errorLine1="                android:color=&quot;@color/screen_flash_color_button_outer_circle_stroke_color&quot; />"
        errorLine2="                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="res/drawable/screen_flash_color_04_checked_layer.xml"
            line="41"
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
@@ -5101,6 +5213,22 @@
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
        message="Avoid using hardcoded color"
        category="Correctness"
        priority="4"
        summary="Using hardcoded color"
        explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
        errorLine1="                android:color=&quot;@color/screen_flash_color_button_outer_circle_stroke_color&quot; />"
        errorLine2="                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="res/drawable/screen_flash_color_05_checked_layer.xml"
            line="41"
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
@@ -5181,6 +5309,22 @@
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
        message="Avoid using hardcoded color"
        category="Correctness"
        priority="4"
        summary="Using hardcoded color"
        explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
        errorLine1="                android:color=&quot;@color/screen_flash_color_button_outer_circle_stroke_color&quot; />"
        errorLine2="                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="res/drawable/screen_flash_color_06_checked_layer.xml"
            line="41"
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
@@ -5261,6 +5405,22 @@
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
        message="Avoid using hardcoded color"
        category="Correctness"
        priority="4"
        summary="Using hardcoded color"
        explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
        errorLine1="                android:color=&quot;@color/screen_flash_color_button_outer_circle_stroke_color&quot; />"
        errorLine2="                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="res/drawable/screen_flash_color_07_checked_layer.xml"
            line="41"
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
@@ -5341,6 +5501,22 @@
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
        message="Avoid using hardcoded color"
        category="Correctness"
        priority="4"
        summary="Using hardcoded color"
        explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
        errorLine1="                android:color=&quot;@color/screen_flash_color_button_outer_circle_stroke_color&quot; />"
        errorLine2="                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="res/drawable/screen_flash_color_08_checked_layer.xml"
            line="41"
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
@@ -5421,6 +5597,22 @@
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
        message="Avoid using hardcoded color"
        category="Correctness"
        priority="4"
        summary="Using hardcoded color"
        explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
        errorLine1="                android:color=&quot;@color/screen_flash_color_button_outer_circle_stroke_color&quot; />"
        errorLine2="                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="res/drawable/screen_flash_color_09_checked_layer.xml"
            line="41"
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
@@ -5501,6 +5693,22 @@
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
        message="Avoid using hardcoded color"
        category="Correctness"
        priority="4"
        summary="Using hardcoded color"
        explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
        errorLine1="                android:color=&quot;@color/screen_flash_color_button_outer_circle_stroke_color&quot; />"
        errorLine2="                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="res/drawable/screen_flash_color_10_checked_layer.xml"
            line="41"
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
@@ -5581,6 +5789,22 @@
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
        message="Avoid using hardcoded color"
        category="Correctness"
        priority="4"
        summary="Using hardcoded color"
        explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
        errorLine1="                android:color=&quot;@color/screen_flash_color_button_outer_circle_stroke_color&quot; />"
        errorLine2="                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="res/drawable/screen_flash_color_11_checked_layer.xml"
            line="41"
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
@@ -5661,6 +5885,22 @@
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
        message="Avoid using hardcoded color"
        category="Correctness"
        priority="4"
        summary="Using hardcoded color"
        explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
        errorLine1="                android:color=&quot;@color/screen_flash_color_button_outer_circle_stroke_color&quot; />"
        errorLine2="                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="res/drawable/screen_flash_color_12_checked_layer.xml"
            line="41"
            column="17"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
+11 −9
Original line number Diff line number Diff line
@@ -11962,24 +11962,26 @@
    <string name="accessibility_fingerprint_label">Fingerprint sensor</string>
    <!-- Accessibility Flash Notification -->
    <!-- Title of the Flash Notification entry [CHAR LIMIT=35] -->
    <!-- Title of the Flash Notifications entry. [CHAR LIMIT=35] -->
    <string name="flash_notifications_title">Flash notifications</string>
    <!-- Title for flash notifications page footer. [CHAR LIMIT=45] -->
    <!-- Title of the Flash Notifications page footer. [CHAR LIMIT=45] -->
    <string name="flash_notifications_about_title">About flash notifications</string>
    <!-- Summary of the Flash Notification preference if all flash alerts are off. [CHAR LIMIT=60] -->
    <!-- Summary of the Flash Notifications preference if all flash alerts are off. [CHAR LIMIT=60] -->
    <string name="flash_notifications_summary_off">Off</string>
    <!-- Summary of the Flash Notification preference if only camera flash is on. [CHAR LIMIT=60] -->
    <!-- Summary of the Flash Notifications preference if only camera flash is on. [CHAR LIMIT=60] -->
    <string name="flash_notifications_summary_on_camera">On / Camera flash</string>
    <!-- Summary of the Flash Notification preference if only screen flash is on. [CHAR LIMIT=60] -->
    <!-- Summary of the Flash Notifications preference if only screen flash is on. [CHAR LIMIT=60] -->
    <string name="flash_notifications_summary_on_screen">On / Screen flash</string>
    <!-- Summary of the Flash Notification preference if both flash alerts are on. [CHAR LIMIT=60] -->
    <!-- Summary of the Flash Notifications preference if both flash alerts are on. [CHAR LIMIT=60] -->
    <string name="flash_notifications_summary_on_camera_and_screen">On / Camera and screen flash</string>
    <!-- Introduction in Flash Notification page to introduce flash notifications feature. [CHAR LIMIT=NONE]  -->
    <!-- Introduction in Flash Notifications page to introduce flash notifications feature. [CHAR LIMIT=NONE]  -->
    <string name="flash_notifications_intro">Flash the camera light or the screen when you receive notifications or when alarms sound</string>
    <!-- Introduction in Flash Notification page to introduce flash notifications feature without camera flash option. [CHAR LIMIT=NONE]  -->
    <!-- Introduction in Flash Notifications page to introduce flash notifications feature without camera flash option. [CHAR LIMIT=NONE]  -->
    <string name="flash_notifications_intro_without_camera_flash">Flash the screen when you receive notifications or when alarms sound</string>
    <!-- Notes in Flash Notification page footer for something should be aware. [CHAR LIMIT=NONE]  -->
    <!-- Notes in Flash Notifications page footer for something should be aware. [CHAR LIMIT=NONE]  -->
    <string name="flash_notifications_note">Use flash notifications with caution if you\u0027re light sensitive</string>
    <!-- Search keywords for Flash Notifications settings. [CHAR LIMIT=NONE]  -->
    <string name="flash_notifications_keywords">flash, light, hard of hearing, hearing loss</string>
    <!-- Label of the button to preview the selected Flash Notification effects. [CHAR LIMIT=20]-->
    <string name="flash_notifications_preview">Preview</string>
    <!-- Title of the camera flash in Flash Notification page. [CHAR LIMIT=60] -->
+3 −1
Original line number Diff line number Diff line
@@ -152,10 +152,12 @@

        <Preference
            android:fragment="com.android.settings.accessibility.FlashNotificationsPreferenceFragment"
            android:key="flash_notifications_preference_accessibility"
            android:icon="@drawable/ic_flash_notification"
            android:key="flash_notifications_preference"
            android:persistent="false"
            android:title="@string/flash_notifications_title"
            settings:keywords="@string/flash_notifications_keywords"
            settings:searchable="true"
            settings:controller="com.android.settings.accessibility.FlashNotificationsPreferenceController" />

        <Preference
+1 −0
Original line number Diff line number Diff line
@@ -134,6 +134,7 @@
            android:order="19"
            android:persistent="false"
            android:title="@string/flash_notifications_title"
            settings:searchable="false"
            settings:controller="com.android.settings.accessibility.FlashNotificationsPreferenceController" />

        <com.android.settingslib.RestrictedPreference
+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@

    <com.android.settingslib.widget.TopIntroPreference
        android:key="flash_notifications_intro"
        settings:searchable="false"
        settings:controller="com.android.settings.accessibility.FlashNotificationsIntroPreferenceController" />

    <com.android.settingslib.widget.IllustrationPreference
@@ -43,6 +44,7 @@
    <com.android.settings.accessibility.FlashNotificationsPreviewPreference
        android:key="flash_notifications_preview"
        android:title="@string/flash_notifications_preview"
        settings:searchable="false"
        settings:controller="com.android.settings.accessibility.FlashNotificationsPreviewPreferenceController" />

    <com.android.settings.accessibility.AccessibilityFooterPreference