Removed hard coded user agent

This commit is contained in:
Mickaël Turnel 2018-10-09 15:26:30 +02:00
parent 46bfdb54b3
commit 28ae1de066
3 changed files with 3 additions and 2 deletions

View file

@ -8,6 +8,7 @@
<string name="sync_account_type">org.linphone</string> <!-- Change package ! --> <string name="sync_account_type">org.linphone</string> <!-- Change package ! -->
<string name="sync_mimetype">vnd.android.cursor.item/org.linphone.profile</string> <!-- Change package, leave .profile at the end. Also change res/xml/contacts.xml ! --> <string name="sync_mimetype">vnd.android.cursor.item/org.linphone.profile</string> <!-- Change package, leave .profile at the end. Also change res/xml/contacts.xml ! -->
<string name="rls_uri">sip:rls@sip.linphone.org</string> <string name="rls_uri">sip:rls@sip.linphone.org</string>
<string name="user_agent">LinphoneAndroid</string>
<bool name="orientation_portrait_only">false</bool> <bool name="orientation_portrait_only">false</bool>
<bool name="show_statusbar_only_on_dialer">false</bool> <bool name="show_statusbar_only_on_dialer">false</bool>
<bool name="force_use_of_linphone_friends">false</bool> <bool name="force_use_of_linphone_friends">false</bool>

View file

@ -708,7 +708,7 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
//Api to check version can't use version code //Api to check version can't use version code
mLc.checkForUpdate(versionName); mLc.checkForUpdate(versionName);
} }
mLc.setUserAgent("LinphoneAndroid", versionName); mLc.setUserAgent(mServiceContext.getResources().getString(R.string.user_agent), versionName);
} catch (NameNotFoundException e) { } catch (NameNotFoundException e) {
Log.e(e, "cannot get version name"); Log.e(e, "cannot get version name");
} }

View file

@ -115,7 +115,7 @@ public class LinphoneTestManager implements LinphoneCoreListener{
if (versionName == null) { if (versionName == null) {
versionName = String.valueOf(c.getPackageManager().getPackageInfo(c.getPackageName(), 0).versionCode); versionName = String.valueOf(c.getPackageManager().getPackageInfo(c.getPackageName(), 0).versionCode);
} }
mLc.setUserAgent("LinphoneAndroid", versionName); mLc.setUserAgent(mIContext.getResources().getString(R.string.user_agent), versionName);
} catch (NameNotFoundException e) { } catch (NameNotFoundException e) {
Log.e(e, "cannot get version name"); Log.e(e, "cannot get version name");
} }