// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Internal API exposed to the cros_healthd daemon. This should only be used by
// cros_healthd to obtain the browser resources and bootstrap the connection
// between Chrome and cros_healthd.
// NOTE: This mojom should be kept in sync with the copy in Chromium OS's repo
// in src/platform2/diagnostics/mojom/external/cros_healthd_internal.mojom.
module ash.cros_healthd.internal.mojom;
// Collects data from chromium to Healthd.
//
// TODO(b/249182240): Rename interface name to another one. The
// SetPrivacyScreenState method is conflicted with the interface name.
//
// NextMinVersion: 3, NextIndex: 4
[Stable]
interface ChromiumDataCollector {
// Get touchscreen devices info.
GetTouchscreenDevices@0() => (array<TouchscreenDevice> devices);
// Get the touchpad library name.
GetTouchpadLibraryName@1() => (string library_name);
// Set privacy screen state. Return true if request is processed and the
// privacy screen state is updated, or false if the request is rejected.
[MinVersion=1] SetPrivacyScreenState@2(bool state) => (bool success);
// Mute control of audio output device.
[MinVersion=2] DEPRECATED_SetAudioOutputMute@3(bool mute_on)
=> (bool success);
};
// Data of a touch screen device in chromium.
//
// NextMinVersion: 1, NextIndex: 4
[Stable]
struct TouchscreenDevice {
// The input device of this touchscreen.
InputDevice input_device@0;
// Number of touch points this device supports (0 if unknown).
int32 touch_points@1;
// True if the specified touchscreen device is stylus capable.
bool has_stylus@2;
// True if there is a garage/dock switch associated with the stylus.
bool has_stylus_garage_switch@3;
};
// Data of a input device in chromium.
//
// NextMinVersion: 1, NextIndex: 5
[Stable]
struct InputDevice {
// Name of the device.
string name@0;
// The connection type of the input device.
[Stable, Extensible]
enum ConnectionType {
// For mojo backward compatibility.
[Default] kUnmappedEnumField,
// Internally connected input device.
kInternal,
// Known externally connected usb input device.
kUSB,
// Known externally connected bluetooth input device.
kBluetooth,
// Device that may or may not be an external device.
kUnknown,
};
ConnectionType connection_type@1;
// The physical location(port) associated with the input device. This is
// (supposed to be) stable between reboots and hotplugs. However this may not
// always be set and will change when the device is connected via a different
// port.
string physical_location@2;
// If the device is enabled, and whether events should be dispatched to UI.
bool is_enabled@3;
// The path to the input device in the sysfs filesystem, this should be a path
// under /sys directory.
string sysfs_path@4;
};