// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// API and definitions exposed by the Telemetry Management Services. This API is
// normally consumed by the Telemetry Extension APIs implementation.
// WARNING: This mojom and its implementation is designed for use only by the
// telemetry extension.
module crosapi.mojom;
// Telemetry management interface exposed to Lacros.
//
// NextMinVersion: 3, NextIndex: 2
[Stable, Uuid="562b12e3-8773-4085-9480-450e088ac252"]
interface TelemetryManagementService {
// Sets the specified input audio device |node_id| gain to value |gain|.
//
// The request:
// * |node_id| - Node id of the audio device to be configured.
// * |gain| - Target gain percent in [0, 100]. Sets to 0 or 100 if outside.
//
// The response:
// * |is_success| - Whether the operation is successful. Returns false if
// |node_id| is invalid.
SetAudioGain@0(uint64 node_id, int32 gain)
=> ([MinVersion=2] bool is_success);
// Sets the specified output audio device |node_id| volume to value |volume|
// and mute state to |is_muted|.
//
// The request:
// * |node_id| - Node id of the audio device to be configured.
// * |volume| - Target volume percent in [0, 100]. Sets to 0 or 100 if
// outside.
// * |is_muted| - Whether to mute the device.
//
// The response:
// * |is_success| - Whether the operation is successful. Returns false if
// |node_id| is invalid.
[MinVersion=1] SetAudioVolume@1(uint64 node_id, int32 volume, bool is_muted)
=> (bool is_success);
};