diff options
author | John Spurlock <jspurlock@google.com> | 2015-02-13 18:35:49 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-02-13 18:35:50 +0000 |
commit | 45cc62a33e0f0ea1a0a59b8c46c8bc8bda5872e9 (patch) | |
tree | 2ab0b297920d2afb96bd481d4778590e0f54bea7 /core/java/android/service | |
parent | 8ff773a3c8f2b8b81def83cb9df0e63a20a2d1fa (diff) | |
parent | 831041036587efbceb395bface176752a6b560bc (diff) | |
download | frameworks_base-45cc62a33e0f0ea1a0a59b8c46c8bc8bda5872e9.zip frameworks_base-45cc62a33e0f0ea1a0a59b8c46c8bc8bda5872e9.tar.gz frameworks_base-45cc62a33e0f0ea1a0a59b8c46c8bc8bda5872e9.tar.bz2 |
Merge "NLS: Add a public signal value for an undefined filter value."
Diffstat (limited to 'core/java/android/service')
-rw-r--r-- | core/java/android/service/notification/NotificationListenerService.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/core/java/android/service/notification/NotificationListenerService.java b/core/java/android/service/notification/NotificationListenerService.java index 3d39b18..0860153 100644 --- a/core/java/android/service/notification/NotificationListenerService.java +++ b/core/java/android/service/notification/NotificationListenerService.java @@ -77,6 +77,14 @@ public abstract class NotificationListenerService extends Service { */ public static final int INTERRUPTION_FILTER_NONE = 3; + /** {@link #getCurrentInterruptionFilter() Interruption filter} constant - returned when + * the value is unavailable for any reason. For example, before the notification listener + * is connected. + * + * {@see #onListenerConnected()} + */ + public static final int INTERRUPTION_FILTER_UNKNOWN = 0; + /** {@link #getCurrentListenerHints() Listener hints} constant - the primary device UI * should disable notification sound, vibrating and other visual or aural effects. * This does not change the interruption filter, only the effects. **/ @@ -473,15 +481,16 @@ public abstract class NotificationListenerService extends Service { * <p> * Listen for updates using {@link #onInterruptionFilterChanged(int)}. * - * @return One of the INTERRUPTION_FILTER_ constants, or 0 on errors. + * @return One of the INTERRUPTION_FILTER_ constants, or INTERRUPTION_FILTER_UNKNOWN when + * unavailable. */ public final int getCurrentInterruptionFilter() { - if (!isBound()) return 0; + if (!isBound()) return INTERRUPTION_FILTER_UNKNOWN; try { return getNotificationInterface().getInterruptionFilterFromListener(mWrapper); } catch (android.os.RemoteException ex) { Log.v(TAG, "Unable to contact notification manager", ex); - return 0; + return INTERRUPTION_FILTER_UNKNOWN; } } |