2020-04-19 23:04:05 +02:00
// SPDX-License-Identifier: MPL-2.0
2020-03-27 20:36:02 +01:00
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
2020-02-19 21:35:54 +01:00
# pragma once
# include <services/serviceman.h>
2021-07-04 01:51:19 +02:00
namespace skyline : : service : : hosbinder {
class IHOSBinderDriver ;
}
2020-02-19 21:35:54 +01:00
namespace skyline : : service : : am {
/**
2020-09-28 12:05:17 +02:00
* @ brief This has functions relating to an application ' s own current status
* @ url https : //switchbrew.org/wiki/Applet_Manager_services#ISelfController
2020-02-19 21:35:54 +01:00
*/
class ISelfController : public BaseService {
2020-07-07 16:58:38 +02:00
private :
std : : shared_ptr < kernel : : type : : KEvent > libraryAppletLaunchableEvent ; //!< This KEvent is triggered when the library applet is launchable
2020-08-09 15:52:43 +02:00
std : : shared_ptr < kernel : : type : : KEvent > accumulatedSuspendedTickChangedEvent ; //!< This KEvent is triggered when the time the system has spent in suspend is updated
2021-07-04 01:51:19 +02:00
std : : shared_ptr < hosbinder : : IHOSBinderDriver > hosbinder ; //!< IHOSBinder service for managed display layers
2020-07-07 16:58:38 +02:00
2020-02-19 21:35:54 +01:00
public :
ISelfController ( const DeviceState & state , ServiceManager & manager ) ;
2020-07-09 21:18:54 +02:00
/**
2020-09-28 12:05:17 +02:00
* @ brief Function prevents the running application from being quit via the home button
* @ url https : //switchbrew.org/wiki/Applet_Manager_services#LockExit
2020-07-09 21:18:54 +02:00
*/
2020-09-03 20:43:52 +02:00
Result LockExit ( type : : KSession & session , ipc : : IpcRequest & request , ipc : : IpcResponse & response ) ;
2020-07-09 21:18:54 +02:00
/**
2020-09-28 12:05:17 +02:00
* @ brief Function allows the running application to be quit via the home button
* @ url https : //switchbrew.org/wiki/Applet_Manager_services#UnlockExit
2020-07-09 21:18:54 +02:00
*/
2020-09-03 20:43:52 +02:00
Result UnlockExit ( type : : KSession & session , ipc : : IpcRequest & request , ipc : : IpcResponse & response ) ;
2020-07-09 21:18:54 +02:00
2020-07-07 16:58:38 +02:00
/**
2020-09-28 12:05:17 +02:00
* @ brief Function obtains a handle to the library applet launchable event
* @ url https : //switchbrew.org/wiki/Applet_Manager_services#GetLibraryAppletLaunchableEvent
2020-07-07 16:58:38 +02:00
*/
2020-09-03 20:43:52 +02:00
Result GetLibraryAppletLaunchableEvent ( type : : KSession & session , ipc : : IpcRequest & request , ipc : : IpcResponse & response ) ;
2020-07-07 16:58:38 +02:00
2020-02-19 21:35:54 +01:00
/**
2020-09-28 12:05:17 +02:00
* @ brief This function takes a u8 bool flag and no output ( Stubbed )
* @ url https : //switchbrew.org/wiki/Applet_Manager_services#SetOperationModeChangedNotification
2020-02-19 21:35:54 +01:00
*/
2020-09-03 20:43:52 +02:00
Result SetOperationModeChangedNotification ( type : : KSession & session , ipc : : IpcRequest & request , ipc : : IpcResponse & response ) ;
2020-02-19 21:35:54 +01:00
/**
2020-09-28 12:05:17 +02:00
* @ brief This function takes a u8 bool flag and no output ( Stubbed )
* @ url https : //switchbrew.org/wiki/Applet_Manager_services#SetPerformanceModeChangedNotification
2020-02-19 21:35:54 +01:00
*/
2020-09-03 20:43:52 +02:00
Result SetPerformanceModeChangedNotification ( type : : KSession & session , ipc : : IpcRequest & request , ipc : : IpcResponse & response ) ;
2020-02-19 21:35:54 +01:00
/**
2020-09-28 12:05:17 +02:00
* @ brief This function takes 3 unknown u8 values and has no output ( Stubbed )
* @ url https : //switchbrew.org/wiki/Applet_Manager_services#GetCurrentFocusState
2020-02-19 21:35:54 +01:00
*/
2020-09-03 20:43:52 +02:00
Result SetFocusHandlingMode ( type : : KSession & session , ipc : : IpcRequest & request , ipc : : IpcResponse & response ) ;
2020-02-19 21:35:54 +01:00
2020-07-09 15:44:33 +02:00
/**
2020-09-28 12:05:17 +02:00
* @ brief Toggles whether a restart message should be sent or not
* @ url https : //switchbrew.org/wiki/Applet_Manager_services#SetRestartMessageEnabled
2020-07-09 15:44:33 +02:00
*/
2020-09-03 20:43:52 +02:00
Result SetRestartMessageEnabled ( type : : KSession & session , ipc : : IpcRequest & request , ipc : : IpcResponse & response ) ;
2020-07-09 15:44:33 +02:00
2020-02-19 21:35:54 +01:00
/**
2020-09-28 12:05:17 +02:00
* @ brief This function takes a u8 bool flag and has no output ( Stubbed )
* @ url https : //switchbrew.org/wiki/Applet_Manager_services#SetOutOfFocusSuspendingEnabled
2020-02-19 21:35:54 +01:00
*/
2020-09-03 20:43:52 +02:00
Result SetOutOfFocusSuspendingEnabled ( type : : KSession & session , ipc : : IpcRequest & request , ipc : : IpcResponse & response ) ;
2020-02-19 21:35:54 +01:00
/**
2020-09-28 12:05:17 +02:00
* @ brief Returns an output u64 LayerId
* @ url https : //switchbrew.org/wiki/Applet_Manager_services#CreateManagedDisplayLayer
2020-02-19 21:35:54 +01:00
*/
2020-09-03 20:43:52 +02:00
Result CreateManagedDisplayLayer ( type : : KSession & session , ipc : : IpcRequest & request , ipc : : IpcResponse & response ) ;
2020-08-09 15:52:43 +02:00
/**
2021-05-27 23:28:26 +02:00
* @ brief Returns how long the process was suspended for in ticks
* @ url https : //switchbrew.org/wiki/Applet_Manager_services#GetAccumulatedSuspendedTickValue
*/
Result GetAccumulatedSuspendedTickValue ( type : : KSession & session , ipc : : IpcRequest & request , ipc : : IpcResponse & response ) ;
/**
* @ brief Returns a handle to a KEvent that is signalled when the accumulated suspend tick value changes
2020-09-28 12:05:17 +02:00
* @ url https : //switchbrew.org/wiki/Applet_Manager_services#GetAccumulatedSuspendedTickChangedEvent
2020-08-09 15:52:43 +02:00
*/
2020-09-03 20:43:52 +02:00
Result GetAccumulatedSuspendedTickChangedEvent ( type : : KSession & session , ipc : : IpcRequest & request , ipc : : IpcResponse & response ) ;
2020-09-21 12:04:26 +02:00
SERVICE_DECL (
SFUNC ( 0x1 , ISelfController , LockExit ) ,
SFUNC ( 0x2 , ISelfController , UnlockExit ) ,
SFUNC ( 0x9 , ISelfController , GetLibraryAppletLaunchableEvent ) ,
SFUNC ( 0xB , ISelfController , SetOperationModeChangedNotification ) ,
SFUNC ( 0xC , ISelfController , SetPerformanceModeChangedNotification ) ,
SFUNC ( 0xD , ISelfController , SetFocusHandlingMode ) ,
SFUNC ( 0xE , ISelfController , SetRestartMessageEnabled ) ,
SFUNC ( 0x10 , ISelfController , SetOutOfFocusSuspendingEnabled ) ,
SFUNC ( 0x28 , ISelfController , CreateManagedDisplayLayer ) ,
2021-05-27 23:28:26 +02:00
SFUNC ( 0x5A , ISelfController , GetAccumulatedSuspendedTickValue ) ,
SFUNC ( 0x5B , ISelfController , GetAccumulatedSuspendedTickChangedEvent )
2020-09-21 12:04:26 +02:00
)
2020-02-19 21:35:54 +01:00
} ;
}