mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-22 13:48:09 +00:00
Don't use a 10s timer for battery level polling. Legacy code?
This commit is contained in:
parent
45f0642485
commit
4dc4fca33e
2 changed files with 2 additions and 5 deletions
|
|
@ -61,7 +61,6 @@
|
|||
@interface PhoneMainView : UIViewController<IncomingCallViewDelegate> {
|
||||
@private
|
||||
NSMutableArray *inhibitedEvents;
|
||||
NSTimer *batteryTimer;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UIView *statusBarBG;
|
||||
|
|
|
|||
|
|
@ -187,13 +187,12 @@ static RootViewManager* rootViewManagerInstance = nil;
|
|||
selector:@selector(onGlobalStateChanged:)
|
||||
name:kLinphoneGlobalStateUpdate
|
||||
object:nil];
|
||||
[[UIDevice currentDevice] setBatteryMonitoringEnabled:YES];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(batteryLevelChanged:)
|
||||
name:UIDeviceBatteryLevelDidChangeNotification
|
||||
object:nil];
|
||||
[[UIDevice currentDevice] setBatteryMonitoringEnabled:YES];
|
||||
|
||||
batteryTimer = [NSTimer scheduledTimerWithTimeInterval:10.0f target:self selector:@selector(batteryLevelChanged:) userInfo:nil repeats:TRUE];
|
||||
|
||||
}
|
||||
|
||||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
|
|
@ -221,7 +220,6 @@ static RootViewManager* rootViewManagerInstance = nil;
|
|||
object:nil];
|
||||
[[UIDevice currentDevice] setBatteryMonitoringEnabled:NO];
|
||||
|
||||
[batteryTimer invalidate];
|
||||
}
|
||||
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue