patch_manager: Remove usages of the global system instance

With this, only 19 usages of the global system instance remain within
the core library.

We're almost there.
This commit is contained in:
Lioncash 2020-11-18 07:53:10 -05:00
parent abda366362
commit 6f8a06bac5
26 changed files with 259 additions and 157 deletions

View file

@ -147,7 +147,9 @@ TelemetrySession::~TelemetrySession() {
}
}
void TelemetrySession::AddInitialInfo(Loader::AppLoader& app_loader) {
void TelemetrySession::AddInitialInfo(Loader::AppLoader& app_loader,
const Service::FileSystem::FileSystemController& fsc,
const FileSys::ContentProvider& content_provider) {
// Log one-time top-level information
AddField(Telemetry::FieldType::None, "TelemetryId", GetTelemetryId());
@ -167,7 +169,10 @@ void TelemetrySession::AddInitialInfo(Loader::AppLoader& app_loader) {
app_loader.ReadTitle(name);
if (name.empty()) {
const auto metadata = FileSys::PatchManager(program_id).GetControlMetadata();
const auto metadata = [&content_provider, &fsc, program_id] {
const FileSys::PatchManager pm{program_id, fsc, content_provider};
return pm.GetControlMetadata();
}();
if (metadata.first != nullptr) {
name = metadata.first->GetApplicationName();
}