blob: 59a48ed36fc2c6e111cee005c93b48b14f7bebf9 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.ui.policy;
using fuchsia.ui.input;
/// Service for exposing state and events of devices, such as media buttons.
[Discoverable]
protocol DeviceListenerRegistry {
/// Registers a listener to receive media button related events, such as
/// changes from volume buttons and mute switches.
// TODO(fxbug.dev/41384): Remove when no longer used.
[Deprecated = "Use RegisterListener() "]
RegisterMediaButtonsListener(MediaButtonsListener listener);
/// Registers a listener to receive media button related events, such as
/// changes from volume buttons and mute switches.
/// On registration, the `listener` receives the last media button event that
/// occured, if one exists, and all media button events going forward.
[Transitional]
RegisterListener(MediaButtonsListener listener) -> ();
};
/// A listener for media buttons events. `DeviceListenerRegistry.RegisterMediaButtonsListener`
/// will consume this listener interface and call `OnMediaButtonsEvent` when the
/// registered media buttons event occurs.
protocol MediaButtonsListener {
// TODO(fxbug.dev/41384): Remove when no longer used.
[Deprecated = "Use OnEvent() "]
OnMediaButtonsEvent(fuchsia.ui.input.MediaButtonsEvent event);
[Transitional]
OnEvent(fuchsia.ui.input.MediaButtonsEvent event) -> ();
};