public String getUserAgent(Context ctx) { String userAgent = getPreferenceStringValue(SipConfigManager.USER_AGENT); if (userAgent.equalsIgnoreCase(CustomDistribution.getUserAgent())) { // If that's the official -not custom- user agent, send the release, the device and the api // level PackageInfo pinfo = getCurrentPackageInfos(ctx); if (pinfo != null) { userAgent += "_" + android.os.Build.DEVICE + "-" + Compatibility.getApiLevel() + "/r" + pinfo.versionCode; } } return userAgent; }