Add an empty account services implementation

This implements the base account service and stubs
InitializeApplicationInfoV0 which is used by Puyo Puyo Tetris. Support
for the entirety of account services will be added in the future.
This commit is contained in:
Billy Laws 2020-07-04 20:35:07 +01:00
parent 3a343d3a48
commit ff1c0e254f
5 changed files with 43 additions and 2 deletions

View File

@ -110,6 +110,7 @@ add_library(skyline SHARED
${source_DIR}/skyline/services/pctl/IParentalControlServiceFactory.cpp
${source_DIR}/skyline/services/lm/ILogService.cpp
${source_DIR}/skyline/services/lm/ILogger.cpp
${source_DIR}/skyline/services/account/IAccountServiceForApplication.cpp
${source_DIR}/skyline/vfs/partition_filesystem.cpp
${source_DIR}/skyline/vfs/rom_filesystem.cpp
${source_DIR}/skyline/vfs/os_backing.cpp

View File

@ -0,0 +1,12 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
#include "IAccountServiceForApplication.h"
namespace skyline::service::account {
IAccountServiceForApplication::IAccountServiceForApplication(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager, Service::account_IAccountServiceForApplication, "account:IAccountServiceForApplication", {
{0x64, SFUNC(IAccountServiceForApplication::InitializeApplicationInfoV0)}
}) {}
void IAccountServiceForApplication::InitializeApplicationInfoV0(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {}
}

View File

@ -0,0 +1,22 @@
// 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::account {
/**
* @brief IAccountServiceForApplication or acc:u0 provides functions for reading user information (https://switchbrew.org/wiki/Account_services#acc:u0)
*/
class IAccountServiceForApplication : public BaseService {
public:
IAccountServiceForApplication(const DeviceState &state, ServiceManager &manager);
/**
* @brief This provides information about the running application for account services to use (https://switchbrew.org/wiki/Account_services#InitializeApplicationInfoV0)
*/
void InitializeApplicationInfoV0(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
};
}

View File

@ -66,7 +66,8 @@ namespace skyline::service {
aocsrv_IAddOnContentManager,
pctl_IParentalControlServiceFactory,
lm_ILogService,
lm_ILogger
lm_ILogger,
account_IAccountServiceForApplication,
};
/**
@ -97,7 +98,8 @@ namespace skyline::service {
{"pctl:a", Service::pctl_IParentalControlServiceFactory},
{"pctl:s", Service::pctl_IParentalControlServiceFactory},
{"pctl:r", Service::pctl_IParentalControlServiceFactory},
{"lm", Service::lm_ILogService}
{"lm", Service::lm_ILogService},
{"acc:u0", Service::account_IAccountServiceForApplication},
};
class ServiceManager;

View File

@ -20,6 +20,7 @@
#include "aocsrv/IAddOnContentManager.h"
#include "pctl/IParentalControlServiceFactory.h"
#include "lm/ILogService.h"
#include "account/IAccountServiceForApplication.h"
#include "serviceman.h"
namespace skyline::service {
@ -86,6 +87,9 @@ namespace skyline::service {
case Service::lm_ILogService:
serviceObj = std::make_shared<lm::ILogService>(state, *this);
break;
case Service::account_IAccountServiceForApplication:
serviceObj = std::make_shared<account::IAccountServiceForApplication>(state, *this);
break;
default:
throw exception("CreateService called on missing object, type: {}", serviceType);
}