From 9d559481d323e1ea96fe56ff2c16550df05c4172 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Mon, 20 Jun 2022 16:43:21 -0700 Subject: [PATCH] [Sandbox] Disable distributed iTunes notification This notification can't escape the sandbox anyway, and I forgot to remove it after adding the app sandbox code again. Signed-off-by: Christopher Snowhill --- Application/PlaybackEventController.m | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Application/PlaybackEventController.m b/Application/PlaybackEventController.m index a222792c9..d14cbcd5b 100644 --- a/Application/PlaybackEventController.m +++ b/Application/PlaybackEventController.m @@ -9,6 +9,7 @@ #import "PlaylistEntry.h" +#if 0 NSString *TrackNotification = @"com.apple.iTunes.playerInfo"; NSString *TrackArtist = @"Artist"; @@ -23,6 +24,7 @@ NSString *TrackState = @"Player State"; typedef NS_ENUM(NSInteger, TrackStatus) { TrackPlaying, TrackPaused, TrackStopped }; +#endif @implementation PlaybackEventController { NSOperationQueue *queue; @@ -105,6 +107,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response } } +#if 0 - (NSDictionary *)fillNotificationDictionary:(PlaylistEntry *)pe status:(TrackStatus)status { NSMutableDictionary *dict = [NSMutableDictionary dictionary]; if(pe == nil || pe.deLeted || pe.url == nil) return dict; @@ -140,16 +143,19 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response return dict; } +#endif - (void)performPlaybackDidBeginActions:(PlaylistEntry *)pe { if(NO == [pe error]) { entry = pe; +#if 0 [[NSDistributedNotificationCenter defaultCenter] postNotificationName:TrackNotification object:nil userInfo:[self fillNotificationDictionary:pe status:TrackPlaying] deliverImmediately:YES]; +#endif NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; @@ -283,27 +289,33 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response } - (void)performPlaybackDidPauseActions { +#if 0 [[NSDistributedNotificationCenter defaultCenter] postNotificationName:TrackNotification object:nil userInfo:[self fillNotificationDictionary:entry status:TrackPaused] deliverImmediately:YES]; +#endif } - (void)performPlaybackDidResumeActions { +#if 0 [[NSDistributedNotificationCenter defaultCenter] postNotificationName:TrackNotification object:nil userInfo:[self fillNotificationDictionary:entry status:TrackPlaying] deliverImmediately:YES]; +#endif } - (void)performPlaybackDidStopActions { +#if 0 [[NSDistributedNotificationCenter defaultCenter] postNotificationName:TrackNotification object:nil userInfo:[self fillNotificationDictionary:entry status:TrackStopped] deliverImmediately:YES]; +#endif entry = nil; }