@@ -75,11 +75,7 @@ - (instancetype)init;
75
75
_logDistributingQueue.name = [NSString stringWithFormat: @" %@ Log Distributing Queue" , self ];
76
76
_logDistributingQueue.maxConcurrentOperationCount = 1 ;
77
77
78
- #ifdef __IPHONE_8_0
79
- if ([_logDistributingQueue respondsToSelector: @selector (setQualityOfService: )] /* iOS 8 or later */ ) {
80
- _logDistributingQueue.qualityOfService = NSQualityOfServiceBackground ;
81
- }
82
- #endif
78
+ [self _setDistributionQualityOfServiceBackground ];
83
79
84
80
_logObservers = [NSMutableArray new ];
85
81
@@ -203,8 +199,10 @@ - (void)distributeAllPendingLogsWithCompletionHandler:(dispatch_block_t)completi
203
199
{
204
200
ARKCheckCondition (completionHandler != NULL , , @" Must provide a completion handler!" );
205
201
202
+ [self _setDistributionQualityOfServiceUserInitiated ];
206
203
[self .logDistributingQueue addOperationWithBlock: ^{
207
204
[[NSOperationQueue mainQueue ] addOperationWithBlock: completionHandler];
205
+ [self _setDistributionQualityOfServiceBackground ];
208
206
}];
209
207
}
210
208
@@ -296,4 +294,29 @@ - (void)_logMessage_inLogDistributingQueue:(ARKLogMessage *)logMessage;
296
294
}
297
295
}
298
296
297
+ - (void )_setDistributionQualityOfServiceUserInitiated ;
298
+ {
299
+ #ifdef __IPHONE_8_0
300
+ [self _setDistributionQualityOfService: NSQualityOfServiceUserInitiated ];
301
+ #endif
302
+ }
303
+
304
+ - (void )_setDistributionQualityOfServiceBackground ;
305
+ {
306
+ #ifdef __IPHONE_8_0
307
+ [self _setDistributionQualityOfService: NSQualityOfServiceBackground ];
308
+ #endif
309
+ }
310
+
311
+ #ifdef __IPHONE_8_0
312
+
313
+ - (void )_setDistributionQualityOfService : (NSQualityOfService )qualityOfService ;
314
+ {
315
+ if ([self .logDistributingQueue respondsToSelector: @selector (setQualityOfService: )] /* iOS 8 or later */ ) {
316
+ self.logDistributingQueue .qualityOfService = qualityOfService;
317
+ }
318
+ }
319
+
320
+ #endif
321
+
299
322
@end
0 commit comments