From c0115edca1a6a71484ebdeeb6cf94847c471dd93 Mon Sep 17 00:00:00 2001 From: yellows8 Date: Wed, 13 Nov 2019 23:41:43 -0500 Subject: [PATCH] Added appletSetHealthWarningShowingState and appletGetHealthWarningDisappearedSystemEvent. --- nx/include/switch/services/applet.h | 15 +++++++++++++++ nx/source/services/applet.c | 2 ++ 2 files changed, 17 insertions(+) diff --git a/nx/include/switch/services/applet.h b/nx/include/switch/services/applet.h index 5c082e1b..dfb1ca28 100644 --- a/nx/include/switch/services/applet.h +++ b/nx/include/switch/services/applet.h @@ -1478,6 +1478,14 @@ Result appletRestartProgram(const void* buffer, size_t size); */ Result appletGetPreviousProgramIndex(s32 *programIndex); +/** + * @brief GetHealthWarningDisappearedSystemEvent + * @note Only available with AppletType_*Application on [9.0.0+]. + * @note The Event must be closed by the user once finished with it. + * @param[out] out_event Output Event with autoclear=false. + */ +Result appletGetHealthWarningDisappearedSystemEvent(Event *out_event); + /** * @brief SetHdcpAuthenticationActivated * @note Only available with AppletType_*Application on [9.0.0+]. @@ -2126,6 +2134,13 @@ Result appletStartRebootSequenceForOverlay(void); */ Result appletSetHandlingHomeButtonShortPressedEnabled(bool flag); +/** + * @brief This writes the input bool into state and signals an Event. + * @note Only available with AppletType_OverlayApplet on [9.0.0+]. + * @param[in] flag Flag + */ +Result appletSetHealthWarningShowingState(bool flag); + /** * @brief Enables HID input for the OverlayApplet, without disabling input for the foreground applet. Generally \ref appletBeginToWatchShortHomeButtonMessage / appletEndToWatchShortHomeButtonMessage should be used instead. * @note Only available with AppletType_OverlayApplet on [5.0.0+]. diff --git a/nx/source/services/applet.c b/nx/source/services/applet.c index c4c91ae4..4748bbeb 100644 --- a/nx/source/services/applet.c +++ b/nx/source/services/applet.c @@ -2230,6 +2230,7 @@ Result appletRestartProgram(const void* buffer, size_t size) { } IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletGetPreviousProgramIndex(s32 *programIndex), &g_appletIFunctions, 123, _appletCmdNoInOutU32, !_appletIsApplication(), (5,0,0), (u32*)programIndex) +IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletGetHealthWarningDisappearedSystemEvent(Event *out_event), &g_appletIFunctions, 160, _appletCmdGetEvent, !_appletIsApplication(), (9,0,0), out_event, false) IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletSetHdcpAuthenticationActivated(bool flag), &g_appletIFunctions, 170, _appletCmdInBoolNoOut, !_appletIsApplication(), (9,0,0), flag) IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletCreateMovieMaker(Service* srv_out, TransferMemory *tmem), &g_appletIFunctions, 1000, _appletCmdInTmemOutSession, !_appletIsApplication(), (5,0,0), srv_out, tmem) IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletPrepareForJit(void), &g_appletIFunctions, 1001, _appletCmdNoIO, !_appletIsApplication(), (5,0,0)) @@ -2585,6 +2586,7 @@ Result appletStartRebootSequenceForOverlay(void) { } IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletSetHandlingHomeButtonShortPressedEnabled(bool flag), &g_appletIFunctions, 20, _appletCmdInBoolNoOut, __nx_applet_type != AppletType_OverlayApplet, (8,0,0), flag) +IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletSetHealthWarningShowingState(bool flag), &g_appletIFunctions, 30, _appletCmdInBoolNoOut, __nx_applet_type != AppletType_OverlayApplet, (9,0,0), flag) IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletBeginToObserveHidInputForDevelop(void), &g_appletIFunctions, 101, _appletCmdNoIO, __nx_applet_type != AppletType_OverlayApplet, (5,0,0)) // IAppletCommonFunctions