mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-29 14:45:28 +03:00
Extend parental control services
This commit is contained in:
parent
180ba97440
commit
ef9760570b
@ -110,6 +110,7 @@ add_library(skyline SHARED
|
|||||||
${source_DIR}/skyline/services/pl/IPlatformServiceManager.cpp
|
${source_DIR}/skyline/services/pl/IPlatformServiceManager.cpp
|
||||||
${source_DIR}/skyline/services/aocsrv/IAddOnContentManager.cpp
|
${source_DIR}/skyline/services/aocsrv/IAddOnContentManager.cpp
|
||||||
${source_DIR}/skyline/services/pctl/IParentalControlServiceFactory.cpp
|
${source_DIR}/skyline/services/pctl/IParentalControlServiceFactory.cpp
|
||||||
|
${source_DIR}/skyline/services/pctl/IParentalControlService.cpp
|
||||||
${source_DIR}/skyline/services/lm/ILogService.cpp
|
${source_DIR}/skyline/services/lm/ILogService.cpp
|
||||||
${source_DIR}/skyline/services/lm/ILogger.cpp
|
${source_DIR}/skyline/services/lm/ILogger.cpp
|
||||||
${source_DIR}/skyline/services/account/IAccountServiceForApplication.cpp
|
${source_DIR}/skyline/services/account/IAccountServiceForApplication.cpp
|
||||||
|
@ -66,6 +66,7 @@ namespace skyline::service {
|
|||||||
pl_IPlatformServiceManager,
|
pl_IPlatformServiceManager,
|
||||||
aocsrv_IAddOnContentManager,
|
aocsrv_IAddOnContentManager,
|
||||||
pctl_IParentalControlServiceFactory,
|
pctl_IParentalControlServiceFactory,
|
||||||
|
pctl_IParentalControlService,
|
||||||
lm_ILogService,
|
lm_ILogService,
|
||||||
lm_ILogger,
|
lm_ILogger,
|
||||||
account_IAccountServiceForApplication,
|
account_IAccountServiceForApplication,
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
|
#include "IParentalControlService.h"
|
||||||
|
|
||||||
|
namespace skyline::service::pctl {
|
||||||
|
IParentalControlService::IParentalControlService(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager, Service::pctl_IParentalControlService, "pctl:IParentalControlService", {
|
||||||
|
}) {}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <services/base_service.h>
|
||||||
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
|
namespace skyline::service::pctl {
|
||||||
|
/**
|
||||||
|
* @brief IParentalControlService is used to access parental control configuration (https://switchbrew.org/wiki/Parental_Control_services#IParentalControlService)
|
||||||
|
*/
|
||||||
|
class IParentalControlService : public BaseService {
|
||||||
|
public:
|
||||||
|
IParentalControlService(const DeviceState &state, ServiceManager &manager);
|
||||||
|
};
|
||||||
|
}
|
@ -1,9 +1,17 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
|
#include "IParentalControlService.h"
|
||||||
#include "IParentalControlServiceFactory.h"
|
#include "IParentalControlServiceFactory.h"
|
||||||
|
|
||||||
namespace skyline::service::pctl {
|
namespace skyline::service::pctl {
|
||||||
IParentalControlServiceFactory::IParentalControlServiceFactory(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager, Service::pctl_IParentalControlServiceFactory, "pctl:IParentalControlServiceFactory", {
|
IParentalControlServiceFactory::IParentalControlServiceFactory(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager, Service::pctl_IParentalControlServiceFactory, "pctl:IParentalControlServiceFactory", {
|
||||||
|
{0x0, SFUNC(IParentalControlServiceFactory::CreateService)},
|
||||||
|
{0x1, SFUNC(IParentalControlServiceFactory::CreateService)}
|
||||||
|
|
||||||
}) {}
|
}) {}
|
||||||
|
|
||||||
|
void IParentalControlServiceFactory::CreateService(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
||||||
|
manager.RegisterService(std::make_shared<IParentalControlService>(state, manager), session, response);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,5 +13,10 @@ namespace skyline::service::pctl {
|
|||||||
class IParentalControlServiceFactory : public BaseService {
|
class IParentalControlServiceFactory : public BaseService {
|
||||||
public:
|
public:
|
||||||
IParentalControlServiceFactory(const DeviceState &state, ServiceManager &manager);
|
IParentalControlServiceFactory(const DeviceState &state, ServiceManager &manager);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This creates and initializes an IParentalControlService instance that can be used to read parental control configuration
|
||||||
|
*/
|
||||||
|
void CreateService(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user