Extend parental control services

This commit is contained in:
Billy Laws 2020-07-08 11:59:02 +01:00 committed by ◱ PixelyIon
parent 180ba97440
commit ef9760570b
6 changed files with 41 additions and 0 deletions

View File

@ -110,6 +110,7 @@ add_library(skyline SHARED
${source_DIR}/skyline/services/pl/IPlatformServiceManager.cpp
${source_DIR}/skyline/services/aocsrv/IAddOnContentManager.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/ILogger.cpp
${source_DIR}/skyline/services/account/IAccountServiceForApplication.cpp

View File

@ -66,6 +66,7 @@ namespace skyline::service {
pl_IPlatformServiceManager,
aocsrv_IAddOnContentManager,
pctl_IParentalControlServiceFactory,
pctl_IParentalControlService,
lm_ILogService,
lm_ILogger,
account_IAccountServiceForApplication,

View File

@ -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", {
}) {}
}

View File

@ -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);
};
}

View File

@ -1,9 +1,17 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
#include "IParentalControlService.h"
#include "IParentalControlServiceFactory.h"
namespace skyline::service::pctl {
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);
}
}

View File

@ -13,5 +13,10 @@ namespace skyline::service::pctl {
class IParentalControlServiceFactory : public BaseService {
public:
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);
};
}