From 665308ef6b3ea1bff51e5137883ca341b8ad4df1 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Thu, 4 Feb 2010 09:38:08 -0800 Subject: Fix #2494676 (escalated by VZW) DO NOT MERGE * The following notes are from the original Froyo fix that has been backported here. The original bug is #2415185 and the original fix was in CL 39561, SHA 48e20b81e6b8a6016ee848db57cbf78a7a2da24 * Exchange account validation tests security policies by sending a FolderSync command and determining whether this generates an error * Unfortunately, we use the real deviceId when sending the command and this causes the next real sync to fail such that all data is wiped and reloaded (the bug) * The fix is to use a false device id while doing validation Bug: 2494676 Change-Id: I7fb04b01127f7b0426bd50a25c56dac1a3bce7af --- src/com/android/exchange/EasSyncService.java | 4 +++- src/com/android/exchange/SyncManager.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/com/android/exchange/EasSyncService.java b/src/com/android/exchange/EasSyncService.java index bba2ddffb..5f8eed34c 100644 --- a/src/com/android/exchange/EasSyncService.java +++ b/src/com/android/exchange/EasSyncService.java @@ -205,7 +205,9 @@ public class EasSyncService extends AbstractSyncService { svc.mPassword = password; svc.mSsl = ssl; svc.mTrustSsl = trustCertificates; - svc.mDeviceId = SyncManager.getDeviceId(); + // We mustn't use the "real" device id or we'll screw up current accounts + // Any string will do, but we'll go for "validate" + svc.mDeviceId = "validate"; HttpResponse resp = svc.sendHttpClientOptions(); int code = resp.getStatusLine().getStatusCode(); userLog("Validation (OPTIONS) response: " + code); diff --git a/src/com/android/exchange/SyncManager.java b/src/com/android/exchange/SyncManager.java index cc4afed6b..06d9e28e5 100644 --- a/src/com/android/exchange/SyncManager.java +++ b/src/com/android/exchange/SyncManager.java @@ -751,7 +751,7 @@ public class SyncManager extends Service implements Runnable { return id; } else if (f.createNewFile()) { BufferedWriter w = new BufferedWriter(new FileWriter(f), 128); - id = "droid" + System.currentTimeMillis(); + id = "android" + System.currentTimeMillis(); w.write(id); w.close(); sDeviceId = id; -- cgit v1.2.3