mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-29 09:09:21 +00:00
Merge branch 'new_ui' into apple_store
This commit is contained in:
commit
0c9f04ed81
2 changed files with 5 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue