//
// Automatically generated by ipdlc.
// Edit at your own risk
//


#include "mozilla/hal_sandbox/PHalParent.h"

#include "mozilla/dom/PContentParent.h"
#include "mozilla/dom/PBrowserParent.h"

#include "nsIFile.h"
#include "GeckoProfiler.h"

namespace mozilla {
namespace hal_sandbox {


auto PHalParent::Recv__delete__() -> bool
{
    return true;
}


MOZ_IMPLICIT PHalParent::PHalParent() :
    mozilla::ipc::IProtocol(mozilla::ipc::ParentSide),
    mState(PHal::__Dead)
{
    MOZ_COUNT_CTOR(PHalParent);
}

PHalParent::~PHalParent()
{
    MOZ_COUNT_DTOR(PHalParent);
}

auto PHalParent::Manager() const -> PContentParent*
{
    return static_cast<PContentParent*>(IProtocol::Manager());
}

auto PHalParent::state() -> PHal::State
{
    return mState;
}

auto PHalParent::SendNotifyBatteryChange(const BatteryInformation& aBatteryInfo) -> bool
{
    IPC::Message* msg__ = PHal::Msg_NotifyBatteryChange(Id());

    Write(aBatteryInfo, msg__);
    // Sentinel = 'aBatteryInfo'
    (msg__)->WriteSentinel(2078351088);




    if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
        mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
    }
    PROFILER_LABEL("PHal", "Msg_NotifyBatteryChange", js::ProfileEntry::Category::OTHER);
    if ((!(PHal::Transition(Trigger(Trigger::Send, PHal::Msg_NotifyBatteryChange__ID), (&(mState)))))) {
        NS_WARNING("bad state transition!");
    }

    bool sendok__ = (GetIPCChannel())->Send(msg__);
    return sendok__;
}

auto PHalParent::SendNotifyNetworkChange(const NetworkInformation& aNetworkInfo) -> bool
{
    IPC::Message* msg__ = PHal::Msg_NotifyNetworkChange(Id());

    Write(aNetworkInfo, msg__);
    // Sentinel = 'aNetworkInfo'
    (msg__)->WriteSentinel(1908218217);




    if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
        mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
    }
    PROFILER_LABEL("PHal", "Msg_NotifyNetworkChange", js::ProfileEntry::Category::OTHER);
    if ((!(PHal::Transition(Trigger(Trigger::Send, PHal::Msg_NotifyNetworkChange__ID), (&(mState)))))) {
        NS_WARNING("bad state transition!");
    }

    bool sendok__ = (GetIPCChannel())->Send(msg__);
    return sendok__;
}

auto PHalParent::SendNotifyWakeLockChange(const WakeLockInformation& aWakeLockInfo) -> bool
{
    IPC::Message* msg__ = PHal::Msg_NotifyWakeLockChange(Id());

    Write(aWakeLockInfo, msg__);
    // Sentinel = 'aWakeLockInfo'
    (msg__)->WriteSentinel(1498930717);




    if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
        mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
    }
    PROFILER_LABEL("PHal", "Msg_NotifyWakeLockChange", js::ProfileEntry::Category::OTHER);
    if ((!(PHal::Transition(Trigger(Trigger::Send, PHal::Msg_NotifyWakeLockChange__ID), (&(mState)))))) {
        NS_WARNING("bad state transition!");
    }

    bool sendok__ = (GetIPCChannel())->Send(msg__);
    return sendok__;
}

auto PHalParent::SendNotifyScreenConfigurationChange(const ScreenConfiguration& aScreenOrientation) -> bool
{
    IPC::Message* msg__ = PHal::Msg_NotifyScreenConfigurationChange(Id());

    Write(aScreenOrientation, msg__);
    // Sentinel = 'aScreenOrientation'
    (msg__)->WriteSentinel(2886778787);




    if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
        mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
    }
    PROFILER_LABEL("PHal", "Msg_NotifyScreenConfigurationChange", js::ProfileEntry::Category::OTHER);
    if ((!(PHal::Transition(Trigger(Trigger::Send, PHal::Msg_NotifyScreenConfigurationChange__ID), (&(mState)))))) {
        NS_WARNING("bad state transition!");
    }

    bool sendok__ = (GetIPCChannel())->Send(msg__);
    return sendok__;
}

auto PHalParent::SendNotifySwitchChange(const SwitchEvent& aEvent) -> bool
{
    IPC::Message* msg__ = PHal::Msg_NotifySwitchChange(Id());

    Write(aEvent, msg__);
    // Sentinel = 'aEvent'
    (msg__)->WriteSentinel(3531117325);




    if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
        mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
    }
    PROFILER_LABEL("PHal", "Msg_NotifySwitchChange", js::ProfileEntry::Category::OTHER);
    if ((!(PHal::Transition(Trigger(Trigger::Send, PHal::Msg_NotifySwitchChange__ID), (&(mState)))))) {
        NS_WARNING("bad state transition!");
    }

    bool sendok__ = (GetIPCChannel())->Send(msg__);
    return sendok__;
}

auto PHalParent::SendNotifySystemClockChange(const int64_t& aClockDeltaMS) -> bool
{
    IPC::Message* msg__ = PHal::Msg_NotifySystemClockChange(Id());

    Write(aClockDeltaMS, msg__);
    // Sentinel = 'aClockDeltaMS'
    (msg__)->WriteSentinel(490214104);




    if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
        mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
    }
    PROFILER_LABEL("PHal", "Msg_NotifySystemClockChange", js::ProfileEntry::Category::OTHER);
    if ((!(PHal::Transition(Trigger(Trigger::Send, PHal::Msg_NotifySystemClockChange__ID), (&(mState)))))) {
        NS_WARNING("bad state transition!");
    }

    bool sendok__ = (GetIPCChannel())->Send(msg__);
    return sendok__;
}

auto PHalParent::SendNotifySystemTimezoneChange(const SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo) -> bool
{
    IPC::Message* msg__ = PHal::Msg_NotifySystemTimezoneChange(Id());

    Write(aSystemTimezoneChangeInfo, msg__);
    // Sentinel = 'aSystemTimezoneChangeInfo'
    (msg__)->WriteSentinel(3797357450);




    if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
        mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
    }
    PROFILER_LABEL("PHal", "Msg_NotifySystemTimezoneChange", js::ProfileEntry::Category::OTHER);
    if ((!(PHal::Transition(Trigger(Trigger::Send, PHal::Msg_NotifySystemTimezoneChange__ID), (&(mState)))))) {
        NS_WARNING("bad state transition!");
    }

    bool sendok__ = (GetIPCChannel())->Send(msg__);
    return sendok__;
}

auto PHalParent::SendNotifySensorChange(const SensorData& aSensorData) -> bool
{
    IPC::Message* msg__ = PHal::Msg_NotifySensorChange(Id());

    Write(aSensorData, msg__);
    // Sentinel = 'aSensorData'
    (msg__)->WriteSentinel(2949034804);




    if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
        mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
    }
    PROFILER_LABEL("PHal", "Msg_NotifySensorChange", js::ProfileEntry::Category::OTHER);
    if ((!(PHal::Transition(Trigger(Trigger::Send, PHal::Msg_NotifySensorChange__ID), (&(mState)))))) {
        NS_WARNING("bad state transition!");
    }

    bool sendok__ = (GetIPCChannel())->Send(msg__);
    return sendok__;
}

auto PHalParent::RemoveManagee(
        int32_t aProtocolId,
        ProtocolBase* aListener) -> void
{
    FatalError("unreached");
    return;
}

auto PHalParent::OnMessageReceived(const Message& msg__) -> PHalParent::Result
{
    switch ((msg__).type()) {
    case PHal::Msg_Vibrate__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_Vibrate", js::ProfileEntry::Category::OTHER);

            PickleIterator iter__ = PickleIterator(msg__);
            nsTArray<uint32_t> pattern;
            nsTArray<uint64_t> id;
            PBrowserParent* browser;

            if ((!(Read((&(pattern)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'nsTArray'");
                return MsgValueError;
            }
            // Sentinel = 'pattern'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2105892009)))) {
                FatalError("Error deserializing 'nsTArray'");
                return MsgValueError;
            }
            if ((!(Read((&(id)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'nsTArray'");
                return MsgValueError;
            }
            // Sentinel = 'id'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2794505629)))) {
                FatalError("Error deserializing 'nsTArray'");
                return MsgValueError;
            }
            if ((!(Read((&(browser)), (&(msg__)), (&(iter__)), false)))) {
                FatalError("Error deserializing 'PBrowserParent'");
                return MsgValueError;
            }
            // Sentinel = 'browser'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2836343679)))) {
                FatalError("Error deserializing 'PBrowserParent'");
                return MsgValueError;
            }
            (msg__).EndRead(iter__);
            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_Vibrate__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvVibrate(mozilla::Move(pattern), mozilla::Move(id), mozilla::Move(browser))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_CancelVibrate__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_CancelVibrate", js::ProfileEntry::Category::OTHER);

            PickleIterator iter__ = PickleIterator(msg__);
            nsTArray<uint64_t> id;
            PBrowserParent* browser;

            if ((!(Read((&(id)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'nsTArray'");
                return MsgValueError;
            }
            // Sentinel = 'id'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2794505629)))) {
                FatalError("Error deserializing 'nsTArray'");
                return MsgValueError;
            }
            if ((!(Read((&(browser)), (&(msg__)), (&(iter__)), false)))) {
                FatalError("Error deserializing 'PBrowserParent'");
                return MsgValueError;
            }
            // Sentinel = 'browser'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2836343679)))) {
                FatalError("Error deserializing 'PBrowserParent'");
                return MsgValueError;
            }
            (msg__).EndRead(iter__);
            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_CancelVibrate__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvCancelVibrate(mozilla::Move(id), mozilla::Move(browser))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_EnableBatteryNotifications__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_EnableBatteryNotifications", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_EnableBatteryNotifications__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvEnableBatteryNotifications()))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_DisableBatteryNotifications__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_DisableBatteryNotifications", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_DisableBatteryNotifications__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvDisableBatteryNotifications()))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_EnableNetworkNotifications__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_EnableNetworkNotifications", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_EnableNetworkNotifications__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvEnableNetworkNotifications()))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_DisableNetworkNotifications__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_DisableNetworkNotifications", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_DisableNetworkNotifications__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvDisableNetworkNotifications()))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_SetScreenEnabled__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_SetScreenEnabled", js::ProfileEntry::Category::OTHER);

            PickleIterator iter__ = PickleIterator(msg__);
            bool aEnabled;

            if ((!(Read((&(aEnabled)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'bool'");
                return MsgValueError;
            }
            // Sentinel = 'aEnabled'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2225039408)))) {
                FatalError("Error deserializing 'bool'");
                return MsgValueError;
            }
            (msg__).EndRead(iter__);
            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_SetScreenEnabled__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvSetScreenEnabled(mozilla::Move(aEnabled))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_SetKeyLightEnabled__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_SetKeyLightEnabled", js::ProfileEntry::Category::OTHER);

            PickleIterator iter__ = PickleIterator(msg__);
            bool aEnabled;

            if ((!(Read((&(aEnabled)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'bool'");
                return MsgValueError;
            }
            // Sentinel = 'aEnabled'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2225039408)))) {
                FatalError("Error deserializing 'bool'");
                return MsgValueError;
            }
            (msg__).EndRead(iter__);
            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_SetKeyLightEnabled__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvSetKeyLightEnabled(mozilla::Move(aEnabled))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_SetCpuSleepAllowed__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_SetCpuSleepAllowed", js::ProfileEntry::Category::OTHER);

            PickleIterator iter__ = PickleIterator(msg__);
            bool aAllowed;

            if ((!(Read((&(aAllowed)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'bool'");
                return MsgValueError;
            }
            // Sentinel = 'aAllowed'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 785233983)))) {
                FatalError("Error deserializing 'bool'");
                return MsgValueError;
            }
            (msg__).EndRead(iter__);
            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_SetCpuSleepAllowed__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvSetCpuSleepAllowed(mozilla::Move(aAllowed))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_SetScreenBrightness__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_SetScreenBrightness", js::ProfileEntry::Category::OTHER);

            PickleIterator iter__ = PickleIterator(msg__);
            double aBrightness;

            if ((!(Read((&(aBrightness)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'double'");
                return MsgValueError;
            }
            // Sentinel = 'aBrightness'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2646084451)))) {
                FatalError("Error deserializing 'double'");
                return MsgValueError;
            }
            (msg__).EndRead(iter__);
            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_SetScreenBrightness__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvSetScreenBrightness(mozilla::Move(aBrightness))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_AdjustSystemClock__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_AdjustSystemClock", js::ProfileEntry::Category::OTHER);

            PickleIterator iter__ = PickleIterator(msg__);
            int64_t aDeltaMilliseconds;

            if ((!(Read((&(aDeltaMilliseconds)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'int64_t'");
                return MsgValueError;
            }
            // Sentinel = 'aDeltaMilliseconds'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 596392573)))) {
                FatalError("Error deserializing 'int64_t'");
                return MsgValueError;
            }
            (msg__).EndRead(iter__);
            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_AdjustSystemClock__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvAdjustSystemClock(mozilla::Move(aDeltaMilliseconds))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_SetTimezone__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_SetTimezone", js::ProfileEntry::Category::OTHER);

            PickleIterator iter__ = PickleIterator(msg__);
            nsCString aTimezoneSpec;

            if ((!(Read((&(aTimezoneSpec)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'nsCString'");
                return MsgValueError;
            }
            // Sentinel = 'aTimezoneSpec'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2553958496)))) {
                FatalError("Error deserializing 'nsCString'");
                return MsgValueError;
            }
            (msg__).EndRead(iter__);
            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_SetTimezone__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvSetTimezone(mozilla::Move(aTimezoneSpec))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_EnableSystemClockChangeNotifications__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_EnableSystemClockChangeNotifications", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_EnableSystemClockChangeNotifications__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvEnableSystemClockChangeNotifications()))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_DisableSystemClockChangeNotifications__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_DisableSystemClockChangeNotifications", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_DisableSystemClockChangeNotifications__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvDisableSystemClockChangeNotifications()))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_EnableSystemTimezoneChangeNotifications__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_EnableSystemTimezoneChangeNotifications", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_EnableSystemTimezoneChangeNotifications__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvEnableSystemTimezoneChangeNotifications()))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_DisableSystemTimezoneChangeNotifications__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_DisableSystemTimezoneChangeNotifications", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_DisableSystemTimezoneChangeNotifications__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvDisableSystemTimezoneChangeNotifications()))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_ModifyWakeLock__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_ModifyWakeLock", js::ProfileEntry::Category::OTHER);

            PickleIterator iter__ = PickleIterator(msg__);
            nsString aTopic;
            WakeLockControl aLockAdjust;
            WakeLockControl aHiddenAdjust;
            uint64_t aProcessID;

            if ((!(Read((&(aTopic)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'nsString'");
                return MsgValueError;
            }
            // Sentinel = 'aTopic'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2759450316)))) {
                FatalError("Error deserializing 'nsString'");
                return MsgValueError;
            }
            if ((!(Read((&(aLockAdjust)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'WakeLockControl'");
                return MsgValueError;
            }
            // Sentinel = 'aLockAdjust'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3857892778)))) {
                FatalError("Error deserializing 'WakeLockControl'");
                return MsgValueError;
            }
            if ((!(Read((&(aHiddenAdjust)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'WakeLockControl'");
                return MsgValueError;
            }
            // Sentinel = 'aHiddenAdjust'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2900615369)))) {
                FatalError("Error deserializing 'WakeLockControl'");
                return MsgValueError;
            }
            if ((!(Read((&(aProcessID)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'uint64_t'");
                return MsgValueError;
            }
            // Sentinel = 'aProcessID'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2181368637)))) {
                FatalError("Error deserializing 'uint64_t'");
                return MsgValueError;
            }
            (msg__).EndRead(iter__);
            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_ModifyWakeLock__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvModifyWakeLock(mozilla::Move(aTopic), mozilla::Move(aLockAdjust), mozilla::Move(aHiddenAdjust), mozilla::Move(aProcessID))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_EnableWakeLockNotifications__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_EnableWakeLockNotifications", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_EnableWakeLockNotifications__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvEnableWakeLockNotifications()))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_DisableWakeLockNotifications__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_DisableWakeLockNotifications", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_DisableWakeLockNotifications__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvDisableWakeLockNotifications()))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_EnableScreenConfigurationNotifications__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_EnableScreenConfigurationNotifications", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_EnableScreenConfigurationNotifications__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvEnableScreenConfigurationNotifications()))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_DisableScreenConfigurationNotifications__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_DisableScreenConfigurationNotifications", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_DisableScreenConfigurationNotifications__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvDisableScreenConfigurationNotifications()))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_UnlockScreenOrientation__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_UnlockScreenOrientation", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_UnlockScreenOrientation__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvUnlockScreenOrientation()))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_EnableSwitchNotifications__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_EnableSwitchNotifications", js::ProfileEntry::Category::OTHER);

            PickleIterator iter__ = PickleIterator(msg__);
            SwitchDevice aDevice;

            if ((!(Read((&(aDevice)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'SwitchDevice'");
                return MsgValueError;
            }
            // Sentinel = 'aDevice'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2436697236)))) {
                FatalError("Error deserializing 'SwitchDevice'");
                return MsgValueError;
            }
            (msg__).EndRead(iter__);
            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_EnableSwitchNotifications__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvEnableSwitchNotifications(mozilla::Move(aDevice))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_DisableSwitchNotifications__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_DisableSwitchNotifications", js::ProfileEntry::Category::OTHER);

            PickleIterator iter__ = PickleIterator(msg__);
            SwitchDevice aDevice;

            if ((!(Read((&(aDevice)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'SwitchDevice'");
                return MsgValueError;
            }
            // Sentinel = 'aDevice'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2436697236)))) {
                FatalError("Error deserializing 'SwitchDevice'");
                return MsgValueError;
            }
            (msg__).EndRead(iter__);
            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_DisableSwitchNotifications__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvDisableSwitchNotifications(mozilla::Move(aDevice))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_FactoryReset__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_FactoryReset", js::ProfileEntry::Category::OTHER);

            PickleIterator iter__ = PickleIterator(msg__);
            nsString aReason;

            if ((!(Read((&(aReason)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'nsString'");
                return MsgValueError;
            }
            // Sentinel = 'aReason'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 829905706)))) {
                FatalError("Error deserializing 'nsString'");
                return MsgValueError;
            }
            (msg__).EndRead(iter__);
            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_FactoryReset__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvFactoryReset(mozilla::Move(aReason))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_EnableSensorNotifications__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_EnableSensorNotifications", js::ProfileEntry::Category::OTHER);

            PickleIterator iter__ = PickleIterator(msg__);
            SensorType aSensor;

            if ((!(Read((&(aSensor)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'SensorType'");
                return MsgValueError;
            }
            // Sentinel = 'aSensor'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 942615000)))) {
                FatalError("Error deserializing 'SensorType'");
                return MsgValueError;
            }
            (msg__).EndRead(iter__);
            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_EnableSensorNotifications__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvEnableSensorNotifications(mozilla::Move(aSensor))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg_DisableSensorNotifications__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_DisableSensorNotifications", js::ProfileEntry::Category::OTHER);

            PickleIterator iter__ = PickleIterator(msg__);
            SensorType aSensor;

            if ((!(Read((&(aSensor)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'SensorType'");
                return MsgValueError;
            }
            // Sentinel = 'aSensor'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 942615000)))) {
                FatalError("Error deserializing 'SensorType'");
                return MsgValueError;
            }
            (msg__).EndRead(iter__);
            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_DisableSensorNotifications__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(RecvDisableSensorNotifications(mozilla::Move(aSensor))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PHal::Msg___delete____ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg___delete__", js::ProfileEntry::Category::OTHER);

            PickleIterator iter__ = PickleIterator(msg__);
            PHalParent* actor;

            if ((!(Read((&(actor)), (&(msg__)), (&(iter__)), false)))) {
                FatalError("Error deserializing 'PHalParent'");
                return MsgValueError;
            }
            // Sentinel = 'actor'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
                FatalError("Error deserializing 'PHalParent'");
                return MsgValueError;
            }
            (msg__).EndRead(iter__);
            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg___delete____ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            if ((!(Recv__delete__()))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }


            (actor)->DestroySubtree(Deletion);
            (actor)->DeallocSubtree();
            ((actor)->Manager())->RemoveManagee(PHalMsgStart, actor);

            return MsgProcessed;
        }
    default:
        {
            return MsgNotKnown;
        }
    }
}

auto PHalParent::OnMessageReceived(
        const Message& msg__,
        Message*& reply__) -> PHalParent::Result
{
    switch ((msg__).type()) {
    case PHal::Msg_GetCurrentBatteryInformation__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_GetCurrentBatteryInformation", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_GetCurrentBatteryInformation__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            BatteryInformation aBatteryInfo;
            int32_t id__ = Id();
            if ((!(RecvGetCurrentBatteryInformation((&(aBatteryInfo)))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            reply__ = PHal::Reply_GetCurrentBatteryInformation(id__);

            Write(aBatteryInfo, reply__);
            // Sentinel = 'aBatteryInfo'
            (reply__)->WriteSentinel(2078351088);
            (reply__)->set_sync();
            (reply__)->set_reply();

            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending);
            }
            return MsgProcessed;
        }
    case PHal::Msg_GetCurrentNetworkInformation__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_GetCurrentNetworkInformation", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_GetCurrentNetworkInformation__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            NetworkInformation aNetworkInfo;
            int32_t id__ = Id();
            if ((!(RecvGetCurrentNetworkInformation((&(aNetworkInfo)))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            reply__ = PHal::Reply_GetCurrentNetworkInformation(id__);

            Write(aNetworkInfo, reply__);
            // Sentinel = 'aNetworkInfo'
            (reply__)->WriteSentinel(1908218217);
            (reply__)->set_sync();
            (reply__)->set_reply();

            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending);
            }
            return MsgProcessed;
        }
    case PHal::Msg_GetScreenEnabled__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_GetScreenEnabled", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_GetScreenEnabled__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            bool enabled;
            int32_t id__ = Id();
            if ((!(RecvGetScreenEnabled((&(enabled)))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            reply__ = PHal::Reply_GetScreenEnabled(id__);

            Write(enabled, reply__);
            // Sentinel = 'enabled'
            (reply__)->WriteSentinel(3743499116);
            (reply__)->set_sync();
            (reply__)->set_reply();

            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending);
            }
            return MsgProcessed;
        }
    case PHal::Msg_GetKeyLightEnabled__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_GetKeyLightEnabled", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_GetKeyLightEnabled__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            bool enabled;
            int32_t id__ = Id();
            if ((!(RecvGetKeyLightEnabled((&(enabled)))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            reply__ = PHal::Reply_GetKeyLightEnabled(id__);

            Write(enabled, reply__);
            // Sentinel = 'enabled'
            (reply__)->WriteSentinel(3743499116);
            (reply__)->set_sync();
            (reply__)->set_reply();

            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending);
            }
            return MsgProcessed;
        }
    case PHal::Msg_GetCpuSleepAllowed__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_GetCpuSleepAllowed", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_GetCpuSleepAllowed__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            bool allowed;
            int32_t id__ = Id();
            if ((!(RecvGetCpuSleepAllowed((&(allowed)))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            reply__ = PHal::Reply_GetCpuSleepAllowed(id__);

            Write(allowed, reply__);
            // Sentinel = 'allowed'
            (reply__)->WriteSentinel(1297156503);
            (reply__)->set_sync();
            (reply__)->set_reply();

            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending);
            }
            return MsgProcessed;
        }
    case PHal::Msg_GetScreenBrightness__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_GetScreenBrightness", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_GetScreenBrightness__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            double brightness;
            int32_t id__ = Id();
            if ((!(RecvGetScreenBrightness((&(brightness)))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            reply__ = PHal::Reply_GetScreenBrightness(id__);

            Write(brightness, reply__);
            // Sentinel = 'brightness'
            (reply__)->WriteSentinel(288670311);
            (reply__)->set_sync();
            (reply__)->set_reply();

            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending);
            }
            return MsgProcessed;
        }
    case PHal::Msg_GetTimezone__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_GetTimezone", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_GetTimezone__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            nsCString aTimezoneSpec;
            int32_t id__ = Id();
            if ((!(RecvGetTimezone((&(aTimezoneSpec)))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            reply__ = PHal::Reply_GetTimezone(id__);

            Write(aTimezoneSpec, reply__);
            // Sentinel = 'aTimezoneSpec'
            (reply__)->WriteSentinel(2553958496);
            (reply__)->set_sync();
            (reply__)->set_reply();

            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending);
            }
            return MsgProcessed;
        }
    case PHal::Msg_GetTimezoneOffset__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_GetTimezoneOffset", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_GetTimezoneOffset__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            int32_t aTimezoneOffset;
            int32_t id__ = Id();
            if ((!(RecvGetTimezoneOffset((&(aTimezoneOffset)))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            reply__ = PHal::Reply_GetTimezoneOffset(id__);

            Write(aTimezoneOffset, reply__);
            // Sentinel = 'aTimezoneOffset'
            (reply__)->WriteSentinel(4001217354);
            (reply__)->set_sync();
            (reply__)->set_reply();

            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending);
            }
            return MsgProcessed;
        }
    case PHal::Msg_GetWakeLockInfo__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_GetWakeLockInfo", js::ProfileEntry::Category::OTHER);

            PickleIterator iter__ = PickleIterator(msg__);
            nsString aTopic;

            if ((!(Read((&(aTopic)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'nsString'");
                return MsgValueError;
            }
            // Sentinel = 'aTopic'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2759450316)))) {
                FatalError("Error deserializing 'nsString'");
                return MsgValueError;
            }
            (msg__).EndRead(iter__);
            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_GetWakeLockInfo__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            WakeLockInformation aWakeLockInfo;
            int32_t id__ = Id();
            if ((!(RecvGetWakeLockInfo(mozilla::Move(aTopic), (&(aWakeLockInfo)))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            reply__ = PHal::Reply_GetWakeLockInfo(id__);

            Write(aWakeLockInfo, reply__);
            // Sentinel = 'aWakeLockInfo'
            (reply__)->WriteSentinel(1498930717);
            (reply__)->set_sync();
            (reply__)->set_reply();

            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending);
            }
            return MsgProcessed;
        }
    case PHal::Msg_GetCurrentScreenConfiguration__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_GetCurrentScreenConfiguration", js::ProfileEntry::Category::OTHER);

            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_GetCurrentScreenConfiguration__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            ScreenConfiguration aScreenConfiguration;
            int32_t id__ = Id();
            if ((!(RecvGetCurrentScreenConfiguration((&(aScreenConfiguration)))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            reply__ = PHal::Reply_GetCurrentScreenConfiguration(id__);

            Write(aScreenConfiguration, reply__);
            // Sentinel = 'aScreenConfiguration'
            (reply__)->WriteSentinel(1811386433);
            (reply__)->set_sync();
            (reply__)->set_reply();

            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending);
            }
            return MsgProcessed;
        }
    case PHal::Msg_LockScreenOrientation__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_LockScreenOrientation", js::ProfileEntry::Category::OTHER);

            PickleIterator iter__ = PickleIterator(msg__);
            ScreenOrientationInternal aOrientation;

            if ((!(Read((&(aOrientation)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'ScreenOrientationInternal'");
                return MsgValueError;
            }
            // Sentinel = 'aOrientation'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1665072289)))) {
                FatalError("Error deserializing 'ScreenOrientationInternal'");
                return MsgValueError;
            }
            (msg__).EndRead(iter__);
            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_LockScreenOrientation__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            bool allowed;
            int32_t id__ = Id();
            if ((!(RecvLockScreenOrientation(mozilla::Move(aOrientation), (&(allowed)))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            reply__ = PHal::Reply_LockScreenOrientation(id__);

            Write(allowed, reply__);
            // Sentinel = 'allowed'
            (reply__)->WriteSentinel(1297156503);
            (reply__)->set_sync();
            (reply__)->set_reply();

            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending);
            }
            return MsgProcessed;
        }
    case PHal::Msg_GetCurrentSwitchState__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
            }
            PROFILER_LABEL("PHal", "Msg_GetCurrentSwitchState", js::ProfileEntry::Category::OTHER);

            PickleIterator iter__ = PickleIterator(msg__);
            SwitchDevice aDevice;

            if ((!(Read((&(aDevice)), (&(msg__)), (&(iter__)))))) {
                FatalError("Error deserializing 'SwitchDevice'");
                return MsgValueError;
            }
            // Sentinel = 'aDevice'
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2436697236)))) {
                FatalError("Error deserializing 'SwitchDevice'");
                return MsgValueError;
            }
            (msg__).EndRead(iter__);
            if ((!(PHal::Transition(Trigger(Trigger::Recv, PHal::Msg_GetCurrentSwitchState__ID), (&(mState)))))) {
                NS_WARNING("bad state transition!");
            }
            SwitchState aState;
            int32_t id__ = Id();
            if ((!(RecvGetCurrentSwitchState(mozilla::Move(aDevice), (&(aState)))))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                return MsgProcessingError;
            }

            reply__ = PHal::Reply_GetCurrentSwitchState(id__);

            Write(aState, reply__);
            // Sentinel = 'aState'
            (reply__)->WriteSentinel(3694751962);
            (reply__)->set_sync();
            (reply__)->set_reply();

            if (mozilla::ipc::LoggingEnabledFor("PHalParent")) {
                mozilla::ipc::LogMessageForProtocol("PHalParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending);
            }
            return MsgProcessed;
        }
    default:
        {
            return MsgNotKnown;
        }
    }
}

auto PHalParent::OnCallReceived(
        const Message& msg__,
        Message*& reply__) -> PHalParent::Result
{
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
    return MsgNotKnown;
}

auto PHalParent::GetProtocolTypeId() -> int32_t
{
    return PHalMsgStart;
}

auto PHalParent::ProtocolName() const -> const char*
{
    return "PHalParent";
}

auto PHalParent::DestroySubtree(ActorDestroyReason why) -> void
{
    // Unregister from our manager.
    Unregister(Id());
    SetId(1);

    // Finally, destroy "us".
    ActorDestroy(why);
}

auto PHalParent::DeallocSubtree() -> void
{
}

auto PHalParent::Write(
        const SwitchEvent& v__,
        Message* msg__) -> void
{
    Write((v__).device(), msg__);
    // Sentinel = 'device'
    (msg__)->WriteSentinel(1277795288);
    Write((v__).status(), msg__);
    // Sentinel = 'status'
    (msg__)->WriteSentinel(3714608576);
}

auto PHalParent::Read(
        SwitchEvent* v__,
        const Message* msg__,
        PickleIterator* iter__) -> bool
{
    if ((!(Read((&((v__)->device())), msg__, iter__)))) {
        FatalError("Error deserializing 'device' (SwitchDevice) member of 'SwitchEvent'");
        return false;
    }
    // Sentinel = 'device'
    if ((!((msg__)->ReadSentinel(iter__, 1277795288)))) {
        FatalError("Error deserializing 'device' (SwitchDevice) member of 'SwitchEvent'");
        return false;
    }
    if ((!(Read((&((v__)->status())), msg__, iter__)))) {
        FatalError("Error deserializing 'status' (SwitchState) member of 'SwitchEvent'");
        return false;
    }
    // Sentinel = 'status'
    if ((!((msg__)->ReadSentinel(iter__, 3714608576)))) {
        FatalError("Error deserializing 'status' (SwitchState) member of 'SwitchEvent'");
        return false;
    }
    return true;
}

auto PHalParent::Write(
        const PBrowserParent* v__,
        Message* msg__,
        bool nullable__) -> void
{
    int32_t id;
    if ((!(v__))) {
        if ((!(nullable__))) {
            FatalError("NULL actor value passed to non-nullable param");
        }
        id = 0;
    }
    else {
        id = (v__)->Id();
        if ((1) == (id)) {
            FatalError("actor has been |delete|d");
        }
    }

    Write(id, msg__);
}

auto PHalParent::Read(
        PBrowserParent** v__,
        const Message* msg__,
        PickleIterator* iter__,
        bool nullable__) -> bool
{
    Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PBrowser", PBrowserMsgStart);
    if ((actor).isNothing()) {
        return false;
    }

    (*(v__)) = static_cast<PBrowserParent*>((actor).value());
    return true;
}

auto PHalParent::Write(
        const ScreenConfiguration& v__,
        Message* msg__) -> void
{
    Write((v__).rect(), msg__);
    // Sentinel = 'rect'
    (msg__)->WriteSentinel(438776542);
    Write((v__).orientation(), msg__);
    // Sentinel = 'orientation'
    (msg__)->WriteSentinel(759639429);
    Write((v__).angle(), msg__);
    // Sentinel = 'angle'
    (msg__)->WriteSentinel(3388308388);
    Write((v__).colorDepth(), msg__);
    // Sentinel = 'colorDepth'
    (msg__)->WriteSentinel(4107545146);
    Write((v__).pixelDepth(), msg__);
    // Sentinel = 'pixelDepth'
    (msg__)->WriteSentinel(4055642053);
}

auto PHalParent::Read(
        ScreenConfiguration* v__,
        const Message* msg__,
        PickleIterator* iter__) -> bool
{
    if ((!(Read((&((v__)->rect())), msg__, iter__)))) {
        FatalError("Error deserializing 'rect' (nsIntRect) member of 'ScreenConfiguration'");
        return false;
    }
    // Sentinel = 'rect'
    if ((!((msg__)->ReadSentinel(iter__, 438776542)))) {
        FatalError("Error deserializing 'rect' (nsIntRect) member of 'ScreenConfiguration'");
        return false;
    }
    if ((!(Read((&((v__)->orientation())), msg__, iter__)))) {
        FatalError("Error deserializing 'orientation' (ScreenOrientationInternal) member of 'ScreenConfiguration'");
        return false;
    }
    // Sentinel = 'orientation'
    if ((!((msg__)->ReadSentinel(iter__, 759639429)))) {
        FatalError("Error deserializing 'orientation' (ScreenOrientationInternal) member of 'ScreenConfiguration'");
        return false;
    }
    if ((!(Read((&((v__)->angle())), msg__, iter__)))) {
        FatalError("Error deserializing 'angle' (uint16_t) member of 'ScreenConfiguration'");
        return false;
    }
    // Sentinel = 'angle'
    if ((!((msg__)->ReadSentinel(iter__, 3388308388)))) {
        FatalError("Error deserializing 'angle' (uint16_t) member of 'ScreenConfiguration'");
        return false;
    }
    if ((!(Read((&((v__)->colorDepth())), msg__, iter__)))) {
        FatalError("Error deserializing 'colorDepth' (uint32_t) member of 'ScreenConfiguration'");
        return false;
    }
    // Sentinel = 'colorDepth'
    if ((!((msg__)->ReadSentinel(iter__, 4107545146)))) {
        FatalError("Error deserializing 'colorDepth' (uint32_t) member of 'ScreenConfiguration'");
        return false;
    }
    if ((!(Read((&((v__)->pixelDepth())), msg__, iter__)))) {
        FatalError("Error deserializing 'pixelDepth' (uint32_t) member of 'ScreenConfiguration'");
        return false;
    }
    // Sentinel = 'pixelDepth'
    if ((!((msg__)->ReadSentinel(iter__, 4055642053)))) {
        FatalError("Error deserializing 'pixelDepth' (uint32_t) member of 'ScreenConfiguration'");
        return false;
    }
    return true;
}

auto PHalParent::Write(
        const BatteryInformation& v__,
        Message* msg__) -> void
{
    Write((v__).level(), msg__);
    // Sentinel = 'level'
    (msg__)->WriteSentinel(144336999);
    Write((v__).charging(), msg__);
    // Sentinel = 'charging'
    (msg__)->WriteSentinel(253813181);
    Write((v__).remainingTime(), msg__);
    // Sentinel = 'remainingTime'
    (msg__)->WriteSentinel(3991324882);
}

auto PHalParent::Read(
        BatteryInformation* v__,
        const Message* msg__,
        PickleIterator* iter__) -> bool
{
    if ((!(Read((&((v__)->level())), msg__, iter__)))) {
        FatalError("Error deserializing 'level' (double) member of 'BatteryInformation'");
        return false;
    }
    // Sentinel = 'level'
    if ((!((msg__)->ReadSentinel(iter__, 144336999)))) {
        FatalError("Error deserializing 'level' (double) member of 'BatteryInformation'");
        return false;
    }
    if ((!(Read((&((v__)->charging())), msg__, iter__)))) {
        FatalError("Error deserializing 'charging' (bool) member of 'BatteryInformation'");
        return false;
    }
    // Sentinel = 'charging'
    if ((!((msg__)->ReadSentinel(iter__, 253813181)))) {
        FatalError("Error deserializing 'charging' (bool) member of 'BatteryInformation'");
        return false;
    }
    if ((!(Read((&((v__)->remainingTime())), msg__, iter__)))) {
        FatalError("Error deserializing 'remainingTime' (double) member of 'BatteryInformation'");
        return false;
    }
    // Sentinel = 'remainingTime'
    if ((!((msg__)->ReadSentinel(iter__, 3991324882)))) {
        FatalError("Error deserializing 'remainingTime' (double) member of 'BatteryInformation'");
        return false;
    }
    return true;
}

auto PHalParent::Write(
        const WakeLockInformation& v__,
        Message* msg__) -> void
{
    Write((v__).topic(), msg__);
    // Sentinel = 'topic'
    (msg__)->WriteSentinel(261826960);
    Write((v__).numLocks(), msg__);
    // Sentinel = 'numLocks'
    (msg__)->WriteSentinel(2358740108);
    Write((v__).numHidden(), msg__);
    // Sentinel = 'numHidden'
    (msg__)->WriteSentinel(813961573);
    Write((v__).lockingProcesses(), msg__);
    // Sentinel = 'lockingProcesses'
    (msg__)->WriteSentinel(1213055746);
}

auto PHalParent::Read(
        WakeLockInformation* v__,
        const Message* msg__,
        PickleIterator* iter__) -> bool
{
    if ((!(Read((&((v__)->topic())), msg__, iter__)))) {
        FatalError("Error deserializing 'topic' (nsString) member of 'WakeLockInformation'");
        return false;
    }
    // Sentinel = 'topic'
    if ((!((msg__)->ReadSentinel(iter__, 261826960)))) {
        FatalError("Error deserializing 'topic' (nsString) member of 'WakeLockInformation'");
        return false;
    }
    if ((!(Read((&((v__)->numLocks())), msg__, iter__)))) {
        FatalError("Error deserializing 'numLocks' (uint32_t) member of 'WakeLockInformation'");
        return false;
    }
    // Sentinel = 'numLocks'
    if ((!((msg__)->ReadSentinel(iter__, 2358740108)))) {
        FatalError("Error deserializing 'numLocks' (uint32_t) member of 'WakeLockInformation'");
        return false;
    }
    if ((!(Read((&((v__)->numHidden())), msg__, iter__)))) {
        FatalError("Error deserializing 'numHidden' (uint32_t) member of 'WakeLockInformation'");
        return false;
    }
    // Sentinel = 'numHidden'
    if ((!((msg__)->ReadSentinel(iter__, 813961573)))) {
        FatalError("Error deserializing 'numHidden' (uint32_t) member of 'WakeLockInformation'");
        return false;
    }
    if ((!(Read((&((v__)->lockingProcesses())), msg__, iter__)))) {
        FatalError("Error deserializing 'lockingProcesses' (uint64_t[]) member of 'WakeLockInformation'");
        return false;
    }
    // Sentinel = 'lockingProcesses'
    if ((!((msg__)->ReadSentinel(iter__, 1213055746)))) {
        FatalError("Error deserializing 'lockingProcesses' (uint64_t[]) member of 'WakeLockInformation'");
        return false;
    }
    return true;
}

auto PHalParent::Write(
        const NetworkInformation& v__,
        Message* msg__) -> void
{
    Write((v__).type(), msg__);
    // Sentinel = 'type'
    (msg__)->WriteSentinel(2982068540);
    Write((v__).isWifi(), msg__);
    // Sentinel = 'isWifi'
    (msg__)->WriteSentinel(68302097);
    Write((v__).dhcpGateway(), msg__);
    // Sentinel = 'dhcpGateway'
    (msg__)->WriteSentinel(1492137774);
}

auto PHalParent::Read(
        NetworkInformation* v__,
        const Message* msg__,
        PickleIterator* iter__) -> bool
{
    if ((!(Read((&((v__)->type())), msg__, iter__)))) {
        FatalError("Error deserializing 'type' (uint32_t) member of 'NetworkInformation'");
        return false;
    }
    // Sentinel = 'type'
    if ((!((msg__)->ReadSentinel(iter__, 2982068540)))) {
        FatalError("Error deserializing 'type' (uint32_t) member of 'NetworkInformation'");
        return false;
    }
    if ((!(Read((&((v__)->isWifi())), msg__, iter__)))) {
        FatalError("Error deserializing 'isWifi' (bool) member of 'NetworkInformation'");
        return false;
    }
    // Sentinel = 'isWifi'
    if ((!((msg__)->ReadSentinel(iter__, 68302097)))) {
        FatalError("Error deserializing 'isWifi' (bool) member of 'NetworkInformation'");
        return false;
    }
    if ((!(Read((&((v__)->dhcpGateway())), msg__, iter__)))) {
        FatalError("Error deserializing 'dhcpGateway' (uint32_t) member of 'NetworkInformation'");
        return false;
    }
    // Sentinel = 'dhcpGateway'
    if ((!((msg__)->ReadSentinel(iter__, 1492137774)))) {
        FatalError("Error deserializing 'dhcpGateway' (uint32_t) member of 'NetworkInformation'");
        return false;
    }
    return true;
}

auto PHalParent::Write(
        const SystemTimezoneChangeInformation& v__,
        Message* msg__) -> void
{
    Write((v__).oldTimezoneOffsetMinutes(), msg__);
    // Sentinel = 'oldTimezoneOffsetMinutes'
    (msg__)->WriteSentinel(3940000210);
    Write((v__).newTimezoneOffsetMinutes(), msg__);
    // Sentinel = 'newTimezoneOffsetMinutes'
    (msg__)->WriteSentinel(2391265445);
}

auto PHalParent::Read(
        SystemTimezoneChangeInformation* v__,
        const Message* msg__,
        PickleIterator* iter__) -> bool
{
    if ((!(Read((&((v__)->oldTimezoneOffsetMinutes())), msg__, iter__)))) {
        FatalError("Error deserializing 'oldTimezoneOffsetMinutes' (int32_t) member of 'SystemTimezoneChangeInformation'");
        return false;
    }
    // Sentinel = 'oldTimezoneOffsetMinutes'
    if ((!((msg__)->ReadSentinel(iter__, 3940000210)))) {
        FatalError("Error deserializing 'oldTimezoneOffsetMinutes' (int32_t) member of 'SystemTimezoneChangeInformation'");
        return false;
    }
    if ((!(Read((&((v__)->newTimezoneOffsetMinutes())), msg__, iter__)))) {
        FatalError("Error deserializing 'newTimezoneOffsetMinutes' (int32_t) member of 'SystemTimezoneChangeInformation'");
        return false;
    }
    // Sentinel = 'newTimezoneOffsetMinutes'
    if ((!((msg__)->ReadSentinel(iter__, 2391265445)))) {
        FatalError("Error deserializing 'newTimezoneOffsetMinutes' (int32_t) member of 'SystemTimezoneChangeInformation'");
        return false;
    }
    return true;
}

auto PHalParent::Write(
        const SensorData& v__,
        Message* msg__) -> void
{
    Write((v__).sensor(), msg__);
    // Sentinel = 'sensor'
    (msg__)->WriteSentinel(1053903548);
    Write((v__).timestamp(), msg__);
    // Sentinel = 'timestamp'
    (msg__)->WriteSentinel(2167067209);
    Write((v__).values(), msg__);
    // Sentinel = 'values'
    (msg__)->WriteSentinel(3006433652);
    Write((v__).accuracy(), msg__);
    // Sentinel = 'accuracy'
    (msg__)->WriteSentinel(354491327);
}

auto PHalParent::Read(
        SensorData* v__,
        const Message* msg__,
        PickleIterator* iter__) -> bool
{
    if ((!(Read((&((v__)->sensor())), msg__, iter__)))) {
        FatalError("Error deserializing 'sensor' (SensorType) member of 'SensorData'");
        return false;
    }
    // Sentinel = 'sensor'
    if ((!((msg__)->ReadSentinel(iter__, 1053903548)))) {
        FatalError("Error deserializing 'sensor' (SensorType) member of 'SensorData'");
        return false;
    }
    if ((!(Read((&((v__)->timestamp())), msg__, iter__)))) {
        FatalError("Error deserializing 'timestamp' (PRTime) member of 'SensorData'");
        return false;
    }
    // Sentinel = 'timestamp'
    if ((!((msg__)->ReadSentinel(iter__, 2167067209)))) {
        FatalError("Error deserializing 'timestamp' (PRTime) member of 'SensorData'");
        return false;
    }
    if ((!(Read((&((v__)->values())), msg__, iter__)))) {
        FatalError("Error deserializing 'values' (float[]) member of 'SensorData'");
        return false;
    }
    // Sentinel = 'values'
    if ((!((msg__)->ReadSentinel(iter__, 3006433652)))) {
        FatalError("Error deserializing 'values' (float[]) member of 'SensorData'");
        return false;
    }
    if ((!(Read((&((v__)->accuracy())), msg__, iter__)))) {
        FatalError("Error deserializing 'accuracy' (SensorAccuracyType) member of 'SensorData'");
        return false;
    }
    // Sentinel = 'accuracy'
    if ((!((msg__)->ReadSentinel(iter__, 354491327)))) {
        FatalError("Error deserializing 'accuracy' (SensorAccuracyType) member of 'SensorData'");
        return false;
    }
    return true;
}

auto PHalParent::Write(
        const PHalParent* v__,
        Message* msg__,
        bool nullable__) -> void
{
    int32_t id;
    if ((!(v__))) {
        if ((!(nullable__))) {
            FatalError("NULL actor value passed to non-nullable param");
        }
        id = 0;
    }
    else {
        id = (v__)->Id();
        if ((1) == (id)) {
            FatalError("actor has been |delete|d");
        }
    }

    Write(id, msg__);
}

auto PHalParent::Read(
        PHalParent** v__,
        const Message* msg__,
        PickleIterator* iter__,
        bool nullable__) -> bool
{
    Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PHal", PHalMsgStart);
    if ((actor).isNothing()) {
        return false;
    }

    (*(v__)) = static_cast<PHalParent*>((actor).value());
    return true;
}



} // namespace hal_sandbox
} // namespace mozilla
