system_api: add power_manager bindings and update other bindings

This CL adds power_manager D-Bus bindings, which will be used in a
follow-up CL. Also updates other bindings as a result of running
update_bindings.sh.

BUG=b:361281568
TEST=./update_bindings.sh
TEST=emerge-<BOARD> crosvm

Change-Id: I1411d1b07f8a99bab6d6af45fb32649d83cbadf5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5883998
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Yuan Yao <yuanyaogoog@chromium.org>
This commit is contained in:
Yuan Yao 2024-09-24 08:40:53 +00:00 committed by crosvm LUCI
parent 157aa8ef5f
commit 4f352d3792
6 changed files with 1009 additions and 2 deletions

View file

@ -0,0 +1,686 @@
// This code was autogenerated with `dbus-codegen-rust -s -m None`, see https://github.com/diwic/dbus-rs
use dbus as dbus;
#[allow(unused_imports)]
use dbus::arg;
use dbus::blocking;
pub trait OrgChromiumPowerManager {
fn request_shutdown(&self, reason: i32, description: &str) -> Result<(), dbus::Error>;
fn request_restart(&self, reason: i32, description: &str) -> Result<(), dbus::Error>;
fn change_wifi_reg_domain(&self, domain: i32) -> Result<(), dbus::Error>;
fn request_suspend(&self, external_wakeup_count: u64, wakeup_timeout: i32, suspend_flavor: u32) -> Result<(), dbus::Error>;
fn set_screen_brightness(&self, serialized_proto: Vec<u8>) -> Result<(), dbus::Error>;
fn decrease_screen_brightness(&self, allow_off: bool) -> Result<(), dbus::Error>;
fn increase_screen_brightness(&self) -> Result<(), dbus::Error>;
fn get_screen_brightness_percent(&self) -> Result<f64, dbus::Error>;
fn has_keyboard_backlight(&self) -> Result<bool, dbus::Error>;
fn decrease_keyboard_brightness(&self) -> Result<(), dbus::Error>;
fn increase_keyboard_brightness(&self) -> Result<(), dbus::Error>;
fn toggle_keyboard_backlight(&self) -> Result<(), dbus::Error>;
fn set_keyboard_brightness(&self, serialized_proto: Vec<u8>) -> Result<(), dbus::Error>;
fn get_keyboard_brightness_percent(&self) -> Result<f64, dbus::Error>;
fn set_keyboard_ambient_light_sensor_enabled(&self, enabled: bool) -> Result<(), dbus::Error>;
fn get_power_supply_properties(&self) -> Result<Vec<u8>, dbus::Error>;
fn get_battery_state(&self) -> Result<(u32, u32, f64), dbus::Error>;
fn handle_video_activity(&self, fullscreen: bool) -> Result<(), dbus::Error>;
fn handle_user_activity(&self, type_: i32) -> Result<(), dbus::Error>;
fn set_is_projecting(&self, is_projecting: bool) -> Result<(), dbus::Error>;
fn set_policy(&self, serialized_proto: Vec<u8>) -> Result<(), dbus::Error>;
fn set_power_source(&self, id: &str) -> Result<(), dbus::Error>;
fn handle_power_button_acknowledgment(&self, timestamp_internal: i64) -> Result<(), dbus::Error>;
fn ignore_next_power_button_press(&self, timeout_internal: i64) -> Result<(), dbus::Error>;
fn register_suspend_delay(&self, serialized_request_proto: Vec<u8>) -> Result<Vec<u8>, dbus::Error>;
fn unregister_suspend_delay(&self, serialized_proto: Vec<u8>) -> Result<(), dbus::Error>;
fn handle_suspend_readiness(&self, serialized_proto: Vec<u8>) -> Result<(), dbus::Error>;
fn register_dark_suspend_delay(&self, serialized_request_proto: Vec<u8>) -> Result<Vec<u8>, dbus::Error>;
fn unregister_dark_suspend_delay(&self, serialized_proto: Vec<u8>) -> Result<(), dbus::Error>;
fn handle_dark_suspend_readiness(&self, serialized_proto: Vec<u8>) -> Result<(), dbus::Error>;
fn record_dark_resume_wake_reason(&self, serialized_proto: Vec<u8>) -> Result<(), dbus::Error>;
fn get_inactivity_delays(&self) -> Result<Vec<u8>, dbus::Error>;
fn has_ambient_color_device(&self) -> Result<bool, dbus::Error>;
fn get_thermal_state(&self) -> Result<Vec<u8>, dbus::Error>;
fn set_external_display_alsbrightness(&self, enabled: bool) -> Result<(), dbus::Error>;
fn get_external_display_alsbrightness(&self) -> Result<bool, dbus::Error>;
fn charge_now_for_adaptive_charging(&self) -> Result<(), dbus::Error>;
fn get_charge_history(&self) -> Result<Vec<u8>, dbus::Error>;
fn get_battery_saver_mode_state(&self) -> Result<Vec<u8>, dbus::Error>;
fn set_battery_saver_mode_state(&self, serialized_proto: Vec<u8>) -> Result<(), dbus::Error>;
fn has_ambient_light_sensor(&self) -> Result<bool, dbus::Error>;
fn set_ambient_light_sensor_enabled(&self, enabled: bool) -> Result<(), dbus::Error>;
fn battery_state_poll(&self) -> Result<(u32, u32, f64), dbus::Error>;
}
#[derive(Debug)]
pub struct OrgChromiumPowerManagerBatterySaverModeStateChanged {
pub serialized_proto: Vec<u8>,
}
impl arg::AppendAll for OrgChromiumPowerManagerBatterySaverModeStateChanged {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.serialized_proto, i);
}
}
impl arg::ReadAll for OrgChromiumPowerManagerBatterySaverModeStateChanged {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(OrgChromiumPowerManagerBatterySaverModeStateChanged {
serialized_proto: i.read()?,
})
}
}
impl dbus::message::SignalArgs for OrgChromiumPowerManagerBatterySaverModeStateChanged {
const NAME: &'static str = "BatterySaverModeStateChanged";
const INTERFACE: &'static str = "org.chromium.PowerManager";
}
#[derive(Debug)]
pub struct OrgChromiumPowerManagerScreenBrightnessChanged {
pub serialized_proto: Vec<u8>,
}
impl arg::AppendAll for OrgChromiumPowerManagerScreenBrightnessChanged {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.serialized_proto, i);
}
}
impl arg::ReadAll for OrgChromiumPowerManagerScreenBrightnessChanged {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(OrgChromiumPowerManagerScreenBrightnessChanged {
serialized_proto: i.read()?,
})
}
}
impl dbus::message::SignalArgs for OrgChromiumPowerManagerScreenBrightnessChanged {
const NAME: &'static str = "ScreenBrightnessChanged";
const INTERFACE: &'static str = "org.chromium.PowerManager";
}
#[derive(Debug)]
pub struct OrgChromiumPowerManagerKeyboardBrightnessChanged {
pub serialized_proto: Vec<u8>,
}
impl arg::AppendAll for OrgChromiumPowerManagerKeyboardBrightnessChanged {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.serialized_proto, i);
}
}
impl arg::ReadAll for OrgChromiumPowerManagerKeyboardBrightnessChanged {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(OrgChromiumPowerManagerKeyboardBrightnessChanged {
serialized_proto: i.read()?,
})
}
}
impl dbus::message::SignalArgs for OrgChromiumPowerManagerKeyboardBrightnessChanged {
const NAME: &'static str = "KeyboardBrightnessChanged";
const INTERFACE: &'static str = "org.chromium.PowerManager";
}
#[derive(Debug)]
pub struct OrgChromiumPowerManagerKeyboardAmbientLightSensorEnabledChanged {
pub serialized_proto: Vec<u8>,
}
impl arg::AppendAll for OrgChromiumPowerManagerKeyboardAmbientLightSensorEnabledChanged {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.serialized_proto, i);
}
}
impl arg::ReadAll for OrgChromiumPowerManagerKeyboardAmbientLightSensorEnabledChanged {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(OrgChromiumPowerManagerKeyboardAmbientLightSensorEnabledChanged {
serialized_proto: i.read()?,
})
}
}
impl dbus::message::SignalArgs for OrgChromiumPowerManagerKeyboardAmbientLightSensorEnabledChanged {
const NAME: &'static str = "KeyboardAmbientLightSensorEnabledChanged";
const INTERFACE: &'static str = "org.chromium.PowerManager";
}
#[derive(Debug)]
pub struct OrgChromiumPowerManagerPeripheralBatteryStatus {
pub serialized_proto: Vec<u8>,
}
impl arg::AppendAll for OrgChromiumPowerManagerPeripheralBatteryStatus {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.serialized_proto, i);
}
}
impl arg::ReadAll for OrgChromiumPowerManagerPeripheralBatteryStatus {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(OrgChromiumPowerManagerPeripheralBatteryStatus {
serialized_proto: i.read()?,
})
}
}
impl dbus::message::SignalArgs for OrgChromiumPowerManagerPeripheralBatteryStatus {
const NAME: &'static str = "PeripheralBatteryStatus";
const INTERFACE: &'static str = "org.chromium.PowerManager";
}
#[derive(Debug)]
pub struct OrgChromiumPowerManagerPowerSupplyPoll {
pub serialized_proto: Vec<u8>,
}
impl arg::AppendAll for OrgChromiumPowerManagerPowerSupplyPoll {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.serialized_proto, i);
}
}
impl arg::ReadAll for OrgChromiumPowerManagerPowerSupplyPoll {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(OrgChromiumPowerManagerPowerSupplyPoll {
serialized_proto: i.read()?,
})
}
}
impl dbus::message::SignalArgs for OrgChromiumPowerManagerPowerSupplyPoll {
const NAME: &'static str = "PowerSupplyPoll";
const INTERFACE: &'static str = "org.chromium.PowerManager";
}
#[derive(Debug)]
pub struct OrgChromiumPowerManagerLidOpened {
}
impl arg::AppendAll for OrgChromiumPowerManagerLidOpened {
fn append(&self, _: &mut arg::IterAppend) {
}
}
impl arg::ReadAll for OrgChromiumPowerManagerLidOpened {
fn read(_: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(OrgChromiumPowerManagerLidOpened {
})
}
}
impl dbus::message::SignalArgs for OrgChromiumPowerManagerLidOpened {
const NAME: &'static str = "LidOpened";
const INTERFACE: &'static str = "org.chromium.PowerManager";
}
#[derive(Debug)]
pub struct OrgChromiumPowerManagerLidClosed {
}
impl arg::AppendAll for OrgChromiumPowerManagerLidClosed {
fn append(&self, _: &mut arg::IterAppend) {
}
}
impl arg::ReadAll for OrgChromiumPowerManagerLidClosed {
fn read(_: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(OrgChromiumPowerManagerLidClosed {
})
}
}
impl dbus::message::SignalArgs for OrgChromiumPowerManagerLidClosed {
const NAME: &'static str = "LidClosed";
const INTERFACE: &'static str = "org.chromium.PowerManager";
}
#[derive(Debug)]
pub struct OrgChromiumPowerManagerSuspendImminent {
pub serialized_proto: Vec<u8>,
}
impl arg::AppendAll for OrgChromiumPowerManagerSuspendImminent {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.serialized_proto, i);
}
}
impl arg::ReadAll for OrgChromiumPowerManagerSuspendImminent {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(OrgChromiumPowerManagerSuspendImminent {
serialized_proto: i.read()?,
})
}
}
impl dbus::message::SignalArgs for OrgChromiumPowerManagerSuspendImminent {
const NAME: &'static str = "SuspendImminent";
const INTERFACE: &'static str = "org.chromium.PowerManager";
}
#[derive(Debug)]
pub struct OrgChromiumPowerManagerSuspendDone {
pub serialized_proto: Vec<u8>,
}
impl arg::AppendAll for OrgChromiumPowerManagerSuspendDone {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.serialized_proto, i);
}
}
impl arg::ReadAll for OrgChromiumPowerManagerSuspendDone {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(OrgChromiumPowerManagerSuspendDone {
serialized_proto: i.read()?,
})
}
}
impl dbus::message::SignalArgs for OrgChromiumPowerManagerSuspendDone {
const NAME: &'static str = "SuspendDone";
const INTERFACE: &'static str = "org.chromium.PowerManager";
}
#[derive(Debug)]
pub struct OrgChromiumPowerManagerDarkSuspendImminent {
pub serialized_proto: Vec<u8>,
}
impl arg::AppendAll for OrgChromiumPowerManagerDarkSuspendImminent {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.serialized_proto, i);
}
}
impl arg::ReadAll for OrgChromiumPowerManagerDarkSuspendImminent {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(OrgChromiumPowerManagerDarkSuspendImminent {
serialized_proto: i.read()?,
})
}
}
impl dbus::message::SignalArgs for OrgChromiumPowerManagerDarkSuspendImminent {
const NAME: &'static str = "DarkSuspendImminent";
const INTERFACE: &'static str = "org.chromium.PowerManager";
}
#[derive(Debug)]
pub struct OrgChromiumPowerManagerInputEvent {
pub serialized_proto: Vec<u8>,
}
impl arg::AppendAll for OrgChromiumPowerManagerInputEvent {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.serialized_proto, i);
}
}
impl arg::ReadAll for OrgChromiumPowerManagerInputEvent {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(OrgChromiumPowerManagerInputEvent {
serialized_proto: i.read()?,
})
}
}
impl dbus::message::SignalArgs for OrgChromiumPowerManagerInputEvent {
const NAME: &'static str = "InputEvent";
const INTERFACE: &'static str = "org.chromium.PowerManager";
}
#[derive(Debug)]
pub struct OrgChromiumPowerManagerIdleActionImminent {
pub serialized_proto: Vec<u8>,
}
impl arg::AppendAll for OrgChromiumPowerManagerIdleActionImminent {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.serialized_proto, i);
}
}
impl arg::ReadAll for OrgChromiumPowerManagerIdleActionImminent {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(OrgChromiumPowerManagerIdleActionImminent {
serialized_proto: i.read()?,
})
}
}
impl dbus::message::SignalArgs for OrgChromiumPowerManagerIdleActionImminent {
const NAME: &'static str = "IdleActionImminent";
const INTERFACE: &'static str = "org.chromium.PowerManager";
}
#[derive(Debug)]
pub struct OrgChromiumPowerManagerIdleActionDeferred {
}
impl arg::AppendAll for OrgChromiumPowerManagerIdleActionDeferred {
fn append(&self, _: &mut arg::IterAppend) {
}
}
impl arg::ReadAll for OrgChromiumPowerManagerIdleActionDeferred {
fn read(_: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(OrgChromiumPowerManagerIdleActionDeferred {
})
}
}
impl dbus::message::SignalArgs for OrgChromiumPowerManagerIdleActionDeferred {
const NAME: &'static str = "IdleActionDeferred";
const INTERFACE: &'static str = "org.chromium.PowerManager";
}
#[derive(Debug)]
pub struct OrgChromiumPowerManagerScreenIdleStateChanged {
pub serialized_proto: Vec<u8>,
}
impl arg::AppendAll for OrgChromiumPowerManagerScreenIdleStateChanged {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.serialized_proto, i);
}
}
impl arg::ReadAll for OrgChromiumPowerManagerScreenIdleStateChanged {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(OrgChromiumPowerManagerScreenIdleStateChanged {
serialized_proto: i.read()?,
})
}
}
impl dbus::message::SignalArgs for OrgChromiumPowerManagerScreenIdleStateChanged {
const NAME: &'static str = "ScreenIdleStateChanged";
const INTERFACE: &'static str = "org.chromium.PowerManager";
}
#[derive(Debug)]
pub struct OrgChromiumPowerManagerInactivityDelaysChanged {
pub serialized_proto: Vec<u8>,
}
impl arg::AppendAll for OrgChromiumPowerManagerInactivityDelaysChanged {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.serialized_proto, i);
}
}
impl arg::ReadAll for OrgChromiumPowerManagerInactivityDelaysChanged {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(OrgChromiumPowerManagerInactivityDelaysChanged {
serialized_proto: i.read()?,
})
}
}
impl dbus::message::SignalArgs for OrgChromiumPowerManagerInactivityDelaysChanged {
const NAME: &'static str = "InactivityDelaysChanged";
const INTERFACE: &'static str = "org.chromium.PowerManager";
}
#[derive(Debug)]
pub struct OrgChromiumPowerManagerAmbientColorTemperatureChanged {
pub color_temp: u32,
}
impl arg::AppendAll for OrgChromiumPowerManagerAmbientColorTemperatureChanged {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.color_temp, i);
}
}
impl arg::ReadAll for OrgChromiumPowerManagerAmbientColorTemperatureChanged {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(OrgChromiumPowerManagerAmbientColorTemperatureChanged {
color_temp: i.read()?,
})
}
}
impl dbus::message::SignalArgs for OrgChromiumPowerManagerAmbientColorTemperatureChanged {
const NAME: &'static str = "AmbientColorTemperatureChanged";
const INTERFACE: &'static str = "org.chromium.PowerManager";
}
#[derive(Debug)]
pub struct OrgChromiumPowerManagerThermalEvent {
pub serialized_proto: Vec<u8>,
}
impl arg::AppendAll for OrgChromiumPowerManagerThermalEvent {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.serialized_proto, i);
}
}
impl arg::ReadAll for OrgChromiumPowerManagerThermalEvent {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(OrgChromiumPowerManagerThermalEvent {
serialized_proto: i.read()?,
})
}
}
impl dbus::message::SignalArgs for OrgChromiumPowerManagerThermalEvent {
const NAME: &'static str = "ThermalEvent";
const INTERFACE: &'static str = "org.chromium.PowerManager";
}
#[derive(Debug)]
pub struct OrgChromiumPowerManagerAmbientLightSensorEnabledChanged {
pub serialized_proto: Vec<u8>,
}
impl arg::AppendAll for OrgChromiumPowerManagerAmbientLightSensorEnabledChanged {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.serialized_proto, i);
}
}
impl arg::ReadAll for OrgChromiumPowerManagerAmbientLightSensorEnabledChanged {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(OrgChromiumPowerManagerAmbientLightSensorEnabledChanged {
serialized_proto: i.read()?,
})
}
}
impl dbus::message::SignalArgs for OrgChromiumPowerManagerAmbientLightSensorEnabledChanged {
const NAME: &'static str = "AmbientLightSensorEnabledChanged";
const INTERFACE: &'static str = "org.chromium.PowerManager";
}
impl<'a, T: blocking::BlockingSender, C: ::std::ops::Deref<Target=T>> OrgChromiumPowerManager for blocking::Proxy<'a, C> {
fn request_shutdown(&self, reason: i32, description: &str) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "RequestShutdown", (reason, description, ))
}
fn request_restart(&self, reason: i32, description: &str) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "RequestRestart", (reason, description, ))
}
fn change_wifi_reg_domain(&self, domain: i32) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "ChangeWifiRegDomain", (domain, ))
}
fn request_suspend(&self, external_wakeup_count: u64, wakeup_timeout: i32, suspend_flavor: u32) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "RequestSuspend", (external_wakeup_count, wakeup_timeout, suspend_flavor, ))
}
fn set_screen_brightness(&self, serialized_proto: Vec<u8>) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "SetScreenBrightness", (serialized_proto, ))
}
fn decrease_screen_brightness(&self, allow_off: bool) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "DecreaseScreenBrightness", (allow_off, ))
}
fn increase_screen_brightness(&self) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "IncreaseScreenBrightness", ())
}
fn get_screen_brightness_percent(&self) -> Result<f64, dbus::Error> {
self.method_call("org.chromium.PowerManager", "GetScreenBrightnessPercent", ())
.and_then(|r: (f64, )| Ok(r.0, ))
}
fn has_keyboard_backlight(&self) -> Result<bool, dbus::Error> {
self.method_call("org.chromium.PowerManager", "HasKeyboardBacklight", ())
.and_then(|r: (bool, )| Ok(r.0, ))
}
fn decrease_keyboard_brightness(&self) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "DecreaseKeyboardBrightness", ())
}
fn increase_keyboard_brightness(&self) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "IncreaseKeyboardBrightness", ())
}
fn toggle_keyboard_backlight(&self) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "ToggleKeyboardBacklight", ())
}
fn set_keyboard_brightness(&self, serialized_proto: Vec<u8>) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "SetKeyboardBrightness", (serialized_proto, ))
}
fn get_keyboard_brightness_percent(&self) -> Result<f64, dbus::Error> {
self.method_call("org.chromium.PowerManager", "GetKeyboardBrightnessPercent", ())
.and_then(|r: (f64, )| Ok(r.0, ))
}
fn set_keyboard_ambient_light_sensor_enabled(&self, enabled: bool) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "SetKeyboardAmbientLightSensorEnabled", (enabled, ))
}
fn get_power_supply_properties(&self) -> Result<Vec<u8>, dbus::Error> {
self.method_call("org.chromium.PowerManager", "GetPowerSupplyProperties", ())
.and_then(|r: (Vec<u8>, )| Ok(r.0, ))
}
fn get_battery_state(&self) -> Result<(u32, u32, f64), dbus::Error> {
self.method_call("org.chromium.PowerManager", "GetBatteryState", ())
}
fn handle_video_activity(&self, fullscreen: bool) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "HandleVideoActivity", (fullscreen, ))
}
fn handle_user_activity(&self, type_: i32) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "HandleUserActivity", (type_, ))
}
fn set_is_projecting(&self, is_projecting: bool) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "SetIsProjecting", (is_projecting, ))
}
fn set_policy(&self, serialized_proto: Vec<u8>) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "SetPolicy", (serialized_proto, ))
}
fn set_power_source(&self, id: &str) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "SetPowerSource", (id, ))
}
fn handle_power_button_acknowledgment(&self, timestamp_internal: i64) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "HandlePowerButtonAcknowledgment", (timestamp_internal, ))
}
fn ignore_next_power_button_press(&self, timeout_internal: i64) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "IgnoreNextPowerButtonPress", (timeout_internal, ))
}
fn register_suspend_delay(&self, serialized_request_proto: Vec<u8>) -> Result<Vec<u8>, dbus::Error> {
self.method_call("org.chromium.PowerManager", "RegisterSuspendDelay", (serialized_request_proto, ))
.and_then(|r: (Vec<u8>, )| Ok(r.0, ))
}
fn unregister_suspend_delay(&self, serialized_proto: Vec<u8>) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "UnregisterSuspendDelay", (serialized_proto, ))
}
fn handle_suspend_readiness(&self, serialized_proto: Vec<u8>) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "HandleSuspendReadiness", (serialized_proto, ))
}
fn register_dark_suspend_delay(&self, serialized_request_proto: Vec<u8>) -> Result<Vec<u8>, dbus::Error> {
self.method_call("org.chromium.PowerManager", "RegisterDarkSuspendDelay", (serialized_request_proto, ))
.and_then(|r: (Vec<u8>, )| Ok(r.0, ))
}
fn unregister_dark_suspend_delay(&self, serialized_proto: Vec<u8>) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "UnregisterDarkSuspendDelay", (serialized_proto, ))
}
fn handle_dark_suspend_readiness(&self, serialized_proto: Vec<u8>) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "HandleDarkSuspendReadiness", (serialized_proto, ))
}
fn record_dark_resume_wake_reason(&self, serialized_proto: Vec<u8>) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "RecordDarkResumeWakeReason", (serialized_proto, ))
}
fn get_inactivity_delays(&self) -> Result<Vec<u8>, dbus::Error> {
self.method_call("org.chromium.PowerManager", "GetInactivityDelays", ())
.and_then(|r: (Vec<u8>, )| Ok(r.0, ))
}
fn has_ambient_color_device(&self) -> Result<bool, dbus::Error> {
self.method_call("org.chromium.PowerManager", "HasAmbientColorDevice", ())
.and_then(|r: (bool, )| Ok(r.0, ))
}
fn get_thermal_state(&self) -> Result<Vec<u8>, dbus::Error> {
self.method_call("org.chromium.PowerManager", "GetThermalState", ())
.and_then(|r: (Vec<u8>, )| Ok(r.0, ))
}
fn set_external_display_alsbrightness(&self, enabled: bool) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "SetExternalDisplayALSBrightness", (enabled, ))
}
fn get_external_display_alsbrightness(&self) -> Result<bool, dbus::Error> {
self.method_call("org.chromium.PowerManager", "GetExternalDisplayALSBrightness", ())
.and_then(|r: (bool, )| Ok(r.0, ))
}
fn charge_now_for_adaptive_charging(&self) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "ChargeNowForAdaptiveCharging", ())
}
fn get_charge_history(&self) -> Result<Vec<u8>, dbus::Error> {
self.method_call("org.chromium.PowerManager", "GetChargeHistory", ())
.and_then(|r: (Vec<u8>, )| Ok(r.0, ))
}
fn get_battery_saver_mode_state(&self) -> Result<Vec<u8>, dbus::Error> {
self.method_call("org.chromium.PowerManager", "GetBatterySaverModeState", ())
.and_then(|r: (Vec<u8>, )| Ok(r.0, ))
}
fn set_battery_saver_mode_state(&self, serialized_proto: Vec<u8>) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "SetBatterySaverModeState", (serialized_proto, ))
}
fn has_ambient_light_sensor(&self) -> Result<bool, dbus::Error> {
self.method_call("org.chromium.PowerManager", "HasAmbientLightSensor", ())
.and_then(|r: (bool, )| Ok(r.0, ))
}
fn set_ambient_light_sensor_enabled(&self, enabled: bool) -> Result<(), dbus::Error> {
self.method_call("org.chromium.PowerManager", "SetAmbientLightSensorEnabled", (enabled, ))
}
fn battery_state_poll(&self) -> Result<(u32, u32, f64), dbus::Error> {
self.method_call("org.chromium.PowerManager", "BatteryStatePoll", ())
}
}

