Add edge optimization prefrence

This commit is contained in:
Yann Diorcet 2012-12-03 15:31:39 +01:00
parent 63eced2dc1
commit 5784808dd9
9 changed files with 66 additions and 11 deletions

View file

@ -201,7 +201,8 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
[self setString:val forKey:@"media_encryption_preference"];
}
[self setString: lp_config_get_string(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "rotation_preference", "auto") forKey:@"rotation_preference"];
[self setBool: lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "enable_first_login_view_preference", 0) forKey:@"enable_first_login_view_preference"];
[self setBool: lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "edge_opt_preference", 1) forKey:@"edge_opt_preference"];
[self setBool: lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "enable_first_login_view_preference", 0) forKey:@"enable_first_login_view_preference"];
[self setBool: lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "debugenable_preference", 0) forKey:@"debugenable_preference"];
[self setBool: lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "animations_preference", 1) forKey:@"animations_preference"];
[self setBool: lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "wifi_only_preference", 0) forKey:@"wifi_only_preference"];
@ -575,11 +576,15 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
} else {
isbackgroundModeEnabled = false;
}
lp_config_set_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "backgroundmode_preference", isbackgroundModeEnabled);
BOOL firstloginview = [self boolForKey:@"enable_first_login_view_preference"];
lp_config_set_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "enable_first_login_view_preference", firstloginview);
BOOL edgeOpt = [self boolForKey:@"edge_opt_preference"];
lp_config_set_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "edge_opt_preference", edgeOpt);
NSString *landscape = [self stringForKey:@"rotation_preference"];
lp_config_set_string(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "rotation_preference", [landscape UTF8String]);

View file

@ -1139,11 +1139,13 @@ static void audioRouteChangeListenerCallback (
- (void)acceptCall:(LinphoneCall *)call {
LinphoneCallParams* lcallParams = linphone_core_create_default_call_parameters(theLinphoneCore);
bool low_bandwidth = self.network == network_2g;
if(low_bandwidth) {
[LinphoneLogger log:LinphoneLoggerDebug format:@"Low bandwidth mode"];
if([self lpConfigBoolForKey:@"edge_opt_preference"]) {
bool low_bandwidth = self.network == network_2g;
if(low_bandwidth) {
[LinphoneLogger log:LinphoneLoggerDebug format:@"Low bandwidth mode"];
}
linphone_call_params_enable_low_bandwidth(lcallParams, low_bandwidth);
}
linphone_call_params_enable_low_bandwidth(lcallParams, low_bandwidth);
linphone_core_accept_call_with_params(theLinphoneCore,call, lcallParams);
}
@ -1178,11 +1180,13 @@ static void audioRouteChangeListenerCallback (
//get default proxy
linphone_core_get_default_proxy(theLinphoneCore,&proxyCfg);
LinphoneCallParams* lcallParams = linphone_core_create_default_call_parameters(theLinphoneCore);
bool low_bandwidth = self.network == network_2g;
if(low_bandwidth) {
[LinphoneLogger log:LinphoneLoggerDebug format:@"Low bandwidth mode"];
if([self lpConfigBoolForKey:@"edge_opt_preference"]) {
bool low_bandwidth = self.network == network_2g;
if(low_bandwidth) {
[LinphoneLogger log:LinphoneLoggerDebug format:@"Low bandwidth mode"];
}
linphone_call_params_enable_low_bandwidth(lcallParams, low_bandwidth);
}
linphone_call_params_enable_low_bandwidth(lcallParams, low_bandwidth);
LinphoneCall* call=NULL;
if ([address length] == 0) return; //just return

View file

@ -24,6 +24,7 @@ firewall_policy=0
[app]
rotation_preference=auto
animations_preference=1
edge_opt_preference=1
[default_values]
reg_expires=600

View file

@ -24,6 +24,7 @@ firewall_policy=0
[app]
rotation_preference=auto
animations_preference=1
edge_opt_preference=1
[default_values]
reg_expires=600

View file

@ -4,6 +4,16 @@
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>DefaultValue</key>
<false/>
<key>Key</key>
<string>edge_opt_preference</string>
<key>Title</key>
<string>Edge optimization</string>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>DefaultValue</key>
<false/>

View file

@ -1,6 +1,9 @@
/* Wifi only */
"Wifi only" = "Wifi only";
/* Edge optimization */
"Edge optimization" = "Edge optimization";
/* Stun Server */
"Stun Server" = "Stun Server";

View file

@ -1,6 +1,9 @@
/* Wifi only */
"Wifi only" = "Uniquement Wifi";
/* Edge optimization */
"Edge optimization" = "Optimisation Edge";
/* Stun Server */
"Stun Server" = "Serveur Stun";

View file

@ -17452,7 +17452,7 @@ Raison: %2$s</string>
</dict>
</dict>
<key>change date</key>
<date>2012-11-13T09:28:24Z</date>
<date>2012-12-03T14:20:32Z</date>
<key>changed values</key>
<array/>
<key>class</key>
@ -17462,7 +17462,7 @@ Raison: %2$s</string>
<key>flags</key>
<integer>0</integer>
<key>hash</key>
<string>7220a3af4b5567ce1842c8a01759b1c9
<string>61504fb6dc1719749e72de751676a9cf
</string>
<key>name</key>
<string>Network.strings</string>
@ -17493,6 +17493,31 @@ Raison: %2$s</string>
<key>snapshots</key>
<dict/>
</dict>
<dict>
<key>change date</key>
<date>2001-01-01T00:00:00Z</date>
<key>changed values</key>
<array/>
<key>class</key>
<string>BLStringKeyObject</string>
<key>comment</key>
<string>Edge optimization</string>
<key>errors</key>
<array/>
<key>flags</key>
<integer>0</integer>
<key>key</key>
<string>Edge optimization</string>
<key>localizations</key>
<dict>
<key>en</key>
<string>Edge optimization</string>
<key>fr</key>
<string>Optimisation Edge</string>
</dict>
<key>snapshots</key>
<dict/>
</dict>
<dict>
<key>change date</key>
<date>2001-01-01T00:00:00Z</date>

View file

@ -1,6 +1,9 @@
/* Wifi only */
"Wifi only" = "Wifi only";
/* Edge optimization */
"Edge optimization" = "Edge optimization";
/* Stun Server */
"Stun Server" = "Stun Server";