Lines Matching refs:listener

108      * your app is an enabled notification listener using the
110 * {@link ComponentName} of your enabled listener.
112 * @param notificationListener The enabled notification listener component.
126 * listener you may only get sessions for the users you are enabled for.
128 * @param notificationListener The enabled notification listener component.
152 * Add a listener to be notified when the list of active sessions
156 * enabled notification listener using the
158 * {@link ComponentName} of your enabled listener. Updates will be posted to
159 * the thread that registered the listener.
161 * @param sessionListener The listener to add.
162 * @param notificationListener The enabled notification listener component.
172 * Add a listener to be notified when the list of active sessions
176 * enabled notification listener using the
178 * {@link ComponentName} of your enabled listener. Updates will be posted to
181 * @param sessionListener The listener to add.
182 * @param notificationListener The enabled notification listener component.
194 * Add a listener to be notified when the list of active sessions
198 * enabled notification listener using the
200 * {@link ComponentName} of your enabled listener.
202 * @param sessionListener The listener to add.
203 * @param notificationListener The enabled notification listener component.
213 throw new IllegalArgumentException("listener may not be null");
220 Log.w(TAG, "Attempted to add session listener twice, ignoring.");
235 * Stop receiving active sessions updates on the specified listener.
237 * @param listener The listener to remove.
240 @NonNull OnActiveSessionsChangedListener listener) {
241 if (listener == null) {
242 throw new IllegalArgumentException("listener may not be null");
245 SessionsChangedWrapper wrapper = mListeners.remove(listener);
349 * Set the volume key long-press listener. While the listener is set, the listener
352 * <p>System can only have a single volume key long-press listener.
354 * @param listener The volume key long-press listener. {@code null} to reset.
355 * @param handler The handler on which the listener should be invoked, or {@code null}
356 * if the listener should be invoked on the calling thread's looper.
362 OnVolumeKeyLongPressListener listener, @Nullable Handler handler) {
365 if (listener == null) {
373 new OnVolumeKeyLongPressListenerImpl(listener, handler);
377 Log.e(TAG, "Failed to set volume key long press listener", e);
383 * Set the media key listener. While the listener is set, the listener
385 * If the listener handles the key (i.e. returns {@code true}),
388 * <p>System can only have a single media key listener.
390 * @param listener The media key listener. {@code null} to reset.
391 * @param handler The handler on which the listener should be invoked, or {@code null}
392 * if the listener should be invoked on the calling thread's looper.
397 public void setOnMediaKeyListener(OnMediaKeyListener listener, @Nullable Handler handler) {
400 if (listener == null) {
407 mOnMediaKeyListener = new OnMediaKeyListenerImpl(listener, handler);
411 Log.e(TAG, "Failed to set media key listener", e);
475 * <p>If the listener consumes the initial down event (i.e. ACTION_DOWN with
539 public SessionsChangedWrapper(Context context, OnActiveSessionsChangedListener listener,
542 mListener = listener;
581 OnVolumeKeyLongPressListener listener, Handler handler) {
582 mListener = listener;
589 Log.w(TAG, "Failed to call volume key long-press listener." +
606 public OnMediaKeyListenerImpl(OnMediaKeyListener listener, Handler handler) {
607 mListener = listener;
614 Log.w(TAG, "Failed to call media key listener." +
622 Log.d(TAG, "The media key listener is returned " + handled);