Allow notification filtering per listener.

Test: atest
Bug: 173052211
Change-Id: I54c740e9755f18339c59aad4f1f5aecd8c734892
This commit is contained in:
Julia Reynolds
2021-01-05 16:54:54 -05:00
parent 0fd2a2008a
commit eb2b36a5e2
7 changed files with 355 additions and 2 deletions

View File

@@ -1532,4 +1532,21 @@
<item>8</item>
<item>12</item>
</string-array>
<!-- Array of titles list for notification listener notification types. [DO NOT TRANSLATE] -->
<string-array name="notif_types_titles" translatable="false">
<item>@string/notif_type_ongoing</item>
<item>@string/notif_type_conversation</item>
<item>@string/notif_type_alerting</item>
<item>@string/notif_type_silent</item>
</string-array>
<!-- Values of list for notification listener notification types. Values need to match
android.service.notification.NotificationListenerService. [DO NOT TRANSLATE] -->
<string-array name="notif_types_values" translatable="false">
<item>8</item>
<item>1</item>
<item>2</item>
<item>4</item>
</string-array>
</resources>

View File

@@ -8756,6 +8756,11 @@
</string>
<string name="notification_listener_disable_warning_confirm">Turn off</string>
<string name="notification_listener_disable_warning_cancel">Cancel</string>
<string name="notification_listener_type_title">Allowed notification types</string>
<string name="notif_type_ongoing">Important ongoing notifications</string>
<string name="notif_type_conversation">Conversation notifications</string>
<string name="notif_type_alerting">Alerting notifications</string>
<string name="notif_type_silent">Silent notifications</string>
<!-- Title for managing VR (virtual reality) helper services. [CHAR LIMIT=50] -->
<string name="vr_listeners_title">VR helper services</string>

View File

@@ -31,4 +31,21 @@
android:title="@string/notification_access_detail_switch"
settings:controller="com.android.settings.applications.specialaccess.notificationaccess.ApprovalPreferenceController"/>
<MultiSelectListPreference
android:key="notification_type_filter"
android:title="@string/notification_listener_type_title"
android:entries="@array/notif_types_titles"
android:entryValues="@array/notif_types_values"
android:summary="%s"
android:persistent="false"
style="@style/SettingsMultiSelectListPreference"
settings:controller="com.android.settings.applications.specialaccess.notificationaccess.TypeFilterPreferenceController"/>/>
<PreferenceCategory
android:key="advanced"
android:order="50"
settings:initialExpandedChildrenCount="0">
</PreferenceCategory>
</PreferenceScreen>