diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 53fce962..36d52cb9 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -105,6 +105,7 @@ add_library(skyline SHARED ${source_DIR}/skyline/services/visrv/ISystemDisplayService.cpp ${source_DIR}/skyline/services/pl/IPlatformServiceManager.cpp ${source_DIR}/skyline/services/aocsrv/IAddOnContentManager.cpp + ${source_DIR}/skyline/services/pctl/IParentalControlServiceFactory.cpp ${source_DIR}/skyline/vfs/partition_filesystem.cpp ${source_DIR}/skyline/vfs/rom_filesystem.cpp ${source_DIR}/skyline/vfs/os_backing.cpp diff --git a/app/src/main/cpp/skyline/services/base_service.h b/app/src/main/cpp/skyline/services/base_service.h index 53613b4f..57959a51 100644 --- a/app/src/main/cpp/skyline/services/base_service.h +++ b/app/src/main/cpp/skyline/services/base_service.h @@ -60,8 +60,9 @@ namespace skyline::service { visrv_ISystemDisplayService, visrv_IManagerDisplayService, hosbinder_IHOSBinderDriver, - pl_IPlatformServiceManager + pl_IPlatformServiceManager, aocsrv_IAddOnContentManager, + pctl_IParentalControlServiceFactory, }; /** @@ -86,8 +87,12 @@ namespace skyline::service { {"nvdrv:s", Service::nvdrv_INvDrvServices}, {"nvdrv:t", Service::nvdrv_INvDrvServices}, {"vi:m", Service::visrv_IManagerRootService}, - {"pl:u", Service::pl_IPlatformServiceManager} - {"aoc:u", Service::aocsrv_IAddOnContentManager} + {"pl:u", Service::pl_IPlatformServiceManager}, + {"aoc:u", Service::aocsrv_IAddOnContentManager}, + {"pctl", Service::pctl_IParentalControlServiceFactory}, + {"pctl:a", Service::pctl_IParentalControlServiceFactory}, + {"pctl:s", Service::pctl_IParentalControlServiceFactory}, + {"pctl:r", Service::pctl_IParentalControlServiceFactory} }; class ServiceManager; diff --git a/app/src/main/cpp/skyline/services/pctl/IParentalControlServiceFactory.cpp b/app/src/main/cpp/skyline/services/pctl/IParentalControlServiceFactory.cpp new file mode 100644 index 00000000..76a22e3a --- /dev/null +++ b/app/src/main/cpp/skyline/services/pctl/IParentalControlServiceFactory.cpp @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: MPL-2.0 +// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/) + +#include "IParentalControlServiceFactory.h" + +namespace skyline::service::pctl { + IParentalControlServiceFactory::IParentalControlServiceFactory(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager, Service::pctl_IParentalControlServiceFactory, "pctl:IParentalControlServiceFactory", { + }) {} +} diff --git a/app/src/main/cpp/skyline/services/pctl/IParentalControlServiceFactory.h b/app/src/main/cpp/skyline/services/pctl/IParentalControlServiceFactory.h new file mode 100644 index 00000000..d98ec4a3 --- /dev/null +++ b/app/src/main/cpp/skyline/services/pctl/IParentalControlServiceFactory.h @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: MPL-2.0 +// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/) + +#pragma once + +#include +#include + +namespace skyline::service::pctl { + /** + * @brief IParentalControlServiceFactory is used to open a parental controls instance (https://switchbrew.org/wiki/Parental_Control_services#pctl:s.2C_pctl:r.2C_pctl:a.2C_pctl) + */ + class IParentalControlServiceFactory : public BaseService { + public: + IParentalControlServiceFactory(const DeviceState &state, ServiceManager &manager); + }; +} diff --git a/app/src/main/cpp/skyline/services/serviceman.cpp b/app/src/main/cpp/skyline/services/serviceman.cpp index f99027e6..adfe7561 100644 --- a/app/src/main/cpp/skyline/services/serviceman.cpp +++ b/app/src/main/cpp/skyline/services/serviceman.cpp @@ -18,6 +18,7 @@ #include "visrv/IManagerRootService.h" #include "pl/IPlatformServiceManager.h" #include "aocsrv/IAddOnContentManager.h" +#include "pctl/IParentalControlServiceFactory.h" #include "serviceman.h" namespace skyline::service { @@ -78,6 +79,9 @@ namespace skyline::service { case Service::aocsrv_IAddOnContentManager: serviceObj = std::make_shared(state, *this); break; + case Service::pctl_IParentalControlServiceFactory: + serviceObj = std::make_shared(state, *this); + break; default: throw exception("CreateService called on missing object, type: {}", serviceType); }