diff options
author | Artem Shipovskiy <artem0711@gmail.com> | 2016-01-29 23:14:41 +0500 |
---|---|---|
committer | Christian S <christian@pix-art.de> | 2016-02-04 18:15:25 +0100 |
commit | 1ae74784ca5466c879e678687f84f4b9b1e91420 (patch) | |
tree | 6bed98f54b9fe2f673f275cb86cbdc8c5baafa54 /src/main | |
parent | f1bcd77f9083464d45432a2b475300fc210142ea (diff) |
Add device name to client info
Diffstat (limited to 'src/main')
3 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java b/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java index fe43e0bfb..835eef36b 100644 --- a/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java +++ b/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java @@ -37,6 +37,8 @@ public abstract class AbstractGenerator { "urn:xmpp:receipts" }; private String mVersion = null; + + private String mVersionOs = null; protected final String IDENTITY_NAME = "Pix-Art Messenger"; protected final String IDENTITY_TYPE = "phone"; @@ -55,6 +57,14 @@ public abstract class AbstractGenerator { return this.mVersion; } + protected String getIdentityVersionOs() { + if (mVersionOs == null) { + this.mVersionOs = "Android/" + android.os.Build.MODEL + + "/" + android.os.Build.VERSION.RELEASE; + } + return this.mVersionOs; + } + public String getIdentityName() { return IDENTITY_NAME + " " + getIdentityVersion(); } diff --git a/src/main/java/eu/siacs/conversations/generator/IqGenerator.java b/src/main/java/eu/siacs/conversations/generator/IqGenerator.java index 345f68ae3..3b9f8ce06 100644 --- a/src/main/java/eu/siacs/conversations/generator/IqGenerator.java +++ b/src/main/java/eu/siacs/conversations/generator/IqGenerator.java @@ -57,6 +57,7 @@ public class IqGenerator extends AbstractGenerator { Element query = packet.query("jabber:iq:version"); query.addChild("name").setContent(IDENTITY_NAME); query.addChild("version").setContent(getIdentityVersion()); + query.addChild("os").setContent(getIdentityVersionOs()); return packet; } diff --git a/src/main/java/eu/siacs/conversations/utils/PhoneHelper.java b/src/main/java/eu/siacs/conversations/utils/PhoneHelper.java index 6c1b4bef5..48c9104f9 100644 --- a/src/main/java/eu/siacs/conversations/utils/PhoneHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/PhoneHelper.java @@ -133,4 +133,8 @@ public class PhoneHelper { return "unknown"; } } + + public static String getOSVersion(Context context) { + return "Android/" + android.os.Build.MODEL + "/" + android.os.Build.VERSION.RELEASE; + } } |