Merge branch 'new_ui' into apple_store

This commit is contained in:
Yann Diorcet 2012-12-03 16:21:47 +01:00
commit 0c9f04ed81
2 changed files with 5 additions and 2 deletions

View file

@ -582,8 +582,8 @@ static PhoneMainView* phoneMainViewInstance=nil;
if (!call || !linphone_call_params_video_enabled(linphone_call_get_current_params(call)))
return;
LinphoneCallAppData* appData = (LinphoneCallAppData*) linphone_call_get_user_pointer(call);
float level = [UIDevice currentDevice].batteryLevel;
if ([UIDevice currentDevice].batteryState == UIDeviceBatteryStateUnplugged) {
float level = [UIDevice currentDevice].batteryLevel;
[LinphoneLogger logc:LinphoneLoggerLog format:"Video call is running. Battery level: %.2f", level];
if (level < 0.1 && !appData->batteryWarningShown) {
DTActionSheet *sheet = [[[DTActionSheet alloc] initWithTitle:NSLocalizedString(@"Battery is running low. Stop video ?",nil)] autorelease];
@ -598,6 +598,9 @@ static PhoneMainView* phoneMainViewInstance=nil;
appData->batteryWarningShown = TRUE;
}
}
if (level >= 0.1) {
appData->batteryWarningShown = FALSE;
}
}

View file

@ -655,7 +655,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[[PhoneMainView instance].mainViewController clearCache:[NSArray arrayWithObject:[[PhoneMainView instance] currentView]]];
} else if([key isEqual:@"battery_alert_button"]) {
[[UIDevice currentDevice] _setBatteryState:UIDeviceBatteryStateUnplugged];
[[UIDevice currentDevice] _setBatteryLevel:0.09f];
[[UIDevice currentDevice] _setBatteryLevel:0.01f];
[[NSNotificationCenter defaultCenter] postNotificationName:UIDeviceBatteryLevelDidChangeNotification object:self];
}
#endif