View file

@ -12,6 +12,9 @@ pub trait OrgChromiumSpaced {
fn get_quota_current_space_for_uid(&self, path: &str, uid: u32) -> Result<i64, dbus::Error>;
fn get_quota_current_space_for_gid(&self, path: &str, gid: u32) -> Result<i64, dbus::Error>;
fn get_quota_current_space_for_project_id(&self, path: &str, project_id: u32) -> Result<i64, dbus::Error>;
fn get_quota_current_spaces_for_ids(&self, request: Vec<u8>) -> Result<Vec<u8>, dbus::Error>;
fn get_quota_overall_usage(&self, path: &str) -> Result<Vec<u8>, dbus::Error>;
fn get_quota_overall_usage_pretty_print(&self, path: &str) -> Result<String, dbus::Error>;
fn set_project_id(&self, fd: arg::OwnedFd, project_id: u32) -> Result<Vec<u8>, dbus::Error>;
fn set_project_inheritance_flag(&self, fd: arg::OwnedFd, enable: bool) -> Result<Vec<u8>, dbus::Error>;
}
@ -77,6 +80,21 @@ impl<'a, T: blocking::BlockingSender, C: ::std::ops::Deref<Target=T>> OrgChromiu
.and_then(|r: (i64, )| Ok(r.0, ))
}
fn get_quota_current_spaces_for_ids(&self, request: Vec<u8>) -> Result<Vec<u8>, dbus::Error> {
self.method_call("org.chromium.Spaced", "GetQuotaCurrentSpacesForIds", (request, ))
.and_then(|r: (Vec<u8>, )| Ok(r.0, ))
}
fn get_quota_overall_usage(&self, path: &str) -> Result<Vec<u8>, dbus::Error> {
self.method_call("org.chromium.Spaced", "GetQuotaOverallUsage", (path, ))
.and_then(|r: (Vec<u8>, )| Ok(r.0, ))
}
fn get_quota_overall_usage_pretty_print(&self, path: &str) -> Result<String, dbus::Error> {
self.method_call("org.chromium.Spaced", "GetQuotaOverallUsagePrettyPrint", (path, ))
.and_then(|r: (String, )| Ok(r.0, ))
}
fn set_project_id(&self, fd: arg::OwnedFd, project_id: u32) -> Result<Vec<u8>, dbus::Error> {
self.method_call("org.chromium.Spaced", "SetProjectId", (fd, project_id, ))
.and_then(|r: (Vec<u8>, )| Ok(r.0, ))

View file

@ -5,4 +5,6 @@ pub mod client {
pub use org_chromium_spaced::*;
pub mod org_chromium_vtpm;
pub use org_chromium_vtpm::*;
pub mod org_chromium_power_manager;
pub use org_chromium_power_manager::*;
}

View file

@ -1,5 +1,5 @@
// This file is generated by rust-protobuf 3.2.0. Do not edit
// .proto file is parsed by protoc 3.21.9
// .proto file is parsed by protoc 3.21.12
// @generated
// https://github.com/rust-lang/rust-clippy/issues/702
@ -335,6 +335,306 @@ impl ::protobuf::Message for StatefulDiskSpaceUpdate {
}
}
#[derive(PartialEq,Clone,Default,Debug)]
// @@protoc_insertion_point(message:spaced.GetQuotaCurrentSpacesForIdsRequest)
pub struct GetQuotaCurrentSpacesForIdsRequest {
// message fields
// @@protoc_insertion_point(field:spaced.GetQuotaCurrentSpacesForIdsRequest.path)
pub path: ::std::string::String,
// @@protoc_insertion_point(field:spaced.GetQuotaCurrentSpacesForIdsRequest.uids)
pub uids: ::std::vec::Vec<u32>,
// @@protoc_insertion_point(field:spaced.GetQuotaCurrentSpacesForIdsRequest.gids)
pub gids: ::std::vec::Vec<u32>,
// @@protoc_insertion_point(field:spaced.GetQuotaCurrentSpacesForIdsRequest.project_ids)
pub project_ids: ::std::vec::Vec<u32>,
// special fields
// @@protoc_insertion_point(special_field:spaced.GetQuotaCurrentSpacesForIdsRequest.special_fields)
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a GetQuotaCurrentSpacesForIdsRequest {
fn default() -> &'a GetQuotaCurrentSpacesForIdsRequest {
<GetQuotaCurrentSpacesForIdsRequest as ::protobuf::Message>::default_instance()
}
}
impl GetQuotaCurrentSpacesForIdsRequest {
pub fn new() -> GetQuotaCurrentSpacesForIdsRequest {
::std::default::Default::default()
}
}
impl ::protobuf::Message for GetQuotaCurrentSpacesForIdsRequest {
const NAME: &'static str = "GetQuotaCurrentSpacesForIdsRequest";
fn is_initialized(&self) -> bool {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
10 => {
self.path = is.read_string()?;
},
18 => {
is.read_repeated_packed_uint32_into(&mut self.uids)?;
},
16 => {
self.uids.push(is.read_uint32()?);
},
26 => {
is.read_repeated_packed_uint32_into(&mut self.gids)?;
},
24 => {
self.gids.push(is.read_uint32()?);
},
34 => {
is.read_repeated_packed_uint32_into(&mut self.project_ids)?;
},
32 => {
self.project_ids.push(is.read_uint32()?);
},
tag => {
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
// Compute sizes of nested messages
#[allow(unused_variables)]
fn compute_size(&self) -> u64 {
let mut my_size = 0;
if !self.path.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.path);
}
my_size += ::protobuf::rt::vec_packed_uint32_size(2, &self.uids);
my_size += ::protobuf::rt::vec_packed_uint32_size(3, &self.gids);
my_size += ::protobuf::rt::vec_packed_uint32_size(4, &self.project_ids);
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
self.special_fields.cached_size().set(my_size as u32);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
if !self.path.is_empty() {
os.write_string(1, &self.path)?;
}
os.write_repeated_packed_uint32(2, &self.uids)?;
os.write_repeated_packed_uint32(3, &self.gids)?;
os.write_repeated_packed_uint32(4, &self.project_ids)?;
os.write_unknown_fields(self.special_fields.unknown_fields())?;
::std::result::Result::Ok(())
}
fn special_fields(&self) -> &::protobuf::SpecialFields {
&self.special_fields
}
fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
&mut self.special_fields
}
fn new() -> GetQuotaCurrentSpacesForIdsRequest {
GetQuotaCurrentSpacesForIdsRequest::new()
}
fn clear(&mut self) {
self.path.clear();
self.uids.clear();
self.gids.clear();
self.project_ids.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static GetQuotaCurrentSpacesForIdsRequest {
static instance: GetQuotaCurrentSpacesForIdsRequest = GetQuotaCurrentSpacesForIdsRequest {
path: ::std::string::String::new(),
uids: ::std::vec::Vec::new(),
gids: ::std::vec::Vec::new(),
project_ids: ::std::vec::Vec::new(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq,Clone,Default,Debug)]
// @@protoc_insertion_point(message:spaced.GetQuotaCurrentSpacesForIdsReply)
pub struct GetQuotaCurrentSpacesForIdsReply {
// message fields
// @@protoc_insertion_point(field:spaced.GetQuotaCurrentSpacesForIdsReply.curspaces_for_uids)
pub curspaces_for_uids: ::std::collections::HashMap<u32, i64>,
// @@protoc_insertion_point(field:spaced.GetQuotaCurrentSpacesForIdsReply.curspaces_for_gids)
pub curspaces_for_gids: ::std::collections::HashMap<u32, i64>,
// @@protoc_insertion_point(field:spaced.GetQuotaCurrentSpacesForIdsReply.curspaces_for_project_ids)
pub curspaces_for_project_ids: ::std::collections::HashMap<u32, i64>,
// special fields
// @@protoc_insertion_point(special_field:spaced.GetQuotaCurrentSpacesForIdsReply.special_fields)
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a GetQuotaCurrentSpacesForIdsReply {
fn default() -> &'a GetQuotaCurrentSpacesForIdsReply {
<GetQuotaCurrentSpacesForIdsReply as ::protobuf::Message>::default_instance()
}
}
impl GetQuotaCurrentSpacesForIdsReply {
pub fn new() -> GetQuotaCurrentSpacesForIdsReply {
::std::default::Default::default()
}
}
impl ::protobuf::Message for GetQuotaCurrentSpacesForIdsReply {
const NAME: &'static str = "GetQuotaCurrentSpacesForIdsReply";
fn is_initialized(&self) -> bool {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
10 => {
let len = is.read_raw_varint32()?;
let old_limit = is.push_limit(len as u64)?;
let mut key = ::std::default::Default::default();
let mut value = ::std::default::Default::default();
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
8 => key = is.read_uint32()?,
16 => value = is.read_int64()?,
_ => ::protobuf::rt::skip_field_for_tag(tag, is)?,
};
}
is.pop_limit(old_limit);
self.curspaces_for_uids.insert(key, value);
},
18 => {
let len = is.read_raw_varint32()?;
let old_limit = is.push_limit(len as u64)?;
let mut key = ::std::default::Default::default();
let mut value = ::std::default::Default::default();
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
8 => key = is.read_uint32()?,
16 => value = is.read_int64()?,
_ => ::protobuf::rt::skip_field_for_tag(tag, is)?,
};
}
is.pop_limit(old_limit);
self.curspaces_for_gids.insert(key, value);
},
26 => {
let len = is.read_raw_varint32()?;
let old_limit = is.push_limit(len as u64)?;
let mut key = ::std::default::Default::default();
let mut value = ::std::default::Default::default();
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
8 => key = is.read_uint32()?,
16 => value = is.read_int64()?,
_ => ::protobuf::rt::skip_field_for_tag(tag, is)?,
};
}
is.pop_limit(old_limit);
self.curspaces_for_project_ids.insert(key, value);
},
tag => {
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
// Compute sizes of nested messages
#[allow(unused_variables)]
fn compute_size(&self) -> u64 {
let mut my_size = 0;
for (k, v) in &self.curspaces_for_uids {
let mut entry_size = 0;
entry_size += ::protobuf::rt::uint32_size(1, *k);
entry_size += ::protobuf::rt::int64_size(2, *v);
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(entry_size) + entry_size
};
for (k, v) in &self.curspaces_for_gids {
let mut entry_size = 0;
entry_size += ::protobuf::rt::uint32_size(1, *k);
entry_size += ::protobuf::rt::int64_size(2, *v);
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(entry_size) + entry_size
};
for (k, v) in &self.curspaces_for_project_ids {
let mut entry_size = 0;
entry_size += ::protobuf::rt::uint32_size(1, *k);
entry_size += ::protobuf::rt::int64_size(2, *v);
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(entry_size) + entry_size
};
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
self.special_fields.cached_size().set(my_size as u32);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
for (k, v) in &self.curspaces_for_uids {
let mut entry_size = 0;
entry_size += ::protobuf::rt::uint32_size(1, *k);
entry_size += ::protobuf::rt::int64_size(2, *v);
os.write_raw_varint32(10)?; // Tag.
os.write_raw_varint32(entry_size as u32)?;
os.write_uint32(1, *k)?;
os.write_int64(2, *v)?;
};
for (k, v) in &self.curspaces_for_gids {
let mut entry_size = 0;
entry_size += ::protobuf::rt::uint32_size(1, *k);
entry_size += ::protobuf::rt::int64_size(2, *v);
os.write_raw_varint32(18)?; // Tag.
os.write_raw_varint32(entry_size as u32)?;
os.write_uint32(1, *k)?;
os.write_int64(2, *v)?;
};
for (k, v) in &self.curspaces_for_project_ids {
let mut entry_size = 0;
entry_size += ::protobuf::rt::uint32_size(1, *k);
entry_size += ::protobuf::rt::int64_size(2, *v);
os.write_raw_varint32(26)?; // Tag.
os.write_raw_varint32(entry_size as u32)?;
os.write_uint32(1, *k)?;
os.write_int64(2, *v)?;
};
os.write_unknown_fields(self.special_fields.unknown_fields())?;
::std::result::Result::Ok(())
}
fn special_fields(&self) -> &::protobuf::SpecialFields {
&self.special_fields
}
fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
&mut self.special_fields
}
fn new() -> GetQuotaCurrentSpacesForIdsReply {
GetQuotaCurrentSpacesForIdsReply::new()
}
fn clear(&mut self) {
self.curspaces_for_uids.clear();
self.curspaces_for_gids.clear();
self.curspaces_for_project_ids.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static GetQuotaCurrentSpacesForIdsReply {
static instance: ::protobuf::rt::Lazy<GetQuotaCurrentSpacesForIdsReply> = ::protobuf::rt::Lazy::new();
instance.get(GetQuotaCurrentSpacesForIdsReply::new)
}
}
#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
// @@protoc_insertion_point(enum:spaced.StatefulDiskSpaceState)
pub enum StatefulDiskSpaceState {

View file

@ -1,5 +1,5 @@
// This file is generated by rust-protobuf 3.2.0. Do not edit
// .proto file is parsed by protoc 3.21.9
// .proto file is parsed by protoc 3.21.12
// @generated
// https://github.com/rust-lang/rust-clippy/issues/702

View file

@ -16,6 +16,7 @@ fi
FILES=(
"src/bindings/client/org_chromium_spaced.rs"
"src/bindings/client/org_chromium_vtpm.rs"
"src/bindings/client/org_chromium_power_manager.rs"
"src/protos/spaced.rs"
"src/protos/vtpm_interface.rs"
)