Browse Source

APPLEMAIL-33 Use NS_CLOSE_ENUM in PEPNotificationXPCApiProtocol. Add NSAssert in default init methods.

APPLEMAIL-33
David Alarcon 2 years ago
parent
commit
d2445d03ae
4 changed files with 19 additions and 9 deletions
  1. +6
    -0
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPNotificationXPCService/PEPNotificationXPCClient/XPCService/PEPNotificationXPCClientService.m
  2. +6
    -0
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPNotificationXPCService/PEPNotificationXPCService/XPCService/PEPNotificationXPCApi.m
  3. +6
    -7
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPNotificationXPCService/Shared/PEPNotificationXPCApiProtocol.h
  4. +1
    -2
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloadXPCService/XPCService/PEPUpdateDownloadXPCService.m

+ 6
- 0
Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPNotificationXPCService/PEPNotificationXPCClient/XPCService/PEPNotificationXPCClientService.m View File

@ -18,6 +18,12 @@
@implementation PEPNotificationXPCClientService
- (instancetype)init {
NSAssert(NO, @"Use initWithListenerEndpoint:updateDownloader: instead.");
return nil;
}
- (instancetype)initWithListenerEndpoint:(NSXPCListenerEndpoint *)endpoint
updateDownloader:(PEPUpdateDownloader *)updateDownloader {
if (self = [self init]) {


+ 6
- 0
Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPNotificationXPCService/PEPNotificationXPCService/XPCService/PEPNotificationXPCApi.m View File

@ -13,6 +13,12 @@
@implementation PEPNotificationXPCApi
- (instancetype)init {
NSAssert(NO, @"Use initWithDelegate: instead.");
return nil;
}
- (instancetype)initWithDelegate:(id<PEPNotificationXPCServiceDelegate>)delegate {
if (self = [self init]) {
_delegate = delegate;


+ 6
- 7
Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPNotificationXPCService/Shared/PEPNotificationXPCApiProtocol.h View File

@ -11,13 +11,12 @@
NS_ASSUME_NONNULL_BEGIN
/// Notification types
//NS_CLOSED_ENUM(int, DNType) {
// ready = 0,
// downloading,
// downloadArrived,
// noDownloadAvailable
//};
typedef enum { ready = 0, downloading, downloadArrived, noDownloadAvailable } DNType;
NS_CLOSED_ENUM(int, DNType) {
ready = 0,
downloading,
downloadArrived,
noDownloadAvailable
};
/// Callback protocol to notify about download events
@protocol PEPNotificationXPCApiProtocol <NSObject>


+ 1
- 2
Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloadXPCService/XPCService/PEPUpdateDownloadXPCService.m View File

@ -33,13 +33,12 @@
[self.listener resume];
BOOL opened = [self startPEPUpdatesApp];
NSAssert(opened, @"Fail to open pp updates.app.");
NSAssert(opened, @"Fail to open 'p≡p updates.app'.");
}
// MARK: - Private
- (BOOL)startPEPUpdatesApp {
NSURL *url = [NSURL
fileURLWithPath:@"/Library/Application Support/pEp/pEp.app/Contents/Library/LoginItems/pp updates.app"];


Loading…
Cancel
Save