Using real useragent when creating an account
This commit is contained in:
parent
de27a3f87b
commit
c2fb98aade
4 changed files with 21 additions and 2 deletions
|
@ -84,6 +84,7 @@ import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.SharedPreferences.Editor;
|
import android.content.SharedPreferences.Editor;
|
||||||
|
import android.content.pm.PackageManager.NameNotFoundException;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.hardware.Sensor;
|
import android.hardware.Sensor;
|
||||||
import android.hardware.SensorEvent;
|
import android.hardware.SensorEvent;
|
||||||
|
@ -251,6 +252,17 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getUserAgent() throws NameNotFoundException {
|
||||||
|
StringBuilder userAgent = new StringBuilder();
|
||||||
|
userAgent.append("LinphoneAndroid/" + mServiceContext.getPackageManager().getPackageInfo(mServiceContext.getPackageName(),0).versionCode);
|
||||||
|
userAgent.append(" (");
|
||||||
|
userAgent.append("Linphone/" + LinphoneManager.getLc().getVersion() + "; ");
|
||||||
|
userAgent.append(Build.DEVICE + " " + Build.MODEL + " Android/" + Build.VERSION.SDK_INT);
|
||||||
|
userAgent.append(")");
|
||||||
|
return userAgent.toString();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -110,6 +110,7 @@ class LinphoneCoreImpl implements LinphoneCore {
|
||||||
private native void removeCallLog(long nativePtr, long callLogPtr);
|
private native void removeCallLog(long nativePtr, long callLogPtr);
|
||||||
private native int getMissedCallsCount(long nativePtr);
|
private native int getMissedCallsCount(long nativePtr);
|
||||||
private native void resetMissedCallsCount(long nativePtr);
|
private native void resetMissedCallsCount(long nativePtr);
|
||||||
|
private native String getVersion(long nativePtr);
|
||||||
|
|
||||||
LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig,File factoryConfig,Object userdata) throws IOException {
|
LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig,File factoryConfig,Object userdata) throws IOException {
|
||||||
mListener=listener;
|
mListener=listener;
|
||||||
|
@ -731,4 +732,9 @@ class LinphoneCoreImpl implements LinphoneCore {
|
||||||
public void refreshRegisters() {
|
public void refreshRegisters() {
|
||||||
refreshRegisters(nativePtr);
|
refreshRegisters(nativePtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getVersion() {
|
||||||
|
return getVersion(nativePtr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
|
import org.linphone.LinphoneManager;
|
||||||
import org.linphone.R;
|
import org.linphone.R;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
@ -194,7 +195,7 @@ public class WizardFragment extends Fragment {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
client.callAsync(listener, "create_account_with_useragent", username, password, email, "linphone-wizard-android");
|
client.callAsync(listener, "create_account_with_useragent", username, password, email, LinphoneManager.getInstance().getUserAgent());
|
||||||
}
|
}
|
||||||
catch(Exception ex) {
|
catch(Exception ex) {
|
||||||
mHandler.post(runNotReachable);
|
mHandler.post(runNotReachable);
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit deb7ed6d93904dd0acee486e24f8bf9fb7b5aa33
|
Subproject commit 271814cdfb76fa4fa1407d4b6ab9aa924b792d09
|
Loading…
Reference in a new issue