summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Knutsson <jonas5.knutsson@sonymobile.com>2013-11-12 16:20:04 +0100
committerSteve Kondik <steve@cyngn.com>2016-09-26 02:58:27 -0700
commit22521500da9ef58327e25a4e20e7b46b321720e4 (patch)
tree4f9ec7f5a89d76ecdc96f12412b1e9f1505495a0
parentb814dc74c6b99bf02120bda2e9bdb6d569ed1de0 (diff)
downloadandroid_packages_apps_Exchange-22521500da9ef58327e25a4e20e7b46b321720e4.tar.gz
android_packages_apps_Exchange-22521500da9ef58327e25a4e20e7b46b321720e4.tar.bz2
android_packages_apps_Exchange-22521500da9ef58327e25a4e20e7b46b321720e4.zip
Display model name on exchange server and exclude illegal characters
All devices register on exchange server will list on server side and show as "Android" as device name. Devices brand and model needs to display on exchange server to make better information. Most operators has requirement to show device brand and model for device name, such as one of Canada's largest telecommunications company Bell mobile did. Devices brand and model needs to display on exchange server according to most operator's requirement. Exchange server only accepts the device type which contains letter and digital. That means if a device type contains such as "-",Exchange server will reject this device. So trim all other characters. Change-Id: I0efd8cba8f08f625b950d31a38a0367697c8639d Aosp: https://android-review.googlesource.com/#/c/99579
-rw-r--r--src/com/android/exchange/service/EasServerConnection.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/exchange/service/EasServerConnection.java b/src/com/android/exchange/service/EasServerConnection.java
index 87d5b284..be4e0ed6 100644
--- a/src/com/android/exchange/service/EasServerConnection.java
+++ b/src/com/android/exchange/service/EasServerConnection.java
@@ -79,7 +79,11 @@ public class EasServerConnection {
*/
protected static final long COMMAND_TIMEOUT = 30 * DateUtils.SECOND_IN_MILLIS;
- private static final String DEVICE_TYPE = "Android";
+ // Exchange server only accepts letter and digital as device type. Trim all
+ // other characters.
+ private static final String DEVICE_TYPE =
+ (Build.BRAND + Build.MODEL).replaceAll("[^a-zA-Z0-9]", "");
+
private static final String USER_AGENT = DEVICE_TYPE + '/' + Build.VERSION.RELEASE + '-' +
Eas.CLIENT_VERSION;