blob: dbddfb7812e7d5ea2b002206e5da7a7cf45e491c [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.activity;
using zx;
using OngoingActivityId = uint32;
/// The Tracker protocol collects evidence of user activity and uses this
/// evidence to set the system's activity state.
[Discoverable]
protocol Tracker {
/// Reports a discrete activity such as a keystroke.
/// |event_time| is in nanoseconds in the `CLOCK_MONOTONIC` time base.
ReportDiscreteActivity(DiscreteActivity activity, zx.time event_time) -> ();
/// Reports the start of an ongoing activity such as media playback.
/// |activity_id| is a unique identifier which is expected to be later
/// passed to EndOngoingActivity.
/// |start_time| is in nanoseconds in the `CLOCK_MONOTONIC` time base.
StartOngoingActivity(OngoingActivityId activity_id, OngoingActivity activity,
zx.time start_time) -> ();
/// Reports the end of an ongoing activity such as media playback.
/// |activity_id| is the nonce which was passed into StartOngoingActivity.
/// |end_time| is in nanoseconds in the `CLOCK_MONOTONIC` time base.
EndOngoingActivity(OngoingActivityId activity_id, zx.time end_time) -> ();
};