diff --git a/Classes/PhoneMainView.h b/Classes/PhoneMainView.h index 6eb31fc16..2816df501 100644 --- a/Classes/PhoneMainView.h +++ b/Classes/PhoneMainView.h @@ -61,7 +61,6 @@ @interface PhoneMainView : UIViewController { @private NSMutableArray *inhibitedEvents; - NSTimer *batteryTimer; } @property (nonatomic, retain) IBOutlet UIView *statusBarBG; diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 070a71f66..ba4c907ce 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -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 {