~aleteoryx/muditaos

ref: a3b11efb340200dae6efe5d9448a4900bcc78d3e muditaos/module-services/service-desktop/DesktopMessages.cpp -rw-r--r-- 2.1 KiB
a3b11efb — Lukasz Mastalerz [CP-1966] Deleted file which is played does not stop the playback timer 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "service-desktop/DesktopMessages.hpp"
#include "parser/MessageHandler.hpp"
#include <module-bluetooth/Bluetooth/Device.hpp>
#include <endpoints/developerMode/DeveloperModeEndpoint.hpp>

namespace sdesktop
{
    using namespace endpoints;

    namespace developerMode
    {

        AppFocusChangeEvent::AppFocusChangeEvent(std::string appName)
        {
            context.setResponseStatus(http::Code::OK);
            context.setEndpoint(EndpointType::developerMode);
            context.setResponseBody(json11::Json::object{{json::developerMode::focus, appName}});
        }

        ScreenlockCheckEvent::ScreenlockCheckEvent(bool isLocked)
        {
            context.setResponseStatus(http::Code::OK);
            context.setEndpoint(EndpointType::developerMode);
            context.setResponseBody(json11::Json::object{{json::developerMode::phoneLocked, isLocked}});
        }

        CellularStateInfoRequestEvent::CellularStateInfoRequestEvent(std::string stateStr)
        {
            context.setResponseStatus(http::Code::OK);
            context.setEndpoint(EndpointType::developerMode);
            context.setResponseBody(json11::Json::object{{json::developerMode::cellularStateInfo, stateStr}});
        }

        CellularSleepModeInfoRequestEvent::CellularSleepModeInfoRequestEvent(bool isInSleepMode)
        {
            context.setResponseStatus(http::Code::OK);
            context.setEndpoint(EndpointType::developerMode);
            context.setResponseBody(json11::Json::object{{json::developerMode::cellularSleepModeInfo, isInSleepMode}});
        }
    } // namespace developerMode

    namespace usb
    {
        USBConfigured::USBConfigured(USBConfigurationType configurationType)
            : sys::DataMessage(MessageType::USBConfigured), configurationType(configurationType)
        {}

        USBConfigurationType USBConfigured::getConfigurationType() const noexcept
        {
            return configurationType;
        }
    } // namespace usb

} // namespace sdesktop