blob: 56c3323c7ff6a93a6c296d1bdf53190634801d08 [file] [log] [blame] [edit]
// 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.activity;
using zx;
// TODO(fxbug.dev/103843): Remove this interface.
/// The Provider protocol offers a subscription interface through
/// which clients can watch for changes in the system's activity state.
@discoverable
protocol Provider {
/// Subscribe to changes in the system's state.
/// The server will always invoke listener.OnStateChanged at least once with
/// the initial state, and after that invoke listener.OnStateChanged
/// whenever the system's state changes.
@available(deprecated=9, note="Instead, use `fuchsia.input.interaction.Notifier`")
WatchState(resource struct {
listener client_end:Listener;
});
};
// TODO(fxbug.dev/103843): Remove this interface.
/// The Listener protocol subscribes to changes in the system's activity
/// state. Clients which care about the activity state of the system are
/// expected to implement this protocol and subscribe via Provider.WatchState.
protocol Listener {
/// Callback that is invoked whenever the system state changes.
/// The Listener is expected to acknowledge each call explicitly and will
/// not receive new state until this acknowledgement is done.
@available(deprecated=9, note="Instead, use `fuchsia.input.interaction.Notifier`")
OnStateChanged(struct {
state State;
transition_time zx.Time;
}) -> ();
};