Merge pull request #3843 from ogniK5377/GetPopFromGeneralChannelEvent

am: IHomeMenuFunctions:GetPopFromGeneralChannelEvent
This commit is contained in:
bunnei 2020-05-04 16:20:11 -04:00 committed by GitHub
commit 500e9c5969
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 4 deletions

View File

@ -1525,14 +1525,15 @@ void InstallInterfaces(SM::ServiceManager& service_manager,
std::make_shared<TCAP>()->InstallAsService(service_manager); std::make_shared<TCAP>()->InstallAsService(service_manager);
} }
IHomeMenuFunctions::IHomeMenuFunctions() : ServiceFramework("IHomeMenuFunctions") { IHomeMenuFunctions::IHomeMenuFunctions(Kernel::KernelCore& kernel)
: ServiceFramework("IHomeMenuFunctions"), kernel(kernel) {
// clang-format off // clang-format off
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {
{10, &IHomeMenuFunctions::RequestToGetForeground, "RequestToGetForeground"}, {10, &IHomeMenuFunctions::RequestToGetForeground, "RequestToGetForeground"},
{11, nullptr, "LockForeground"}, {11, nullptr, "LockForeground"},
{12, nullptr, "UnlockForeground"}, {12, nullptr, "UnlockForeground"},
{20, nullptr, "PopFromGeneralChannel"}, {20, nullptr, "PopFromGeneralChannel"},
{21, nullptr, "GetPopFromGeneralChannelEvent"}, {21, &IHomeMenuFunctions::GetPopFromGeneralChannelEvent, "GetPopFromGeneralChannelEvent"},
{30, nullptr, "GetHomeButtonWriterLockAccessor"}, {30, nullptr, "GetHomeButtonWriterLockAccessor"},
{31, nullptr, "GetWriterLockAccessorEx"}, {31, nullptr, "GetWriterLockAccessorEx"},
{100, nullptr, "PopRequestLaunchApplicationForDebug"}, {100, nullptr, "PopRequestLaunchApplicationForDebug"},
@ -1542,6 +1543,9 @@ IHomeMenuFunctions::IHomeMenuFunctions() : ServiceFramework("IHomeMenuFunctions"
// clang-format on // clang-format on
RegisterHandlers(functions); RegisterHandlers(functions);
pop_from_general_channel_event = Kernel::WritableEvent::CreateEventPair(
kernel, "IHomeMenuFunctions:PopFromGeneralChannelEvent");
} }
IHomeMenuFunctions::~IHomeMenuFunctions() = default; IHomeMenuFunctions::~IHomeMenuFunctions() = default;
@ -1553,6 +1557,14 @@ void IHomeMenuFunctions::RequestToGetForeground(Kernel::HLERequestContext& ctx)
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
void IHomeMenuFunctions::GetPopFromGeneralChannelEvent(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_AM, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS);
rb.PushCopyObjects(pop_from_general_channel_event.readable);
}
IGlobalStateController::IGlobalStateController() : ServiceFramework("IGlobalStateController") { IGlobalStateController::IGlobalStateController() : ServiceFramework("IGlobalStateController") {
// clang-format off // clang-format off
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {

View File

@ -292,11 +292,15 @@ private:
class IHomeMenuFunctions final : public ServiceFramework<IHomeMenuFunctions> { class IHomeMenuFunctions final : public ServiceFramework<IHomeMenuFunctions> {
public: public:
IHomeMenuFunctions(); explicit IHomeMenuFunctions(Kernel::KernelCore& kernel);
~IHomeMenuFunctions() override; ~IHomeMenuFunctions() override;
private: private:
void RequestToGetForeground(Kernel::HLERequestContext& ctx); void RequestToGetForeground(Kernel::HLERequestContext& ctx);
void GetPopFromGeneralChannelEvent(Kernel::HLERequestContext& ctx);
Kernel::EventPair pop_from_general_channel_event;
Kernel::KernelCore& kernel;
}; };
class IGlobalStateController final : public ServiceFramework<IGlobalStateController> { class IGlobalStateController final : public ServiceFramework<IGlobalStateController> {

View File

@ -202,7 +202,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<IHomeMenuFunctions>(); rb.PushIpcInterface<IHomeMenuFunctions>(system.Kernel());
} }
void GetGlobalStateController(Kernel::HLERequestContext& ctx) { void GetGlobalStateController(Kernel::HLERequestContext& ctx) {