summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorJulia Reynolds <juliacr@google.com>2021-02-24 14:45:16 -0500
committerJulia Reynolds <juliacr@google.com>2021-02-26 10:10:05 -0500
commit7c9fbcc6787df792275dd871a7f0781e2befce8f (patch)
tree01078cc7647562bef6e7ef7f8c32a7c0ce2e2861 /core/java/android
parent2409543ce829d9cb1e899ac5e0f138976d7e8451 (diff)
Adds an NLS api for telling the OS what notifs types they bridge
If an app doesn't bridge a particular type of notification we will disabled in Settings so users understand why they aren't seeing those types of notifications on paired devices. Test: CTS, Settings unit Bug: 181125165 Change-Id: I6e702898c3e682f732e91c4a4e02b96ff16b7077
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/service/notification/NotificationListenerService.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/java/android/service/notification/NotificationListenerService.java b/core/java/android/service/notification/NotificationListenerService.java
index 73e66d0212fa..7aa5bbc930fb 100644
--- a/core/java/android/service/notification/NotificationListenerService.java
+++ b/core/java/android/service/notification/NotificationListenerService.java
@@ -85,6 +85,10 @@ import java.util.Objects;
* android:name="android.service.notification.default_filter_types"
* android:value="1,2">
* &lt;/meta-data>
+ * &lt;meta-data
+ * android:name="android.service.notification.disabled_filter_types"
+ * android:value="2">
+ * &lt;/meta-data>
* &lt;/service></pre>
*
* <p>The service should wait for the {@link #onListenerConnected()} event
@@ -123,6 +127,19 @@ public abstract class NotificationListenerService extends Service {
= "android.service.notification.default_filter_types";
/**
+ * The name of the {@code meta-data} tag containing a comma separated list of default
+ * integer notification types that this listener never wants to receive. See
+ * {@link #FLAG_FILTER_TYPE_ONGOING},
+ * {@link #FLAG_FILTER_TYPE_CONVERSATIONS}, {@link #FLAG_FILTER_TYPE_ALERTING),
+ * and {@link #FLAG_FILTER_TYPE_SILENT}.
+ * <p>Types provided in this list will appear as 'off' and 'disabled' in the user interface,
+ * so users don't enable a type that the listener will never bridge to their paired devices.</p>
+ *
+ */
+ public static final String META_DATA_DISABLED_FILTER_TYPES
+ = "android.service.notification.disabled_filter_types";
+
+ /**
* {@link #getCurrentInterruptionFilter() Interruption filter} constant -
* Normal interruption filter.
*/