Create accessor methods and deglobalize variables
This commit is contained in:
@@ -549,6 +549,14 @@ void ISelfController::SetAlbumImageTakenNotificationEnabled(Kernel::HLERequestCo
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
}
|
||||
|
||||
bool ISelfController::GetOperationModeChangedNotification() const {
|
||||
return operation_mode_changed_notification;
|
||||
}
|
||||
|
||||
bool ISelfController::GetAlbumImageTakenNotificationEnabled() const {
|
||||
return album_image_taken_notification_enabled;
|
||||
}
|
||||
|
||||
AppletMessageQueue::AppletMessageQueue(Kernel::KernelCore& kernel) {
|
||||
on_new_message =
|
||||
Kernel::WritableEvent::CreateEventPair(kernel, "AMMessageQueue:OnMessageReceived");
|
||||
|
||||
@@ -41,13 +41,6 @@ enum SystemLanguage {
|
||||
TraditionalChinese = 16,
|
||||
};
|
||||
|
||||
// Notification flags
|
||||
bool operation_mode_changed_notification = false;
|
||||
bool performance_mode_changed_notification = false;
|
||||
bool restart_message_enabled = false;
|
||||
bool out_of_focus_suspending_enabled = false;
|
||||
bool album_image_taken_notification_enabled = false;
|
||||
|
||||
class AppletMessageQueue {
|
||||
public:
|
||||
enum class AppletMessage : u32 {
|
||||
@@ -133,6 +126,9 @@ public:
|
||||
std::shared_ptr<NVFlinger::NVFlinger> nvflinger_);
|
||||
~ISelfController() override;
|
||||
|
||||
bool GetOperationModeChangedNotification() const;
|
||||
bool GetAlbumImageTakenNotificationEnabled() const;
|
||||
|
||||
private:
|
||||
void Exit(Kernel::HLERequestContext& ctx);
|
||||
void LockExit(Kernel::HLERequestContext& ctx);
|
||||
@@ -164,6 +160,11 @@ private:
|
||||
|
||||
u32 idle_time_detection_extension = 0;
|
||||
u64 num_fatal_sections_entered = 0;
|
||||
bool operation_mode_changed_notification = false;
|
||||
bool performance_mode_changed_notification = false;
|
||||
bool restart_message_enabled = false;
|
||||
bool out_of_focus_suspending_enabled = false;
|
||||
bool album_image_taken_notification_enabled = false;
|
||||
bool is_auto_sleep_disabled = false;
|
||||
};
|
||||
|
||||
|
||||
@@ -36,7 +36,8 @@ void OnDockedModeChanged(bool last_state, bool new_state) {
|
||||
// change to one and it will handle both automatically
|
||||
auto applet_oe = sm.GetService<Service::AM::AppletOE>("appletOE");
|
||||
auto applet_ae = sm.GetService<Service::AM::AppletAE>("appletAE");
|
||||
bool is_notification_enabled = Service::AM::operation_mode_changed_notification;
|
||||
bool is_notification_enabled =
|
||||
Service::AM::ISelfController::GetOperationModeChangedNotification();
|
||||
bool has_signalled = false;
|
||||
|
||||
if (applet_oe != nullptr && is_notification_enabled) {
|
||||
|
||||
@@ -1914,7 +1914,8 @@ void GMainWindow::OnCaptureScreenshot() {
|
||||
auto& sm{Core::System::GetInstance().ServiceManager()};
|
||||
auto applet_oe = sm.GetService<Service::AM::AppletOE>("appletOE");
|
||||
auto applet_ae = sm.GetService<Service::AM::AppletAE>("appletAE");
|
||||
bool is_notification_enabled = Service::AM::album_image_taken_notification_enabled;
|
||||
bool is_notification_enabled =
|
||||
Service::AM::ISelfController::GetAlbumImageTakenNotificationEnabled();
|
||||
bool has_signalled = false;
|
||||
if (applet_oe != nullptr && is_notification_enabled) {
|
||||
applet_oe->GetMessageQueue()->ScreenshotTaken();
|
||||
|
||||
Reference in New Issue
Block a user