| // 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; |
| |
| alias 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(struct { |
| activity DiscreteActivity; |
| event_time zx.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(struct { |
| activity_id OngoingActivityId; |
| activity OngoingActivity; |
| start_time zx.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(struct { |
| activity_id OngoingActivityId; |
| end_time zx.time; |
| }) -> (); |
| }; |