applet: Added support for using appletSetHandlingHomeButtonShortPressedEnabled with non-AppletType_OverlayApplet on [9.1.0+].

This commit is contained in:
yellows8 2019-12-08 16:45:47 -05:00
parent 26876cec38
commit 15490b15f6
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43
2 changed files with 23 additions and 8 deletions

View File

@ -2189,13 +2189,6 @@ Result appletStartShutdownSequenceForOverlay(void);
*/
Result appletStartRebootSequenceForOverlay(void);
/**
* @brief Sets HandlingHomeButtonShortPressedEnabled.
* @note Only available with AppletType_OverlayApplet on [8.0.0+].
* @param[in] flag Flag
*/
Result appletSetHandlingHomeButtonShortPressedEnabled(bool flag);
/**
* @brief SetHealthWarningShowingState
* @note Only available with AppletType_OverlayApplet on [9.0.0+].
@ -2418,6 +2411,13 @@ Result appletGetLaunchStorageInfoForDebug(NcmStorageId *app_storageId, NcmStorag
*/
Result appletGetGpuErrorDetectedSystemEvent(Event *out_event);
/**
* @brief Sets HandlingHomeButtonShortPressedEnabled.
* @note Only available with AppletType_OverlayApplet on [8.0.0+]. Or with non-AppletType_OverlayApplet on [9.1.0+].
* @param[in] flag Flag
*/
Result appletSetHandlingHomeButtonShortPressedEnabled(bool flag);
///@}
///@name State / other

View File

@ -2675,7 +2675,6 @@ Result appletStartRebootSequenceForOverlay(void) {
return rc;
}
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))
@ -2832,6 +2831,22 @@ Result appletGetGpuErrorDetectedSystemEvent(Event *out_event) {
return _appletCmdGetEvent(srv, out_event, false, 130);
}
Result appletSetHandlingHomeButtonShortPressedEnabled(bool flag) {
if (__nx_applet_type == AppletType_OverlayApplet && hosversionBefore(8,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
if (__nx_applet_type != AppletType_OverlayApplet && hosversionBefore(9,1,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
Service *srv = &g_appletIFunctions;
u32 cmd_id = 20;
if (__nx_applet_type != AppletType_OverlayApplet && hosversionAtLeast(9,1,0)) {
srv = &g_appletICommonStateGetter;
cmd_id = 100;
}
return _appletCmdInBoolNoOut(srv, flag, cmd_id);
}
// State / other
AppletOperationMode appletGetOperationMode(void) {