Implement SetOperationModeChangedNotification and SetAlbumImageTakenNotificationEnabled

These are typically set to true on application boot, these values determine whether an AppletMessage gets sent when certain actions are performed such as changing from docked to undocked, capturing a screenshot, etc.
This commit is contained in:
Morph
2019-10-27 02:49:58 -04:00
parent 6df6caaf5f
commit 65d89cd553
4 changed files with 73 additions and 29 deletions

View File

@@ -36,14 +36,15 @@ 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 has_signalled = false;
if (applet_oe != nullptr) {
if (applet_oe != nullptr && is_notification_enabled) {
applet_oe->GetMessageQueue()->OperationModeChanged();
has_signalled = true;
}
if (applet_ae != nullptr && !has_signalled) {
if (applet_ae != nullptr && !has_signalled && is_notification_enabled) {
applet_ae->GetMessageQueue()->OperationModeChanged();
}
}