@@ -179,6 +179,16 @@ + (void)setUsingTestConfiguration:(BOOL)shouldUseTestConfiguration
179
179
@synthesize pauseCallback = _pauseCallback;
180
180
@synthesize paused = _paused;
181
181
182
+ - (void )setPaused : (BOOL )paused
183
+ {
184
+ if (_paused != paused) {
185
+ _paused = paused;
186
+ if (_pauseCallback) {
187
+ _pauseCallback ();
188
+ }
189
+ }
190
+ }
191
+
182
192
/*
183
193
* This method is used to clear updates that are installed
184
194
* under a different app version and hence don't apply anymore,
@@ -291,7 +301,7 @@ - (void)initializeUpdateAfterRestart
291
301
#ifdef DEBUG
292
302
[self clearDebugUpdates ];
293
303
#endif
294
- _paused = YES ;
304
+ self. paused = YES ;
295
305
NSUserDefaults *preferences = [NSUserDefaults standardUserDefaults ];
296
306
NSDictionary *pendingUpdate = [preferences objectForKey: PendingUpdateKey];
297
307
if (pendingUpdate) {
@@ -512,7 +522,7 @@ - (void)applicationWillResignActive
512
522
// Set up and unpause the frame observer so that it can emit
513
523
// progress events every frame if the progress is updated.
514
524
_didUpdateProgress = NO ;
515
- _paused = NO ;
525
+ self. paused = NO ;
516
526
}
517
527
518
528
[CodePushPackage
@@ -530,7 +540,7 @@ - (void)applicationWillResignActive
530
540
// updates and synchronously send the last event.
531
541
if (expectedContentLength == receivedContentLength) {
532
542
_didUpdateProgress = NO ;
533
- _paused = YES ;
543
+ self. paused = YES ;
534
544
[self dispatchDownloadProgressEvent ];
535
545
}
536
546
}
@@ -552,7 +562,7 @@ - (void)applicationWillResignActive
552
562
553
563
// Stop observing frame updates if the download fails.
554
564
_didUpdateProgress = NO ;
555
- _paused = YES ;
565
+ self. paused = YES ;
556
566
reject ([NSString stringWithFormat: @" %lu " , (long )err.code], err.localizedDescription , err);
557
567
}];
558
568
}
0 commit comments