Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 625ee07c authored by Martin Brabham's avatar Martin Brabham
Browse files

Floss: Rename SuspendType entries

Bug: 231437552
Test: ./build.py
Test: mma -j $(nproc)
Test: system/gd/cert/run --topshim
Tag: #floss
Change-Id: Ie3a37ccd311e1bfc698eac08f133a107c88416f0
parent bd8cfa5b
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -420,8 +420,8 @@ impl PowerdSuspendManager {
        if let Some(adapter_suspend_dbus) = &self.context.lock().unwrap().adapter_suspend_dbus {
        if let Some(adapter_suspend_dbus) = &self.context.lock().unwrap().adapter_suspend_dbus {
            let adapter_suspend_id =
            let adapter_suspend_id =
                adapter_suspend_dbus.suspend(match suspend_imminent.get_reason() {
                adapter_suspend_dbus.suspend(match suspend_imminent.get_reason() {
                    SuspendImminent_Reason::IDLE => SuspendType::AllowWakeFromHid,
                    SuspendImminent_Reason::IDLE => SuspendType::Connected,
                    SuspendImminent_Reason::LID_CLOSED => SuspendType::NoWakesAllowed,
                    SuspendImminent_Reason::LID_CLOSED => SuspendType::Disconnected,
                    SuspendImminent_Reason::OTHER => SuspendType::Other,
                    SuspendImminent_Reason::OTHER => SuspendType::Other,
                });
                });
            log::debug!("Adapter suspend id = {}", adapter_suspend_id);
            log::debug!("Adapter suspend id = {}", adapter_suspend_id);
+4 −6
Original line number Original line Diff line number Diff line
@@ -51,8 +51,8 @@ pub trait ISuspendCallback: RPCProxy {
#[derive(FromPrimitive, ToPrimitive)]
#[derive(FromPrimitive, ToPrimitive)]
#[repr(u32)]
#[repr(u32)]
pub enum SuspendType {
pub enum SuspendType {
    NoWakesAllowed,
    Disconnected,
    AllowWakeFromHid,
    Connected,
    Other,
    Other,
}
}


@@ -128,14 +128,12 @@ impl ISuspend for Suspend {
    fn suspend(&self, suspend_type: SuspendType) -> u32 {
    fn suspend(&self, suspend_type: SuspendType) -> u32 {
        let suspend_id = 1;
        let suspend_id = 1;
        match suspend_type {
        match suspend_type {
            // TODO(231437552): Rename AllowWakeFromHid to Connected since it isn't only for HID
            SuspendType::Connected => {
            SuspendType::AllowWakeFromHid => {
                // TODO(231345733): API For allowing classic HID only
                // TODO(231345733): API For allowing classic HID only
                // TODO(230604670): check if A2DP is connected
                // TODO(230604670): check if A2DP is connected
                // TODO(224603198): save all advertiser information
                // TODO(224603198): save all advertiser information
            }
            }
            // TODO(231437552): Rename NoWakesAllowed to Disconnected since it isn't only for HID
            SuspendType::Disconnected => {
            SuspendType::NoWakesAllowed => {
                self.intf.lock().unwrap().clear_event_filter();
                self.intf.lock().unwrap().clear_event_filter();
                self.intf.lock().unwrap().clear_event_mask();
                self.intf.lock().unwrap().clear_event_mask();
            }
            }