summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/caps
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/service/caps')
-rw-r--r--src/core/hle/service/caps/caps_manager.cpp47
1 files changed, 31 insertions, 16 deletions
diff --git a/src/core/hle/service/caps/caps_manager.cpp b/src/core/hle/service/caps/caps_manager.cpp
index 261fc204c..e3b8ecf3e 100644
--- a/src/core/hle/service/caps/caps_manager.cpp
+++ b/src/core/hle/service/caps/caps_manager.cpp
@@ -10,8 +10,10 @@
#include "core/core.h"
#include "core/hle/service/caps/caps_manager.h"
#include "core/hle/service/caps/caps_result.h"
-#include "core/hle/service/time/time_manager.h"
-#include "core/hle/service/time/time_zone_content_manager.h"
+#include "core/hle/service/glue/time/static.h"
+#include "core/hle/service/psc/time/system_clock.h"
+#include "core/hle/service/service.h"
+#include "core/hle/service/sm/sm.h"
namespace Service::Capture {
@@ -239,10 +241,15 @@ Result AlbumManager::SaveScreenShot(ApplicationAlbumEntry& out_entry,
const ApplicationData& app_data, std::span<const u8> image_data,
u64 aruid) {
const u64 title_id = system.GetApplicationProcessProgramID();
- const auto& user_clock = system.GetTimeManager().GetStandardUserSystemClockCore();
+
+ auto static_service =
+ system.ServiceManager().GetService<Service::Glue::Time::StaticService>("time:u", true);
+
+ std::shared_ptr<Service::PSC::Time::SystemClock> user_clock{};
+ static_service->GetStandardUserSystemClock(user_clock);
s64 posix_time{};
- Result result = user_clock.GetCurrentTime(system, posix_time);
+ auto result = user_clock->GetCurrentTime(posix_time);
if (result.IsError()) {
return result;
@@ -257,10 +264,14 @@ Result AlbumManager::SaveEditedScreenShot(ApplicationAlbumEntry& out_entry,
const ScreenShotAttribute& attribute,
const AlbumFileId& file_id,
std::span<const u8> image_data) {
- const auto& user_clock = system.GetTimeManager().GetStandardUserSystemClockCore();
+ auto static_service =
+ system.ServiceManager().GetService<Service::Glue::Time::StaticService>("time:u", true);
+
+ std::shared_ptr<Service::PSC::Time::SystemClock> user_clock{};
+ static_service->GetStandardUserSystemClock(user_clock);
s64 posix_time{};
- Result result = user_clock.GetCurrentTime(system, posix_time);
+ auto result = user_clock->GetCurrentTime(posix_time);
if (result.IsError()) {
return result;
@@ -455,19 +466,23 @@ Result AlbumManager::SaveImage(ApplicationAlbumEntry& out_entry, std::span<const
}
AlbumFileDateTime AlbumManager::ConvertToAlbumDateTime(u64 posix_time) const {
- Time::TimeZone::CalendarInfo calendar_date{};
- const auto& time_zone_manager =
- system.GetTimeManager().GetTimeZoneContentManager().GetTimeZoneManager();
+ auto static_service =
+ system.ServiceManager().GetService<Service::Glue::Time::StaticService>("time:u", true);
+
+ std::shared_ptr<Service::Glue::Time::TimeZoneService> timezone_service{};
+ static_service->GetTimeZoneService(timezone_service);
- time_zone_manager.ToCalendarTimeWithMyRules(posix_time, calendar_date);
+ Service::PSC::Time::CalendarTime calendar_time{};
+ Service::PSC::Time::CalendarAdditionalInfo additional_info{};
+ timezone_service->ToCalendarTimeWithMyRule(calendar_time, additional_info, posix_time);
return {
- .year = calendar_date.time.year,
- .month = calendar_date.time.month,
- .day = calendar_date.time.day,
- .hour = calendar_date.time.hour,
- .minute = calendar_date.time.minute,
- .second = calendar_date.time.second,
+ .year = calendar_time.year,
+ .month = calendar_time.month,
+ .day = calendar_time.day,
+ .hour = calendar_time.hour,
+ .minute = calendar_time.minute,
+ .second = calendar_time.second,
.unique_id = 0,
};
}