Commit Graph

1695 Commits

Author SHA1 Message Date
Makoto Onuki
c563ce1b80 am b8970dab: am e46ac1a6: Cleanup imports. 2010-05-07 15:20:47 -07:00
Makoto Onuki
b8970dabb6 am e46ac1a6: Cleanup imports.
Merge commit 'e46ac1a61f32bd762a879457b1850087a1ad3a8c' into kraken

* commit 'e46ac1a61f32bd762a879457b1850087a1ad3a8c':
  Cleanup imports.
2010-05-07 15:17:35 -07:00
Makoto Onuki
e46ac1a61f Cleanup imports.
(Note it's for froyo-plus-asop)

Change-Id: Ia5b771cd41099ab486ba2e556b441fc7c0affe5f
2010-05-07 14:33:44 -07:00
Makoto Onuki
1f2caa8095 Fix 3 problems that FindBugs found.
Bug 2666278 [findbugs] broken double-lock pettern in Utility.FolderProperties.getInstance()
Bug 2666207 [findbugs] potential NPE in MessagingController.processPendingDeletesSynchronous()
Bug 2666195 [findbugs] Potential NPE in AccountSetupNames.onCreate()

Change-Id: I2ee5bd5b7c80f8bdd32b3c45abb655a3d3fb8c9e
2010-05-07 14:04:50 -07:00
Marc Blank
c901810f84 Start sync ASAP when calendar is re-enabled
Bug: 2664421
Change-Id: Id3c08a5ca8abc5ad0f483408f38371dcc5f2d840
2010-05-06 20:36:36 -07:00
Marc Blank
3517816edb am d58a050d: am 630758ef: am 3558e5f2: Shut down Email process when sync is totally blocked 2010-05-06 16:35:02 -07:00
Marc Blank
d58a050dff am 630758ef: am 3558e5f2: Shut down Email process when sync is totally blocked
Merge commit '630758ef898964814072467454bea615d31fc4ff' into kraken

* commit '630758ef898964814072467454bea615d31fc4ff':
  Shut down Email process when sync is totally blocked
2010-05-06 16:31:10 -07:00
Marc Blank
3558e5f227 Shut down Email process when sync is totally blocked
* When sync threads get blocked by SSL/Socket code, we detect this
  and shutdown the ClientConnectionManager, hoping this will solve
  the problem.
* Apparently, this doesn't always work.  The result is that syncs
  are frozen until the device is rebooted (certainly) or until the
  Email process is stopped and restarted (hopefully)
* This CL kills the Email process after an unsuccessful attempt to
  clear blocked threads using ClientConnectionManager.shutdown()

Bug: 2615293
Change-Id: I8445b278817e508a855adeb88d6b2f969d28858b
2010-05-06 15:03:33 -07:00
Marc Blank
fcd18d94d5 am 801368ac: am 9e8fef57: am 2b3bbb69: Fix NPE in SyncManager 2010-05-06 12:45:52 -07:00
Marc Blank
a32e063036 am ab4daabd: am 8f255dde: Merge "Add checks for Event validity before commit" into froyo
Merge commit 'ab4daabd5ec99da549407ce87d46e24be261c4a6' into kraken

* commit 'ab4daabd5ec99da549407ce87d46e24be261c4a6':
  Add checks for Event validity before commit
2010-05-06 12:43:16 -07:00
Marc Blank
801368ac4b am 9e8fef57: am 2b3bbb69: Fix NPE in SyncManager
Merge commit '9e8fef57a5967a0056100921a294f464669c394d' into kraken

* commit '9e8fef57a5967a0056100921a294f464669c394d':
  Fix NPE in SyncManager
2010-05-06 12:37:50 -07:00
Marc Blank
8f255ddeee Merge "Add checks for Event validity before commit" into froyo 2010-05-06 08:49:48 -07:00
Marc Blank
33f07963eb Add checks for Event validity before commit
* Enforce CalendarProvider2's requirements for valid Events
* Add unit tests for the new code
* Backport of change I42ad7acb from master
Bug: 2658149

Change-Id: I8151d035247a7dbb1fda3eae163b24ccfe055299
2010-05-06 08:28:34 -07:00
Marc Blank
2b3bbb6948 Fix NPE in SyncManager
Bug: 2660742
Change-Id: I80ec62a0e128b3f20873a718d951e41f3fa2eb90
2010-05-06 07:05:26 -07:00
Marc Blank
bc1a4753b1 Add checks for Event validity before committing
* Enforce CalendarProvider2's requirements for valid Events
* Add unit tests for the new code

Bug: 2658149
Change-Id: I42ad7acbcee3b6b831f805c59436017a32651f3a
2010-05-05 18:16:16 -07:00
Andy Stadler
2c4e1a0c9c am 3ed0674a: am 8fd23c5b: am 48d2621b: Merge "Fix GAL lookup issue" into froyo 2010-05-03 09:36:30 -07:00
Andrew Stadler
b0c37bd8c0 am 1e037acd: am 7cdd6899: am a7628f3b: Merge "Better handling for untyped attachments" into froyo 2010-05-03 09:36:28 -07:00
Makoto Onuki
9d2b44d473 am eaf1139c: am a094cc25: am cf362a48: Collectly preserve the service start-id. 2010-05-03 09:36:26 -07:00
Andy Stadler
3ed0674ace am 8fd23c5b: am 48d2621b: Merge "Fix GAL lookup issue" into froyo
Merge commit '8fd23c5b49325766620ba78f79ca708c7649bf7f' into kraken

* commit '8fd23c5b49325766620ba78f79ca708c7649bf7f':
  Fix GAL lookup issue
2010-05-03 09:34:05 -07:00
Andrew Stadler
1e037acda7 am 7cdd6899: am a7628f3b: Merge "Better handling for untyped attachments" into froyo
Merge commit '7cdd6899fbe820af852974cd0b7025b72bfe242a' into kraken

* commit '7cdd6899fbe820af852974cd0b7025b72bfe242a':
  Better handling for untyped attachments
2010-05-03 09:34:02 -07:00
Makoto Onuki
eaf1139c6c am a094cc25: am cf362a48: Collectly preserve the service start-id.
Merge commit 'a094cc259da268ad6f78f50afe5cbbf674418b86' into kraken

* commit 'a094cc259da268ad6f78f50afe5cbbf674418b86':
  Collectly preserve the service start-id.
2010-05-03 09:33:56 -07:00
Andy Stadler
48d2621b45 Merge "Fix GAL lookup issue" into froyo 2010-05-03 07:25:15 -07:00
Andrew Stadler
a7628f3bc0 Merge "Better handling for untyped attachments" into froyo 2010-05-03 07:22:00 -07:00
Marc Blank
cb7ac76f0b Fix GAL lookup issue
Bug: 2646410
Change-Id: I52b0ddf4b7c6b56b3ad060d8d42a6080efa3662b
2010-05-02 13:51:35 -07:00
Andrew Stadler
e82438b6bd am 683812e1: am 01cc30c9: am 14812a50: Workaround for IllegalArgumentException in SyncManager 2010-04-30 15:08:06 -07:00
Marc Blank
a0cc4cd01a am 6f6c082d: am 3f0d3a43: am 47a59d88: Merge "Fix issues with incorrect email replies to event organizer" into froyo 2010-04-30 15:07:51 -07:00
Marc Blank
7d5986aa04 am 017aeb6d: am c9f92395: am 468fe91d: Prevent account reconcile from running when service is down 2010-04-30 15:07:48 -07:00
Andrew Stadler
80ebde2897 Better handling for untyped attachments
* IMAP/POP rely on sender to set mime type of attachments
* Which doesn't always work, because senders don't always provide it
* Remap using filename extensions, when needed
* This is applied as late as possible - in the MessageView, and in
  the content provider getType().  No changes to how we write databases,
  and no change to existing attachment rows.

Bug: 2356638
Change-Id: Ie69e3fd12f406aac803583f9d1299a8af4fba010
2010-04-30 15:01:10 -07:00
Makoto Onuki
cf362a48c1 Collectly preserve the service start-id.
We were passing the wrong arguments, which caused the service left running.

Bug 2646212

Change-Id: Ie5aeaeb80635c8e805fc2e9c6f4aec3b21942740
2010-04-30 14:41:47 -07:00
Andrew Stadler
683812e1ff am 01cc30c9: am 14812a50: Workaround for IllegalArgumentException in SyncManager
Merge commit '01cc30c9d8327c6172036c1e15455d305423c718' into kraken

* commit '01cc30c9d8327c6172036c1e15455d305423c718':
  Workaround for IllegalArgumentException in SyncManager
2010-04-30 12:46:00 -07:00
Andrew Stadler
14812a50a8 Workaround for IllegalArgumentException in SyncManager
* There is a race condition in which the AccountManager listener
  isn't properly unregistered when SyncManager is shut down
* In this case, SyncManager tries to register a new listener
  (i.e. registering again), which causes an IllegalArgumentException
* The quick workaround is simply to catch and ignore this exception,
  as it's really more of a warning than a true error
* A bug will be filed for the underlying issue

Bug: 2631561
Change-Id: I139d24ae045d402d4d8cb006406ef96ccc768566
2010-04-30 12:39:08 -07:00
Marc Blank
6f6c082d97 am 3f0d3a43: am 47a59d88: Merge "Fix issues with incorrect email replies to event organizer" into froyo
Merge commit '3f0d3a437d10bd63c0f9260a853d5b43d973c8df' into kraken

* commit '3f0d3a437d10bd63c0f9260a853d5b43d973c8df':
  Fix issues with incorrect email replies to event organizer
2010-04-30 12:07:24 -07:00
Marc Blank
47a59d883f Merge "Fix issues with incorrect email replies to event organizer" into froyo 2010-04-30 12:04:34 -07:00
Marc Blank
017aeb6dc1 am c9f92395: am 468fe91d: Prevent account reconcile from running when service is down
Merge commit 'c9f923959eb7987db4f12dc7e2a1103e600d9eeb' into kraken

* commit 'c9f923959eb7987db4f12dc7e2a1103e600d9eeb':
  Prevent account reconcile from running when service is down
2010-04-30 11:55:44 -07:00
Marc Blank
468fe91dd8 Prevent account reconcile from running when service is down
Bug: 2644142
Change-Id: Ia6ccf7371bc08b3b67ab3d0871f3618c5e5bd107
2010-04-30 11:43:40 -07:00
Marc Blank
92cb5d1dbe am 475b37f4: am 79ace451: am 09f0ab04: Merge "Fix NPE in SyncManager" into froyo 2010-04-30 11:33:33 -07:00
Makoto Onuki
7446a41fbd am 0a06a1a6: am 4a1565fd: am 5ab7ec71: Move a bare string to a resource. 2010-04-30 11:33:31 -07:00
Marc Blank
475b37f49d am 79ace451: am 09f0ab04: Merge "Fix NPE in SyncManager" into froyo
Merge commit '79ace45187236afc736c60bc0a0e70f284bce36b' into kraken

* commit '79ace45187236afc736c60bc0a0e70f284bce36b':
  Fix NPE in SyncManager
2010-04-30 11:29:35 -07:00
Makoto Onuki
0a06a1a683 am 4a1565fd: am 5ab7ec71: Move a bare string to a resource.
Merge commit '4a1565fd7ec426ba4615aedeb3f2ddcb03ecac22' into kraken

* commit '4a1565fd7ec426ba4615aedeb3f2ddcb03ecac22':
  Move a bare string to a resource.
2010-04-30 11:29:32 -07:00
Marc Blank
d2c773a806 Fix issues with incorrect email replies to event organizer
* We were previously storing the user's attendee status in the
  SYNC_ADAPTER_DATA column of the Event, but it turns out that
  this data isn't available in the Entity we retrieve when
  uploading changes to the server
* The result is that we often thought the user's status had
  changed when in fact it had not; in these cases, we sent email
  to the organizer, often with the wrong information.
* As of this CL, we store the user's attendee status in an
  ExtendedProperties row (these values are already exposed in event
  entities)
* The logic otherwise remains the same; we now get correct data,
  however

Bug: 2638762
Change-Id: Ibe8db90c16b4ca06203f77fd010aa26dde89a556
2010-04-30 10:52:18 -07:00
Marc Blank
09f0ab0454 Merge "Fix NPE in SyncManager" into froyo 2010-04-30 10:39:30 -07:00
Makoto Onuki
5ab7ec7123 Move a bare string to a resource.
Bug 2637666

Change-Id: I59cf5d2b30846604049d3f988b1003dd7d91ad6f
2010-04-30 09:21:04 -07:00
Marc Blank
3139d43ee2 Fix NPE in SyncManager
Bug: 2644142
Change-Id: I4336aef65669b7a4a32e43e8068edd4dd9772b03
2010-04-29 20:41:07 -07:00
Marc Blank
617eef466b am ba8dfde0: am 220d9107: am 8ba07285: Use timezone in exception ics files 2010-04-29 11:03:32 -07:00
Marc Blank
ba8dfde0c1 am 220d9107: am 8ba07285: Use timezone in exception ics files
Merge commit '220d9107535360b842f1a8ff872b2d22296d98b3' into kraken

* commit '220d9107535360b842f1a8ff872b2d22296d98b3':
  Use timezone in exception ics files
2010-04-29 10:51:25 -07:00
Marc Blank
8ba0728533 Use timezone in exception ics files
* Exchange seems to require time zone information in ics files containing
  event exceptions, although this is NOT the case for iCalendar, and appears
  not to conform to VCALENDAR specifications
* This causes exceptions to be placed on the wrong date or perhaps even
  ignored, depending on the circumstance
* This CL simply adds time zone information to all exception ics files

Bug: 2640878
Change-Id: Ibc614eb7a2c45e9e782b10be979d9892bbfc0029
2010-04-29 10:16:58 -07:00
Marc Blank
3630a70902 am 59c9add4: am 0d46f9f8: am 39e6d3ae: Fix concurrent modification exception 2010-04-29 09:45:46 -07:00
Marc Blank
59c9add49e am 0d46f9f8: am 39e6d3ae: Fix concurrent modification exception
Merge commit '0d46f9f87cb7540113c9a4f9903127cacb70d395' into kraken

* commit '0d46f9f87cb7540113c9a4f9903127cacb70d395':
  Fix concurrent modification exception
2010-04-29 09:38:47 -07:00
Marc Blank
39e6d3aed0 Fix concurrent modification exception
* Synchronize recently added call to releaseMailbox on sSyncLock

Bug: 2639210
Change-Id: Iaa1f2ed7cdc9cc0c306363487095ac5ccd02f9a3
2010-04-28 22:49:23 -07:00
Marc Blank
2ee98bee7b am 230dc853: am 8048f0fe: am 8917e52d: Fix regression that prevents calendar sync w/ new accounts 2010-04-28 18:39:41 -07:00
Marc Blank
230dc85390 am 8048f0fe: am 8917e52d: Fix regression that prevents calendar sync w/ new accounts
Merge commit '8048f0fef89c6d0cda8538cd5fe5103bf11cc2a9' into kraken

* commit '8048f0fef89c6d0cda8538cd5fe5103bf11cc2a9':
  Fix regression that prevents calendar sync w/ new accounts
2010-04-28 18:34:29 -07:00
Marc Blank
8917e52db0 Fix regression that prevents calendar sync w/ new accounts
* The regression is caused by a check on whether the calendar is
  syncable, as determined by the status of the Calendar (via
  CalendarProvider2).
* Unfortunately, if there IS no calendar, we were disallowing sync,
  which prevents the calendar from being created in the first place

Bug: 2619755
Change-Id: I1e94a129413bdbe9bc9bfb3608d3ca95f23d8dfb
2010-04-28 15:27:11 -07:00
Marc Blank
caa65ed0de am 5a957fc9: am 7e8315c0: am b7f57f25: Remove STOPSHIP debug code 2010-04-28 10:08:10 -07:00
Marc Blank
5a957fc91a am 7e8315c0: am b7f57f25: Remove STOPSHIP debug code
Merge commit '7e8315c018edd545cc7ed1ef560a03e623a71a5d' into kraken

* commit '7e8315c018edd545cc7ed1ef560a03e623a71a5d':
  Remove STOPSHIP debug code
2010-04-28 10:03:04 -07:00
Marc Blank
77cc5f3383 am 7aa9e1e0: am 773dc43c: am b5bf09a5: Merge "Allow more time for HttpPost watchdog timeout" into froyo 2010-04-28 09:52:17 -07:00
Marc Blank
5e7ddbf584 am 504bd426: am 8ed23be0: am f7369ad5: Merge "Shutdown all connections when sync service is hung" into froyo 2010-04-28 09:52:16 -07:00
Andy Stadler
1bfe167734 am 656d89d6: am 78d3c602: am b915c3c0: Merge "Skip security check when account id is unknown." into froyo 2010-04-28 09:52:13 -07:00
Marc Blank
b7f57f25ea Remove STOPSHIP debug code
Bug: 2638014
Change-Id: I10a7ac89cce68ae1db146eb9bed574c00386ba62
2010-04-28 09:48:40 -07:00
Marc Blank
7aa9e1e0ac am 773dc43c: am b5bf09a5: Merge "Allow more time for HttpPost watchdog timeout" into froyo
Merge commit '773dc43cc2caf7638c610ac85711eed89a06efa5' into kraken

* commit '773dc43cc2caf7638c610ac85711eed89a06efa5':
  Allow more time for HttpPost watchdog timeout
2010-04-28 09:43:23 -07:00
Marc Blank
504bd426c8 am 8ed23be0: am f7369ad5: Merge "Shutdown all connections when sync service is hung" into froyo
Merge commit '8ed23be08f34ba11e5bf0acd98d1419df893a0bc' into kraken

* commit '8ed23be08f34ba11e5bf0acd98d1419df893a0bc':
  Shutdown all connections when sync service is hung
2010-04-28 09:43:21 -07:00
Andy Stadler
656d89d67f am 78d3c602: am b915c3c0: Merge "Skip security check when account id is unknown." into froyo
Merge commit '78d3c6022ccf87566261faf694ff506a68ec6b6f' into kraken

* commit '78d3c6022ccf87566261faf694ff506a68ec6b6f':
  Skip security check when account id is unknown.
2010-04-28 09:43:18 -07:00
Marc Blank
b5bf09a56d Merge "Allow more time for HttpPost watchdog timeout" into froyo 2010-04-27 23:25:15 -07:00
Marc Blank
f7369ad51f Merge "Shutdown all connections when sync service is hung" into froyo 2010-04-27 23:17:41 -07:00
Marc Blank
8f9e872eaf Allow more time for HttpPost watchdog timeout
* The current timeout is triggering more often than it should, which
  causes delays and inefficiency.  Increase it from 10 to 30 seconds.

Bug: 2615293
Change-Id: I54b74cc7ad9f1c8286af49b957584670c071640c
2010-04-27 23:13:32 -07:00
Marc Blank
2341e096e6 Shutdown all connections when sync service is hung
* When a sync thread receives an alarm due to a missed socket timeout
  on an HttpPost, we try to abort the HttpPost.
* At times, however, the HttpPost cannot be aborted and the thread
  hangs indefinitely.
* In this CL, we try to break this vicious cycle by shutting down our
  ClientConnectionManager when this case is detected.  This should, in
  turn, close all of our socket connections, causing the sync threads
  to generate IOExceptions and terminate.
* After appropriate IOException waits, new sync threads should then be
  able to run normally.

Bug: 2615293
Change-Id: Idea6c3653cd60822d6260e0c5a7dad790ee25858
2010-04-27 22:49:50 -07:00
Marc Blank
7c6975e168 am f0ef73dd: am 29270f38: am 422ceb0e: Merge "Don\'t enable calendar sync if sync_events is disabled" into froyo 2010-04-27 18:56:07 -07:00
Makoto Onuki
e333b68c9e Skip security check when account id is unknown.
Doing the check caused:
   IllegalArgumentException: Unknown URI content://com.android.email.provider/account/-1
       at com.android.email.provider.EmailProvider.query(EmailProvider.java:1092)
       at android.content.ContentProvider$Transport.query(ContentProvider.java:163)
       at android.content.ContentResolver.query(ContentResolver.java:245)
       at com.android.email.activity.MessageList.isSecurityHold(MessageList.java:1146)

Bug 2635060

Change-Id: I80e7c00ef2dd74ceae24a88daf43a0681124a9d4
2010-04-27 17:28:39 -07:00
Marc Blank
f0ef73dd82 am 29270f38: am 422ceb0e: Merge "Don\'t enable calendar sync if sync_events is disabled" into froyo
Merge commit '29270f382389b8370f56941ca2209bfe11c5c6f3' into kraken

* commit '29270f382389b8370f56941ca2209bfe11c5c6f3':
  Don't enable calendar sync if sync_events is disabled
2010-04-27 12:06:24 -07:00
Marc Blank
422ceb0efd Merge "Don't enable calendar sync if sync_events is disabled" into froyo 2010-04-27 11:59:33 -07:00
Marc Blank
f62f4afff1 Don't enable calendar sync if sync_events is disabled
* When SyncManager starts up, it reconciles the AccountManager sync settings
  with its own
* This works for Contacts, but Calendar has a second setting that needs to be
  checked - the sync_events column in the Calendar table (in CalendarProvider2)
* Before turning on Calendar sync, we now check this second setting; if
  sync_events is 0, we won't re-enable Calendar sync

Bug: 2619755
Change-Id: Iea6c99dce228d2c111a529a6c9b865ed1577b19e
2010-04-26 13:25:48 -07:00
Marc Blank
6b594cc97b am a238577c: am d718abd3: am b62cbc7e: Increase service call timeout to 45 seconds 2010-04-26 11:20:02 -07:00
Marc Blank
3c39402e4a am f714fcc9: am cebb801a: am da71abeb: Improve sync thread alerting mechanism 2010-04-26 11:19:59 -07:00
Marc Blank
abd581582c am 7d1f082c: am 17733f22: am 0f686768: Merge "Fix upsync of DAILY rrule with UNTIL" into froyo 2010-04-26 11:19:55 -07:00
Marc Blank
90e69be84a am c5fb4298: am aaa9c6a4: am d8d3719f: Tweak NAT timeout behavior 2010-04-26 11:19:53 -07:00
Marc Blank
a238577cb7 am d718abd3: am b62cbc7e: Increase service call timeout to 45 seconds
Merge commit 'd718abd38c12a902b85ba6341c4eda1c778d68b7' into kraken

* commit 'd718abd38c12a902b85ba6341c4eda1c778d68b7':
  Increase service call timeout to 45 seconds
2010-04-26 11:10:23 -07:00
Marc Blank
f714fcc952 am cebb801a: am da71abeb: Improve sync thread alerting mechanism
Merge commit 'cebb801ace0f2622430df88758485e6509f5fbf6' into kraken

* commit 'cebb801ace0f2622430df88758485e6509f5fbf6':
  Improve sync thread alerting mechanism
2010-04-26 11:10:21 -07:00
Marc Blank
7d1f082c5a am 17733f22: am 0f686768: Merge "Fix upsync of DAILY rrule with UNTIL" into froyo
Merge commit '17733f228ec131900acd7e5ff883bb0150025c42' into kraken

* commit '17733f228ec131900acd7e5ff883bb0150025c42':
  Fix upsync of DAILY rrule with UNTIL
2010-04-26 11:10:19 -07:00
Marc Blank
c5fb42984e am aaa9c6a4: am d8d3719f: Tweak NAT timeout behavior
Merge commit 'aaa9c6a4d18c07bd36cb259bc6031b360586baba' into kraken

* commit 'aaa9c6a4d18c07bd36cb259bc6031b360586baba':
  Tweak NAT timeout behavior
2010-04-26 11:10:16 -07:00
Marc Blank
52ab04a805 am ad7060ae: am f1fa44bd: am 2f1ce56f: Merge "Fix upload/download of attendee status" into froyo 2010-04-26 10:11:52 -07:00
Marc Blank
9d0fa303c8 am 5b25478b: am b11ea045: am 7cb5e144: Merge "Add checks for null in SyncManager" into froyo 2010-04-26 10:11:43 -07:00
Marc Blank
b62cbc7e7b Increase service call timeout to 45 seconds
Bug: 2627273
Change-Id: I971aa271cfc03e669e72f7871856cb9cfc10aa14
2010-04-26 08:14:01 -07:00
Marc Blank
da71abeb8f Improve sync thread alerting mechanism
* When a sync thread triggers an alarm by failing to return from
  an HttpPost beyond the socket timeout, we call abort() on the
  HttpPost to force it to stop
* It appears that there are cases in which this is insufficient,
  and the thread remains hung in a blocked state
* The result of this failure is to prevent the syncing mailbox from
  ever syncing again, and is typically seen by a failure to receive
  new mail (as reported in the referenced bug)
* In this CL, we add code to wait for 10 seconds after calling the
  abort() method.  If the HttpPost is still hung, we interrupt() the
  thread, and have SyncManager release the Mailbox, so that another
  thread can be started.

Bug: 2615293
Change-Id: I6a48195fc68bb950126006326a5b30448d3bbb63
2010-04-26 07:06:56 -07:00
Marc Blank
0f68676828 Merge "Fix upsync of DAILY rrule with UNTIL" into froyo 2010-04-25 20:27:54 -07:00
Marc Blank
47d124e4a1 Fix upsync of DAILY rrule with UNTIL
* Make sure we send UNTIL with FREQ=DAILY as appropriate
* Also to help debug this in the future...
    Add logging capability to utilities via SyncManager
    Add public log methods so that CalendarUtilities can log properly
    Change Log.d's to SyncManager.log in CalendarUtilities

Bug: 2623787
Change-Id: I3d651f00a3f7522e25c8d6e389469770c733953f
2010-04-24 13:05:16 -07:00
Marc Blank
d8d3719f34 Tweak NAT timeout behavior
* Change "broken pipe" behavior to simply run through the ping loop
  again, rather than be treated as a NAT timeout

Bug: 2615293
Change-Id: I67c3200f148a8c2beda58f812c29af8a726a4b9c
2010-04-24 10:39:06 -07:00
Marc Blank
ad7060ae18 am f1fa44bd: am 2f1ce56f: Merge "Fix upload/download of attendee status" into froyo
Merge commit 'f1fa44bdc064a6c01813c5380839b90bd0290d46' into kraken

* commit 'f1fa44bdc064a6c01813c5380839b90bd0290d46':
  Fix upload/download of attendee status
2010-04-23 17:27:10 -07:00
Marc Blank
5b25478b0c am b11ea045: am 7cb5e144: Merge "Add checks for null in SyncManager" into froyo
Merge commit 'b11ea045e994d80c49d0a80ca08582554a1c5823' into kraken

* commit 'b11ea045e994d80c49d0a80ca08582554a1c5823':
  Add checks for null in SyncManager
2010-04-23 17:24:37 -07:00
Marc Blank
2f1ce56fc8 Merge "Fix upload/download of attendee status" into froyo 2010-04-23 17:21:41 -07:00
Marc Blank
7cb5e144e7 Merge "Add checks for null in SyncManager" into froyo 2010-04-23 17:19:32 -07:00
Andrew Stadler
5f1fdc2111 am f6e5f6e3: am da0fb178: am 5ac8a35c: Merge "Fix uncommanded exit from MessageList with 2+ accounts" into froyo 2010-04-23 13:41:34 -07:00
Andrew Stadler
f6e5f6e395 am da0fb178: am 5ac8a35c: Merge "Fix uncommanded exit from MessageList with 2+ accounts" into froyo
Merge commit 'da0fb1784c7675841cd64cb7c19020491667872f' into kraken

* commit 'da0fb1784c7675841cd64cb7c19020491667872f':
  Fix uncommanded exit from MessageList with 2+ accounts
2010-04-23 13:36:09 -07:00
Andrew Stadler
5ac8a35c42 Merge "Fix uncommanded exit from MessageList with 2+ accounts" into froyo 2010-04-23 13:30:48 -07:00
Marc Blank
e06a6dae37 am 169e3378: am 819de68b: am de3ae172: Merge "Add additional test for likely NAT timeout" into froyo 2010-04-23 12:56:17 -07:00
Marc Blank
169e33789b am 819de68b: am de3ae172: Merge "Add additional test for likely NAT timeout" into froyo
Merge commit '819de68b01ec9f8d44e4fa1e16bf4900abf90b16' into kraken

* commit '819de68b01ec9f8d44e4fa1e16bf4900abf90b16':
  Add additional test for likely NAT timeout
2010-04-23 12:49:23 -07:00
Marc Blank
de3ae17246 Merge "Add additional test for likely NAT timeout" into froyo 2010-04-23 12:42:30 -07:00
Andrew Stadler
88fb7f7cd0 Fix uncommanded exit from MessageList with 2+ accounts
* When you have 2 or more accounts configured, MessageList gets confused.
* If you are viewing a mailbox from account A, and account B does a
  background sync, MessageList gets confused by the reports coming back
  from the Controller.  It gives up and returns to the Accounts list.
* This change adds a check for the current account and ignores the
  MessageList updates if we weren't actually waiting for them.
* To test the positive case for this code (make sure we didn't break it),
  verify that the inbox on an IMAP account is displayed properly
  immediately after you add it.

Bug: 2619513
Change-Id: Ib31254b4099ba6b7922b06d42e2b7928551e4fb2
2010-04-23 12:17:43 -07:00
Marc Blank
bc27894815 Add additional test for likely NAT timeout
* This prevents unnecessary delays in receiving push mail
* At present, there is a likely 5 minute delay on receiving new pushed
  mail on the network displaying the behavior we're testing for

Bug: 2615293
Change-Id: Ic42e576fa683790f96434fcbad5ee873d0730f6d
2010-04-23 10:53:21 -07:00
Marc Blank
8a19af3739 Fix upload/download of attendee status
* It turns out that the UI uses selfAttendeeStatus and the attendee's status
  from the Attendees table in confusing and undocumented ways
* selfAttendeeStatus is used in the UI, but only in certain cases. Generally speaking,
  the Attendees table status is definitive.  However, when the user sets his status
  from the UI, this data is reflected in the event's selfAttendeeStatus, since for EAS,
  the user is always the owner of his calendar
* On downsync,  we'll put the user's busy status into the Attendees table
* On upsync, we'll send busy status based on the user's attendee status in the
  Attendees table
* We'll use selfAttendeeStatus only to determine whether the user has manually changed
  his status via the UI (as before)

Bug: 2615586
Change-Id: I3a82474cfd07cbf5aa595e5214807cb55005cefa
2010-04-23 09:07:53 -07:00
Marc Blank
f44b9440d8 Add checks for null in SyncManager
Bug: 2619723
Change-Id: Iea3c3258274bdf86784e232922290841ad0d9d36
2010-04-22 17:43:30 -07:00
Makoto Onuki
92db71e440 Merge "Send local IP address with EHLO instead of "localhost"." 2010-04-22 14:23:46 -07:00
Marc Blank
0acd7e9c77 am d764ce7e: am 1880ad6a: Send correct busy status information in upsyncs to EAS
Merge commit 'd764ce7e4442b0027a891582cbdd728487a49f97' into kraken

* commit 'd764ce7e4442b0027a891582cbdd728487a49f97':
  Send correct busy status information in upsyncs to EAS
2010-04-22 13:23:55 -07:00
Makoto Onuki
f4dac9f266 Send local IP address with EHLO instead of "localhost".
Bug 1515345

Change-Id: I181c9f0d79fbdf62f7df77f72a1ec9653797b6dd
2010-04-22 11:23:08 -07:00
Marc Blank
1880ad6a83 Send correct busy status information in upsyncs to EAS
* Fix unit test that was failing

Bug: 2615382
Change-Id: I54c7bdd982d57528f55ce4f4c6804c9f532293fb
2010-04-21 18:25:16 -07:00
Andrew Stadler
d729ff891a am 151b9aa8: am 5d5d7854: Harden UpgradeAccounts against runtime errors (e.g. NPE)
Merge commit '151b9aa8dff6350c9e247579599bf70e1c55eea1' into kraken

* commit '151b9aa8dff6350c9e247579599bf70e1c55eea1':
  Harden UpgradeAccounts against runtime errors (e.g. NPE)
2010-04-21 18:19:27 -07:00
Andrew Stadler
5d5d7854c2 Harden UpgradeAccounts against runtime errors (e.g. NPE)
* Harden each of the major upgrade steps so any errors (e.g. NPE) are
  caught and that account goes into error state.
* Make sure that any account in error state is abandoned properly - all
  steps skipped except the final delete/cleanup.
* Bugfix: The variable that indicates that an account has gone into an
  error state (upgrade failed) state was being set in the UI thread and
  tested in the worker thread, so it was not properly stopping the
  upgrade of any given account.  Split that variable into two, one for the
  UI thread (set/read by the handler) and one for the worker thread.
* Bugfix: Report errors against the correct account, when 2+ accounts are
  being upgraded.

Bug: 2608483
Change-Id: I571078ae7123b601b53096104c4c5f4ef20da031
2010-04-21 16:27:09 -07:00
Marc Blank
fc08120213 am a0c71419: am 21c04fe3: Merge "Further harden getListOrNull" into froyo
Merge commit 'a0c71419cedaa0f84d12da61e415642b79cc0a9c' into kraken

* commit 'a0c71419cedaa0f84d12da61e415642b79cc0a9c':
  Further harden getListOrNull
2010-04-21 08:18:04 -07:00
Marc Blank
21c04fe31c Merge "Further harden getListOrNull" into froyo 2010-04-21 08:10:14 -07:00
Marc Blank
07fb9f8bea Further harden getListOrNull
* Add a bounds check
* Add a test for ImapList

Bug: 2611022
Change-Id: I3ad88fbc8d3145298731ab19ef7ff68d4011bb00
2010-04-20 19:31:29 -07:00
Marc Blank
7fef3f620d am 9c85a39b: am bb11c911: Fix NPE sending mail on servers without Outbox folders
Merge commit '9c85a39b82d0691f3c057dc00dbab87a2b68452e' into kraken

* commit '9c85a39b82d0691f3c057dc00dbab87a2b68452e':
  Fix NPE sending mail on servers without Outbox folders
2010-04-20 11:56:37 -07:00
Marc Blank
bb11c91175 Fix NPE sending mail on servers without Outbox folders
* stopPing (in SyncManager) assumes that every mailbox has a serverId
  but this is not the case on some servers, in which case we hit an
  NPE during a check for the account mailbox
* Check for a null serverId when testing for the account mailbox

Bug: 2606385
Change-Id: Idfa8abd8ef9e2c0a2ac01d0b168a21c934f6fdf3
2010-04-19 21:19:49 -07:00
Marc Blank
36d6817cb5 am 51a54f84: am 075d3494: Add admin check before trying a remote wipe
Merge commit '51a54f84f158cd9c18960170197f74a56b54fcd1' into kraken

* commit '51a54f84f158cd9c18960170197f74a56b54fcd1':
  Add admin check before trying a remote wipe
2010-04-19 11:43:21 -07:00
Marc Blank
075d34947f Add admin check before trying a remote wipe
* The code assumed that if we asked for a remote wipe, that it would
  be executed.  This isn't the case, however, if we're not a device
  admin at that time
* Test for Email app as device administrator before trying remote wipe

Bug: 2603931
Change-Id: I09dcff00e77bcf1e40c742c9dee923e6e07eecae
2010-04-18 23:08:28 -07:00
Marc Blank
6c1971f825 am 5e80b90e: am a90bb03c: Merge "Use METHOD_ALERT instead of METHOD_DEFAULT for reminders" into froyo
Merge commit '5e80b90e399b70c6dd93ddd7f5b66279277cf861' into kraken

* commit '5e80b90e399b70c6dd93ddd7f5b66279277cf861':
  Use METHOD_ALERT instead of METHOD_DEFAULT for reminders
2010-04-17 15:00:56 -07:00
Marc Blank
a90bb03c25 Merge "Use METHOD_ALERT instead of METHOD_DEFAULT for reminders" into froyo 2010-04-17 14:54:55 -07:00
Marc Blank
f749f77a81 am 6d09bd24: am 17e8ba7e: Merge "Speed up provision notification after security failure" into froyo
Merge commit '6d09bd247b0b5bf48a88bafc2ef28e25d0148bb7' into kraken

* commit '6d09bd247b0b5bf48a88bafc2ef28e25d0148bb7':
  Speed up provision notification after security failure
2010-04-16 18:23:33 -07:00
Marc Blank
17e8ba7eda Merge "Speed up provision notification after security failure" into froyo 2010-04-16 18:16:17 -07:00
Marc Blank
849ba0285c Use METHOD_ALERT instead of METHOD_DEFAULT for reminders
* Exchange has been using METHOD_DEFAULT for reminders, but it turns out
  that this doesn't work.
* Changed to use METHOD_ALERT

Bug: 2604156
Change-Id: Ia76bb2fc150202de9c49af9ab8caf86c9bda775f
2010-04-16 17:48:14 -07:00
Marc Blank
64bd62f46f am 401ae927: am a8f7b3e1: Store all day events w/ UTC timezone
Merge commit '401ae927e62a237f76c7dd1dde83f4ff8f27be91' into kraken

* commit '401ae927e62a237f76c7dd1dde83f4ff8f27be91':
  Store all day events w/ UTC timezone
2010-04-16 16:37:09 -07:00
Marc Blank
a8f7b3e16e Store all day events w/ UTC timezone
* All day events are supposed to be stored w/ UTC as the time zone
* We already zero out hour, minute, and day
* Use DTEND for non-recurring and DURATION for recurring all day events

Bug: 2440161
Change-Id: I31f2e5a355b721c06b4022b57ccc8a29b288a5d9
2010-04-16 15:11:43 -07:00
Marc Blank
23a88a8044 Speed up provision notification after security failure
Bug: 2591899
Change-Id: I038e0b96f03c7dd24e11ee36f3c9464c84fb2930
2010-04-16 14:36:55 -07:00
Marc Blank
5ff98ba1ec am 825999f8: am 095eee41: Set selfAttendeeStatus and busyStatus properly on downsync/upsync
Merge commit '825999f815979519d8d80334a8c1ce0223a89ef2' into kraken

* commit '825999f815979519d8d80334a8c1ce0223a89ef2':
  Set selfAttendeeStatus and busyStatus properly on downsync/upsync
2010-04-16 13:55:04 -07:00
Marc Blank
095eee4156 Set selfAttendeeStatus and busyStatus properly on downsync/upsync
* Set selfAttendeeStatus on download from busy status
* Set busyStatus on upload from selfAttendeeStatus

Bug: 2587076

Change-Id: I34eaa0d3861bcec0cbfd51761b31965e44f5162b
2010-04-16 13:39:51 -07:00
Andrew Stadler
901c23032b am a126a168: am ce592f32: Merge "Remove incorrect error reporting in MessageList" into froyo
Merge commit 'a126a168b6d70143e6cc94531f20ff889b15357b' into kraken

* commit 'a126a168b6d70143e6cc94531f20ff889b15357b':
  Remove incorrect error reporting in MessageList
2010-04-15 15:14:20 -07:00
Andrew Stadler
ce592f32f9 Merge "Remove incorrect error reporting in MessageList" into froyo 2010-04-15 15:08:12 -07:00
Andrew Stadler
54607e872d Remove incorrect error reporting in MessageList
* Previously I added a call to updateBanner() during the sequence where
    we update the mailboxlist (searching for the requested mailbox to
    display.)  This was an attempt to provide some error information
    for certain corner case security configuration problems.
* This was misfiring during legitimate connections (specifically, initial
    sync of valid EAS accounts) and causing a Connection Error message
    when none was intended.
* Rather than continue hacking, I'm simply removing the error banner
    from updateMailboxList.
* This is essentially a direct rollback of change
    c98b64c801, although I've added
    a bit more commentary than there was originally.
* The long-term solution, rather than continue band-aiding this, is to
    move most of this logic into a service independent of the UI, and
    provide more organized error reporting.

Bug: 2585159
Bug: 2599377
Change-Id: I99b7b1c8a7cfaa3fd3ff9b578d5721f05133d88a
2010-04-15 14:53:56 -07:00
Marc Blank
ce2e1260bc am b8ef8a2c: am a97d8501: Merge "Properly decode a uid from the globalObjId in invites" into froyo
Merge commit 'b8ef8a2c1d18421a7d537dbc8d1ea88ffca95898' into kraken

* commit 'b8ef8a2c1d18421a7d537dbc8d1ea88ffca95898':
  Properly decode a uid from the globalObjId in invites
2010-04-15 13:48:03 -07:00
Marc Blank
a97d85014f Merge "Properly decode a uid from the globalObjId in invites" into froyo 2010-04-15 13:41:04 -07:00
Marc Blank
7e30b2e22f Properly decode a uid from the globalObjId in invites
* Meeting invitations in EAS include a globalObjId.  It turns out
  that this id is EITHER the actual uid (if Exchange created it)
  or a wrapper for the actual uid (if some other client created it)
* To find out which case we're dealing with, we have to look at
  the base64 decoded string for the magic "vCal-Uid" substring
* If it's there, we pull the real uid out of the decoded string
* Otherwise, we build a hex strong from the decoded bytes
* Write unit test for this process

Bug: 2598201
Change-Id: I1cc40af6d1e45be44c19465eb8a4c31851ec8157
2010-04-15 13:12:40 -07:00
Andrew Stadler
fa6d2b7b61 am 1bf66bb8: am 186aa619: Cleanup probable causes of close cursor access
Merge commit '1bf66bb8fcb4fcb74706d8e0917b7ac9f62d6710' into kraken

* commit '1bf66bb8fcb4fcb74706d8e0917b7ac9f62d6710':
  Cleanup probable causes of close cursor access
2010-04-15 00:22:49 -07:00
Andrew Stadler
186aa619dc Cleanup probable causes of close cursor access
* Monkey is hitting this fairly often
* Multiple fixes that are all good
  * We were launching LoadAccountsTask twice
  * Don't use a managed cursor for the inner accounts cursor - always
      close it manually by calling changeCursor(null) and letting the
      MergeCursor handle its sub-cursors.
  * Add isCancelled() check
  * When replacing adapter, be sure to close cursor

Bug: 2524465
Change-Id: I2309e033d65430810f2856285c1fa9bf2f8fb5e3
2010-04-14 23:51:35 -07:00
Andrew Stadler
0b589c403a am a55d27ba: am 3b3b5b0f: Run the account reconciler every time we start SyncManager
Merge commit 'a55d27bae112429348090be7fa262d7acc1b69e8' into kraken

* commit 'a55d27bae112429348090be7fa262d7acc1b69e8':
  Run the account reconciler every time we start SyncManager
2010-04-14 22:53:17 -07:00
Makoto Onuki
6f83fe6317 am ad383ff1: am d2a0d233: Use consistent device-id even the device is wiped.
Merge commit 'ad383ff1231319c6ded4077b0d1415bf77bec70b' into kraken

* commit 'ad383ff1231319c6ded4077b0d1415bf77bec70b':
  Use consistent device-id even the device is wiped.
2010-04-14 22:22:18 -07:00
Andrew Stadler
3b3b5b0f2b Run the account reconciler every time we start SyncManager
* This takes care of *some* of the race conditions where the
  account DB is blown away but the Email app is not running, so we
  don't get any notification of a change;  We have to try and
  sort this out early.
* SyncManager is started by Welcome, so this catches many cases of
  entering the email app.

Bug: 2567986
Change-Id: I76bea5b636802ba5c1677d8b1825fb3c61f7b2d9
2010-04-14 22:18:14 -07:00
Makoto Onuki
d2a0d23380 Use consistent device-id even the device is wiped.
Use hash of device id (TelephonyManager.getDeviceId()) instead of a random
value.

Bug 2596537

Change-Id: I22303f7287ee6e9edccec349d03f14adbd33f6f7
2010-04-14 21:39:18 -07:00
Andrew Stadler
16fa3af652 am bd9f4ab3: am 79ef52cf: Improve handling of UI reset cases
Merge commit 'bd9f4ab329b4d01493c84b3d93d678c9d5a594fe' into kraken

* commit 'bd9f4ab329b4d01493c84b3d93d678c9d5a594fe':
  Improve handling of UI reset cases
2010-04-14 20:36:26 -07:00
Andrew Stadler
79ef52cfb3 Improve handling of UI reset cases
* When account disappears (e.g. delete from Accounts & Sync) the Welcome
   activity should launch with FLAG_ACTIVITY_CLEAR_TOP to remove any
   stacked activities as well.
* When account disappears entering AccountSetupNames, don't fall out
   of Eas Flow Mode.
* Followup to 5e354cd1db

Bug: 2563998
Change-Id: Ifbe086e26205bb28c2514f84cb28e839888b1eb0
2010-04-14 19:16:46 -07:00
Andrew Stadler
8249155e42 am 1ec609e9: am 694fe3b0: Merge "Safer error handling in AccountNames" into froyo
Merge commit '1ec609e99e00957788f4cb5d1965b9d4659f46ff' into kraken

* commit '1ec609e99e00957788f4cb5d1965b9d4659f46ff':
  Safer error handling in AccountNames
2010-04-14 17:50:25 -07:00
Andrew Stadler
694fe3b0c7 Merge "Safer error handling in AccountNames" into froyo 2010-04-14 17:42:55 -07:00
Andrew Stadler
fa669234be Safer error handling in AccountNames
The error handling for (mAccount == null) would crash.  Use a simpler
path here and just abandon the setup process.

The root cause of this (the account being null) is probably solved
by 3ae84b247d, but still a good idea to
clean this up.

Bug: 2558344
Change-Id: I3167234f99e9d39844f2b56a4d94f25465c7c269
2010-04-14 17:41:28 -07:00
Makoto Onuki
cda014c16e am 8dffa087: am 162b0171: Change account colors to what aren\'t used in Calendar.
Merge commit '8dffa087db44e27e5f0e5672b19fdb6975e614a7' into kraken

* commit '8dffa087db44e27e5f0e5672b19fdb6975e614a7':
  Change account colors to what aren't used in Calendar.
2010-04-14 16:30:27 -07:00
Marc Blank
dd18cfa62a am 82e43ff2: am d8a4e4d2: Merge "Don\'t allow Exchange logger to recurse on failure" into froyo
Merge commit '82e43ff284eac3767f38e81bf15188021581a8e1' into kraken

* commit '82e43ff284eac3767f38e81bf15188021581a8e1':
  Don't allow Exchange logger to recurse on failure
2010-04-14 16:30:25 -07:00
Makoto Onuki
162b017140 Change account colors to what aren't used in Calendar.
Bug 2535090

Change-Id: I252e04afa402303d226a56f1d7852f50dc26e2ec
2010-04-14 15:18:12 -07:00
Marc Blank
d8a4e4d25d Merge "Don't allow Exchange logger to recurse on failure" into froyo 2010-04-14 14:29:21 -07:00
Andrew Stadler
f14da10df8 am dc283b1b: am 5e354cd1: Exit most activities when accounts are deleted
Merge commit 'dc283b1b399da1543d57b8eae8ffcbc72f1deca0' into kraken

* commit 'dc283b1b399da1543d57b8eae8ffcbc72f1deca0':
  Exit most activities when accounts are deleted
2010-04-14 12:10:17 -07:00
Andrew Stadler
e2be72d390 am f9890942: am 383b7dd2: Merge "Final cleanup for account provisioning failures" into froyo
Merge commit 'f9890942bc4a61d14d65f38a16a8bb53bc979880' into kraken

* commit 'f9890942bc4a61d14d65f38a16a8bb53bc979880':
  Final cleanup for account provisioning failures
2010-04-14 12:10:15 -07:00
Marc Blank
da86f04c77 am 595ebceb: am 3fdaa329: Only set ORIGINAL_INSTANCE_TIME in exceptions
Merge commit '595ebcebfaf937434dd797f0423819dae147b0d6' into kraken

* commit '595ebcebfaf937434dd797f0423819dae147b0d6':
  Only set ORIGINAL_INSTANCE_TIME in exceptions
2010-04-14 12:10:12 -07:00
Andrew Stadler
5e354cd1db Exit most activities when accounts are deleted
This resolves cases like this:  You are in the inbox of an Exchange
account.  You click home, settings, accounts & sync, and you delete
the account.  Now re-enter the Email app.  You'll be left in a strangely
empty inbox, for an account that no longer exists.

* Set a flag any time the reconciler deletes an account
* Check that flag in onResume of any activity that depends on the account
    list and could be left in an "empty" state if account(s) are deleted.
* The Activities in which we check it are:
  * AccountFolderList
  * AccountSettings
  * MailboxList
  * MessageCompose
  * MessageList
  * MessageView
* Clear the flag any time we come in through Welcome, which will dispatch
    to other activities properly based on the number of accounts found.

Bug: 2563998
Change-Id: I00fc542581c2bed92d744a4c2e48a88f83737f11
2010-04-14 09:28:04 -07:00
Andrew Stadler
383b7dd29d Merge "Final cleanup for account provisioning failures" into froyo 2010-04-14 09:14:33 -07:00
Marc Blank
3fdaa32969 Only set ORIGINAL_INSTANCE_TIME in exceptions
* We were setting this for all events, but apparently CalendarProvider
  does not approve, and generates warnings
* Only set this for exceptions

Bug: 2550631
Change-Id: I8a7152eb0d4233432b1a5b5664da964d5433fbae
2010-04-14 08:41:38 -07:00
Marc Blank
3180ada550 am 1205deec: am 627006a8: Fix issue with deleted recurrence
Merge commit '1205deececdb99a23b45434568fac71fe3d50b8f' into kraken

* commit '1205deececdb99a23b45434568fac71fe3d50b8f':
  Fix issue with deleted recurrence
2010-04-14 08:39:13 -07:00
Andrew Stadler
c98b64c801 Final cleanup for account provisioning failures
* Now that we get proper callbacks on updateMailboxListCallback(),
    show the error banner if there's a problem
* Follow-on to 63186a5442

Bug: 2585159
Change-Id: I2b4f365d02b639bc3ceff9f8938333185d5ba693
2010-04-13 23:49:24 -07:00
Marc Blank
c89e1a8616 Don't allow Exchange logger to recurse on failure
Bug: 2594331
Change-Id: Ie5de4ac11259e5be30d4bf9812164823b9ca46ae
2010-04-13 20:34:13 -07:00
Marc Blank
e49a1e4b8b am 58f7daac: am c07cd159: Merge "Try a longer timeout for initial sync" into froyo
Merge commit '58f7daac64a105f0607bf0cf64dba9d2ad523b31' into kraken

* commit '58f7daac64a105f0607bf0cf64dba9d2ad523b31':
  Try a longer timeout for initial sync
2010-04-13 20:27:02 -07:00
Marc Blank
627006a8e3 Fix issue with deleted recurrence
* It turns out that this bug is due to a bad rebase/merge for a previous CL
  in which the changed code appears in its new form AND old form
* Fixes change SHA c3aa318200 (CL 48406)
* Don't say it.

Bug: 2587775
Change-Id: I3f70a97e498db30345452b942909448049680fdf
2010-04-13 19:50:51 -07:00
Marc Blank
c07cd159d4 Merge "Try a longer timeout for initial sync" into froyo 2010-04-13 19:35:19 -07:00
Marc Blank
3093b61668 Try a longer timeout for initial sync
* We are still seeing an issue with at least one user on initial
  calendar sync.
* Increase the read timeout a great deal for initial sync, as it
  can a very long time for the server to respond

Bug: 2569162
Change-Id: I495c38dc58d9a80c5a21e40b6fc5d165d10a3c1a
2010-04-13 18:27:58 -07:00
Makoto Onuki
040f0e3c48 am 77275817: am 0f3d3601: Merge "Show device id on the exchange setting screen." into froyo
Merge commit '772758177e3dd4fcb1c9d534afec3007b59c8bf7' into kraken

* commit '772758177e3dd4fcb1c9d534afec3007b59c8bf7':
  Show device id on the exchange setting screen.
2010-04-13 17:32:00 -07:00
Makoto Onuki
0f3d36010d Merge "Show device id on the exchange setting screen." into froyo 2010-04-13 17:28:02 -07:00
Makoto Onuki
12b4bc9e80 Show device id on the exchange setting screen.
I've attached a screenshot on the referenced bug.

Also fixed a bug in SyncManager.getDeviceId() where sDeviceId cache wasn't
working.

Bug 2591124

Change-Id: I4b58517c095a96d47fb57179d70091b2c7af5249
2010-04-13 17:10:26 -07:00
Marc Blank
b19fd96eb2 am 77f820dc: am 0005eba7: Fix cancellation messages for deleted attendee
Merge commit '77f820dc0d120cfe28fc8a26bdc69ade92d68e5a' into kraken

* commit '77f820dc0d120cfe28fc8a26bdc69ade92d68e5a':
  Fix cancellation messages for deleted attendee
2010-04-13 15:11:12 -07:00
Marc Blank
0005eba750 Fix cancellation messages for deleted attendee
* We weren't sending a proper ics file for the deleted attendee, and
  this caused Exchange to send a message to the wrong people (the
  referenced bug)
* Split out code that adds attendees to outgoing mail
* Changed the optional last argument to createMessageForX to be a specified
  attendee, i.e. the only addressee to be used for the message

Bug: 2548465
Change-Id: I629fcfaffe621408ea460d42c9c7c283929f7e79
2010-04-13 13:37:51 -07:00
Marc Blank
4621489f99 am 14495c05: am 63186a54: Send callback if reloadFolderList fails w/ uninit\'ed account
Merge commit '14495c05f69db71311002b077280782ed4154fc4' into kraken

* commit '14495c05f69db71311002b077280782ed4154fc4':
  Send callback if reloadFolderList fails w/ uninit'ed account
2010-04-13 11:54:26 -07:00
Andrew Stadler
f02238ed2e am cccfb846: am a87f8d8b: Changes to improve security policy setup
Merge commit 'cccfb8464ed8c2221b70b61151ecd77945299d06' into kraken

* commit 'cccfb8464ed8c2221b70b61151ecd77945299d06':
  Changes to improve security policy setup
2010-04-13 11:53:44 -07:00
Marc Blank
63186a5442 Send callback if reloadFolderList fails w/ uninit'ed account
Bug: 2585159
Change-Id: I12d9dd84090d10675e3d403124e28dbb6bede3d8
2010-04-13 10:44:00 -07:00
Andrew Stadler
a87f8d8bbc Changes to improve security policy setup
* SecurityPolicy:  Fix bug that prevents any notifications after the
    user hits "cancel all" from the notification pane.
* AccountSecurity: If the user cancels the device admin acceptance
    activity, repost the notification.
* MesageList:  Catch security hold condition when entering a mailbox, and
    launch security setup activity.

Bug: 2585159
Change-Id: I60d5d8c693cc5f00fe98a9cc69265802f5bee813
2010-04-13 02:15:37 -07:00
Marc Blank
cdc53cc4b2 am 1c9a47a4: am 0cd062eb: Merge "Fix acknowledgment of Exchange remote wipe" into froyo
Merge commit '1c9a47a424698ae899975afa1e0fe724545038f6' into kraken

* commit '1c9a47a424698ae899975afa1e0fe724545038f6':
  Fix acknowledgment of Exchange remote wipe
2010-04-12 18:03:48 -07:00
Marc Blank
0cd062ebd0 Merge "Fix acknowledgment of Exchange remote wipe" into froyo 2010-04-12 17:59:40 -07:00
Marc Blank
2f194cefbb Fix acknowledgment of Exchange remote wipe
* The XML acknowledging the wipe was malformed

Bug: 2589695
Change-Id: I24428a21ce5b08f32c372dcbb50b24d6e6c42645
2010-04-12 17:48:17 -07:00
Marc Blank
a29e5e60da am 9edec647: am de302226: Always check serverId AND calendarId in queries
Merge commit '9edec6478cbb3cd3720077acfaaa950160eea128' into kraken

* commit '9edec6478cbb3cd3720077acfaaa950160eea128':
  Always check serverId AND calendarId in queries
2010-04-12 16:53:33 -07:00
Marc Blank
de30222689 Always check serverId AND calendarId in queries
* With multiple accounts, serverId's are not guaranteed to be unique
  (indeed, they rarely are)
* There were two queries in CalendarSyncAdapter that checked only
  serverId and this has caused the referenced bug PLUS others that
  would have turned up later on
* This is a critical fix

Bug: 2589815
Change-Id: I49bc6cb5bb4708f4bf4ca60a891ff78f0b25e989
2010-04-12 16:37:50 -07:00
Marc Blank
61ea18298e am c388bf66: am b5253606: Merge "Sync description with exceptions" into froyo
Merge commit 'c388bf66775e7979a1fd372964ef9ee7908e3b0d' into kraken

* commit 'c388bf66775e7979a1fd372964ef9ee7908e3b0d':
  Sync description with exceptions
2010-04-12 15:57:53 -07:00
Marc Blank
b5253606ee Merge "Sync description with exceptions" into froyo 2010-04-12 15:53:50 -07:00
Marc Blank
d1c1b505f4 am 95c071bc: am 1e3f86df: Merge "Increase timeouts for Exchange sync; prevent early upload sync" into froyo
Merge commit '95c071bc6322a0ddd0491099b57ec8224d894f2f' into kraken

* commit '95c071bc6322a0ddd0491099b57ec8224d894f2f':
  Increase timeouts for Exchange sync; prevent early upload sync
2010-04-12 14:50:19 -07:00
Marc Blank
1e3f86dfd4 Merge "Increase timeouts for Exchange sync; prevent early upload sync" into froyo 2010-04-12 14:42:44 -07:00
Marc Blank
e3df9f95ea Sync description with exceptions
* We weren't sending up the event description with exceptions, so
  changes to description were being lost on upload
* Move the code uploading description so that it happens with
  exceptions as well as top-level events

Bug: 2590020
Change-Id: Ifab556bed68671f3ee8cab02b657adbd8ba9c50c
2010-04-12 14:22:11 -07:00
Marc Blank
2e22263777 Increase timeouts for Exchange sync; prevent early upload sync
* It's reported that 50% of third party users have issues syncing
  Calendar in Exchange
* In testing, it was determined that the server takes > 30 seconds
  to respond to a sync request initially, which is beyond our timeout
  limit
* Also, I found that the system SyncManager was trying to trigger an
  upload sync at the same time (i.e. before the sync session was
  established with the server)
* There are four changes here:
  1) Prevent upload syncs while the sync key is null or "0" ("0"
     is the initial state)
  2) Increase timeout for connection; at worst, this will
     cause a short extra delay in syncs with a bad connection, but this
     will be unnoticable to users
  3) Increase the read timeout for initial sync to twice that of
     regular syncs (the initial sync always seems to take longer)
  3) Reduce the lookback for calendar to two weeks (from one month);
     this is a better default anyway, and it probably reduces the server
     and client load a great deal
* Empirically, this solves the bug for a known completely repeatable
  case.

Bug: 2569162
Change-Id: I36b1c3e1e0b65f50d42e05f1830fed912191651f
2010-04-12 13:59:04 -07:00
Makoto Onuki
9c88c1ff3c am b0690302: am 1fe0aa19: Merge "Set CLEAR_WHEN_TASK_RESET flag when launching Calendar" into froyo
Merge commit 'b0690302bfc486ae76002179de11df0537090c30' into kraken

* commit 'b0690302bfc486ae76002179de11df0537090c30':
  Set CLEAR_WHEN_TASK_RESET flag when launching Calendar
2010-04-12 13:31:43 -07:00
Makoto Onuki
1fe0aa19bf Merge "Set CLEAR_WHEN_TASK_RESET flag when launching Calendar" into froyo 2010-04-12 13:27:15 -07:00
Makoto Onuki
f793cd93b9 Set CLEAR_WHEN_TASK_RESET flag when launching Calendar
and Contacts, so that when you relaunch Email from Home, you always see
the Email app, not Calendar/Contacts.

Note as stated in the corresponding bug, this CL itself won't fix the issue,
because CLEAR_WHEN_TASK_RESET will be lost when Contacts/Calendar apps handle
the intent.
There's a feature request against the framework (bug 2586404) which should fix
this losing flag problem.

Bug 2584792

Change-Id: I34ac3707b99926fc07529ea2229f2a6b3c4f93e4
2010-04-12 13:09:56 -07:00
Andrew Stadler
ead786d9b5 am ef01261a: am 9cc6f46b: Merge "Try TOP even on POP servers that fail to report CAPA" into froyo
Merge commit 'ef01261a8909ea3fe3e40b06cc537e0032d47898' into kraken

* commit 'ef01261a8909ea3fe3e40b06cc537e0032d47898':
  Try TOP even on POP servers that fail to report CAPA
2010-04-12 11:33:04 -07:00
Andrew Stadler
9cc6f46b05 Merge "Try TOP even on POP servers that fail to report CAPA" into froyo 2010-04-12 11:27:25 -07:00
Andrew Stadler
645fc28301 Try TOP even on POP servers that fail to report CAPA
* Ignore the results of CAPA and always try TOP
* If TOP returns -ERR simply fall back to (bad old slow) RETR
* Unit tests for positive & failure cases

Bug: 2588432
Change-Id: Ife4b551217de1025e14efc46074f16ef4ae99c6f
2010-04-12 10:56:55 -07:00
Marc Blank
8f76feabe2 am ab99976d: am c3aa3182: Send email to organizer if attendee deletes event/exception
Merge commit 'ab99976d18de5b2ac57d26808296ba5d966cea8d' into kraken

* commit 'ab99976d18de5b2ac57d26808296ba5d966cea8d':
  Send email to organizer if attendee deletes event/exception
2010-04-12 10:29:34 -07:00
Marc Blank
c3aa318200 Send email to organizer if attendee deletes event/exception
* There are two cases, event and exception and both are fixed in this CL

Bug: 2587775
Change-Id: Id325c4877a77074ca6edd4d7fbeb54971d4cf984
2010-04-12 10:12:46 -07:00
Marc Blank
f362d0357c am dc0f9ee7: am 536a3655: Merge "Always add changed exceptions to the upload list" into froyo
Merge commit 'dc0f9ee7ed36947414b37bb8d303f6ca0b768a8a' into kraken

* commit 'dc0f9ee7ed36947414b37bb8d303f6ca0b768a8a':
  Always add changed exceptions to the upload list
2010-04-12 10:04:19 -07:00
Marc Blank
536a36555b Merge "Always add changed exceptions to the upload list" into froyo 2010-04-12 09:57:57 -07:00
Marc Blank
c5c5bf7da7 Always add changed exceptions to the upload list
* We were adding deleted exceptions to the "deleted" list; this is bad,
  because the exception then gets deleted from the database after the
  sync.  The symptom is that the deleted exception reappears on the
  calendar.

Bug: 2587837
Change-Id: If497f82ba0b2b817d1cef6165ded23d19876528f
2010-04-11 15:33:39 -07:00
Marc Blank
4b07f049b3 am 605433f7: am 3b19278a: Only allow the account mailbox to attempt provisioning
Merge commit '605433f78dfacc6c634c6313832c9e1f475bcd99' into kraken

* commit '605433f78dfacc6c634c6313832c9e1f475bcd99':
  Only allow the account mailbox to attempt provisioning
2010-04-11 11:58:53 -07:00
Marc Blank
65ff1aeb60 am 6155bc2b: am 6a4eae5f: Fix upload of multi-day all day events
Merge commit '6155bc2b10316b5257692b2e4c540c24f5f49836' into kraken

* commit '6155bc2b10316b5257692b2e4c540c24f5f49836':
  Fix upload of multi-day all day events
2010-04-11 09:49:06 -07:00
Marc Blank
3b19278a24 Only allow the account mailbox to attempt provisioning
* We were allowing all sync services to attempt provisioning, but this
  could potentially lead to a race condition in which two different
  policy keys are created on the server (this is speculative)
* Change to allow only the account mailbox to attempt provisioning
* Log policy keys when verbose exchange logging is enabled
* We'll see if this solves the referenced bug

Bug: 2569162
Change-Id: I36c60098a4866882a8f9f4c288da54ea378d9aee
2010-04-11 09:45:49 -07:00
Marc Blank
6a4eae5f41 Fix upload of multi-day all day events
* We were assuming a single day for all-day events
* Use the actual end date
* Make sure we send date/time back to server in local TZ
* Also fixes #2500863

Bug: 2578776
Change-Id: I58767a574248935b9840ce93e634a24e54abe62f
2010-04-10 18:03:39 -07:00
Andrew Stadler
459199c93d am ddc5dd3f: am 80bd83fd: Upsync appropriate organizer name/email
Merge commit 'ddc5dd3fe0cde3e03a053e1d2b6a06822a4b30b7' into kraken

* commit 'ddc5dd3fe0cde3e03a053e1d2b6a06822a4b30b7':
  Upsync appropriate organizer name/email
2010-04-10 17:42:59 -07:00
Andrew Stadler
80bd83fd85 Upsync appropriate organizer name/email
* We need to send name & email for Exchange 2007
* For Exchange 2003, only name & email if the event is new

Bug: 2586661
Change-Id: Ia35c2c7a645a3d20b7031e9a43b8b5044a40f005
2010-04-10 17:35:34 -07:00
Andrew Stadler
e588bec8c9 am 13cc0023: am 06699c0d: Send meeting status with all upsynced changes
Merge commit '13cc00239e958647312b26deae7e62e3c4b27fdf' into kraken

* commit '13cc00239e958647312b26deae7e62e3c4b27fdf':
  Send meeting status with all upsynced changes
2010-04-10 17:31:18 -07:00
Andy Stadler
51c864d56c am 6445efb6: am 7d32ec27: Merge "Check for active device admin before each ping loop" into froyo
Merge commit '6445efb6497348f4fc0b2c7ca5c78634626dfa3f' into kraken

* commit '6445efb6497348f4fc0b2c7ca5c78634626dfa3f':
  Check for active device admin before each ping loop
2010-04-10 17:26:43 -07:00
Andy Stadler
4929b7fdaa am 66473998: am 69757c66: Merge "Synchronize getAccountById on sAccountList" into froyo
Merge commit '66473998027f5d93c652653f58dc4ea73e462a55' into kraken

* commit '66473998027f5d93c652653f58dc4ea73e462a55':
  Synchronize getAccountById on sAccountList
2010-04-10 17:26:41 -07:00
Marc Blank
114dfb269d am 7ac1a975: am 0cd9cbf0: Add organizer to Attendees before handling exceptions
Merge commit '7ac1a975c470f1a41e589e2a223467bf564fafc9' into kraken

* commit '7ac1a975c470f1a41e589e2a223467bf564fafc9':
  Add organizer to Attendees before handling exceptions
2010-04-10 17:26:38 -07:00
Andrew Stadler
06699c0d91 Send meeting status with all upsynced changes
* Meeting status differentiates between appointments and meetings,
  which is important in Outlook and OWA
* Fix older, completely incorrect code for upsyncing categories

Bug: 2586071
Change-Id: I277252ef2c31e5b8ec7ceda69c229f5fd100ecdb
2010-04-10 17:24:23 -07:00
Andy Stadler
7d32ec27ec Merge "Check for active device admin before each ping loop" into froyo 2010-04-10 17:18:35 -07:00
Andy Stadler
69757c6670 Merge "Synchronize getAccountById on sAccountList" into froyo 2010-04-10 17:17:56 -07:00
Marc Blank
2769c06b3d Check for active device admin before each ping loop
* Accounts that require security need to check that the Email app
  is still an active device admin from time to time
* Add a check for this before each run of the ping loop

Bug: 2583282
Change-Id: I1491821b7d0c1a341b1fe7ef1002c8b21aed12c2
2010-04-10 16:59:15 -07:00
Marc Blank
ff958286f1 am c89e3462: am 232b2dd9: Merge "Handle exception deletion properly" into froyo
Merge commit 'c89e34624492e43fb8d403e0321df648248d9fcc' into kraken

* commit 'c89e34624492e43fb8d403e0321df648248d9fcc':
  Handle exception deletion properly
2010-04-10 11:41:54 -07:00
Makoto Onuki
bd9444b0c2 am aab0d339: am 17a18d64: Merge "Fix NPE caused by I34451000" into froyo
Merge commit 'aab0d339da9605339695c85da2bc81cdc2d6bb08' into kraken

* commit 'aab0d339da9605339695c85da2bc81cdc2d6bb08':
  Fix NPE caused by I34451000
2010-04-10 11:41:52 -07:00
Marc Blank
3ab4a99679 Synchronize getAccountById on sAccountList
* This fixes a ConcurrentModificationException seen in monkey
  testing

Bug: 2586524
Change-Id: I3634678218827d5cffeef20c154b3826f9e5f36f
2010-04-10 10:30:41 -07:00
Marc Blank
0cd9cbf088 Add organizer to Attendees before handling exceptions
* Exceptions take a copy of Attendees when they are created, but
  we weren't adding the organizer to Attendees before exceptions
  were parsed
* Fix this by adding the organizer just before exception parsing
* If there aren't any exceptions, we add the organizer as before

Bug: 2585817
Change-Id: Ie894682977e38a55d975135c8fc2fd8f2d4b1365
2010-04-10 09:58:50 -07:00
Marc Blank
232b2dd9dc Merge "Handle exception deletion properly" into froyo 2010-04-09 16:08:22 -07:00
Marc Blank
1b2ed80da7 Handle exception deletion properly
* First, make sure we catch the cases of DELETED=1 and eventStatus=cancelled
* Second, only send email updates if the user is the organizer

Bug: 2583054
Change-Id: I886efa0f28931dc815bc31d4d6adb3d700f83c6b
2010-04-09 14:02:35 -07:00
Makoto Onuki
17a18d644a Merge "Fix NPE caused by I34451000" into froyo 2010-04-09 10:32:23 -07:00
Marc Blank
00ea1390ec am ce3aabde: am 66bbd95a: Merge "Fix GAL lookup for provisioned EAS accounts" into froyo
Merge commit 'ce3aabde3a590345e2e6f29d419455432966c643' into kraken

* commit 'ce3aabde3a590345e2e6f29d419455432966c643':
  Fix GAL lookup for provisioned EAS accounts
2010-04-08 22:41:41 -07:00
Marc Blank
e33e9d7a1b am 8ee5858c: am f2b733de: Merge "Fix auto-send of invites when attendee status changes" into froyo
Merge commit '8ee5858cb820dec68a4c266cdeb46172654901a3' into kraken

* commit '8ee5858cb820dec68a4c266cdeb46172654901a3':
  Fix auto-send of invites when attendee status changes
2010-04-08 22:41:39 -07:00
Marc Blank
66bbd95a01 Merge "Fix GAL lookup for provisioned EAS accounts" into froyo 2010-04-08 17:29:00 -07:00
Marc Blank
b6cbf52656 Fix auto-send of invites when attendee status changes
* Use AS_SYNC_ADAPTER flag when changing attendee information in
  downsyncs
* Allow DTSTAMP to come before new attendee information in the case
  in which only attendees are changing
* Add _SYNC_DATA of "0" for all newly synced events

Bug: 2582513
Change-Id: Iacde0ddf3f2a99d108e00ef1991edfc34613f5c7
2010-04-08 17:26:06 -07:00
Marc Blank
ea816ef206 Fix GAL lookup for provisioned EAS accounts
Bug: 2582551
Change-Id: I316a2f9105ae4c693c401ad5e79922f4de1881b6
2010-04-08 17:05:11 -07:00
Makoto Onuki
78e06eb894 Fix NPE caused by I34451000
It's unfortunate but some of the fields we cleared in I34451000 are accessed
in BG threads or after the activity is destroyed.  We could add != null checks
everywhere, but it'll be a mess.  I also think it's safer to simply remove
the "= null" lines.

On the other hand, clearing AsyncTasks are relatively safer because they are
kept only so that we can cancel them afterwards, so I kept them.  But let me
know if you want to revert the original CL.

Bug 2570603

Change-Id: I04a10dd7382bfcceb686c3e9af92f8949caf619e
2010-04-08 11:57:26 -07:00
Andrew Stadler
5f95d68288 am 3839dc98: Merge "Improve MIME & SMTP compliance on outbound messages" into froyo
Merge commit '3839dc981f15bb7da5e7500ee175485dc85a6f6a' into kraken

* commit '3839dc981f15bb7da5e7500ee175485dc85a6f6a':
  Improve MIME & SMTP compliance on outbound messages
2010-04-08 10:03:11 -07:00
Andrew Stadler
3839dc981f Merge "Improve MIME & SMTP compliance on outbound messages" into froyo 2010-04-08 09:57:01 -07:00
Andrew Stadler
6bcccf6284 Improve MIME & SMTP compliance on outbound messages
* Write MIME-Version: 1.0 in all outbound messages, not just those
  with multiparts.  This is required by RFC 2045.
* Unit tests

Bug: 1678296
Change-Id: Icf37d93b8b0150f490791792499865a60744adea
2010-04-07 21:46:15 -07:00
Marc Blank
1939abc170 am 60ee2059: Merge "Fix bug #2551196" into froyo
Merge commit '60ee2059634a4191d999a837519eb406e02a57ec' into kraken

* commit '60ee2059634a4191d999a837519eb406e02a57ec':
  Fix bug #2551196
2010-04-07 17:03:49 -07:00
Marc Blank
60ee205963 Merge "Fix bug #2551196" into froyo 2010-04-07 16:57:25 -07:00
Marc Blank
0cf741bb0a Fix bug #2551196
* Handle the case in which a Mailbox to be synced doesn't have
  a serverId (rare case which happened to a Zimbra user)
* Tweak logging to improve debugability of similar issues

Bug: 2551196
Change-Id: Id61cee5c4b33eb2f87455fbae0899fec8ff3748f
2010-04-07 15:57:00 -07:00
Makoto Onuki
24c2faec32 am 59cf1d05: Clear references to inner classes in onDestroy().
Merge commit '59cf1d05c111e3b5fb18417db41ce47b623b5b1e' into kraken

* commit '59cf1d05c111e3b5fb18417db41ce47b623b5b1e':
  Clear references to inner classes in onDestroy().
2010-04-07 12:09:14 -07:00
Makoto Onuki
59cf1d05c1 Clear references to inner classes in onDestroy().
Also
- Made inner classes private if possible.
- Made some members final.

Bug 2570603

Change-Id: I34451000f2540c67e1039ea9dc4839dbec5ffab7
2010-04-07 11:54:57 -07:00
Marc Blank
1dec3405f5 am c94c077a: Merge "Send busy_status = 2 on all upsync\'s" into froyo
Merge commit 'c94c077a668fe3eb78dfeec797a175571a47b1c6' into kraken

* commit 'c94c077a668fe3eb78dfeec797a175571a47b1c6':
  Send busy_status = 2 on all upsync's
2010-04-07 11:14:53 -07:00
Marc Blank
c94c077a66 Merge "Send busy_status = 2 on all upsync's" into froyo 2010-04-07 11:09:31 -07:00
Marc Blank
f1bbf05380 Send busy_status = 2 on all upsync's
* Right now, we only send this for 2.5 (where it's required)
* If we don't send this for 12.0 and later, the status will be
  set to "free", which is almost always going to be wrong
* So always send busy status = 2 (we can't know differently, as
  we don't track free/busy)

Bug: 2575611
Change-Id: I11d952b68ac0ef7a022b030037ce6408f72d4a90
2010-04-07 09:44:09 -07:00
Andrew Stadler
ae9f8aa86c am 856e09d7: Properly reset security policy when device admin revoked
Merge commit '856e09d76ab62272e660fd4a08e25637f17319a0' into kraken

* commit '856e09d76ab62272e660fd4a08e25637f17319a0':
  Properly reset security policy when device admin revoked
2010-04-07 09:41:37 -07:00
Andrew Stadler
73c38b8401 am be428797: Merge "Show a less-generic error message for security errors" into froyo
Merge commit 'be4287970b4218bbcd01955677117110eb1d1d03' into kraken

* commit 'be4287970b4218bbcd01955677117110eb1d1d03':
  Show a less-generic error message for security errors
2010-04-06 22:58:06 -07:00
Andrew Stadler
856e09d76a Properly reset security policy when device admin revoked
* Simplify the logic in the onDisabled() receiver.  Make sure
  security policy keys are *always* disabled.
* Eliminate unused variable and unused receiver.

Bug: 2576145
Change-Id: I3665a1d300edfb77e02737c08aee22bc977f4968
2010-04-06 22:56:26 -07:00
Andrew Stadler
be4287970b Merge "Show a less-generic error message for security errors" into froyo 2010-04-06 22:50:06 -07:00
Makoto Onuki
e2a076fdfd am af672452: Added a test for IMAP APPEND
Merge commit 'af6724527e564d35dd27ac35e24dbced554792e5' into kraken

* commit 'af6724527e564d35dd27ac35e24dbced554792e5':
  Added a test for IMAP APPEND
2010-04-06 14:43:22 -07:00
Makoto Onuki
af6724527e Added a test for IMAP APPEND
It's a preliminary change for IMAP bug fixes.

Also,
- Fixed a potential bug in ImapFolder.setFlags where it'd throw
  StringIndexOutOfBoundsException if flags is empty.

- Added a generic flag to proguard.flags so that now all methods with
  the "ForTest" sufix are automatically preserved.
  Turned out it wasn't needed for this CL, but it should come in handy
  someday.

Bug 2538076
Change-Id: I49a08afc196c7b7f1f30477dfc38ac5381045d84
2010-04-06 14:33:43 -07:00
Andrew Stadler
dc0753373e DO NOT MERGE. Handle STARTTLS when last line in EHLO response.
When receiving the EHLO response from the SMTP server, the multiline
answer has "-" prefix in all lines except the last line, where the
prefix is a blank. This is according to RFC 2821 section 4.2.1. This has
also been reported as issue 2309 at code.google.com.

Bug: 1744768

Change-Id: I3feccabed30767d2fa5b06352cd7d1c803e8d59c
2010-04-06 10:50:11 -07:00
Andrew Stadler
624af658ff Merge "Partial solution to make EAS setup respect "manual"" into froyo 2010-04-06 09:38:32 -07:00
Andrew Stadler
63ab9de1b8 Partial solution to make EAS setup respect "manual"
* Track whether the user clicked "manual" vs. clicking next (and falling
  into "manual" because the account is not found in the providers list.
  Convert this into an "allowAutoDiscover" parameter.
* Pass "allowAutoDiscover" down into AccountSetupAccountType and through
    into AccountSetupExchange.  (Note, it's unused/ignored for POP & IMAP
    accounts and should not affect them.)
* In AccountSetupExchange, use the existing EXTRA_DISABLE_AUTO_DISCOVER
    (previously only for testing) to suppress autodiscover in manual mode.

Bug: 2570919
Change-Id: I2583e00d1e6cc26bbd4b85134eddae8cc3a1f91e
2010-04-05 19:08:05 -07:00
Marc Blank
f7d9f65961 Merge "MessageView: on answering invitation move in only one direction." into froyo 2010-04-05 15:34:06 -07:00
Marc Blank
9991e71413 Fix remote wipe (which probably never worked)
Bug: 2567641
Change-Id: Iceeebbc5f5bb93d72ab349cc1c0a71c1bd5f5387
2010-04-05 12:36:12 -07:00
Marc Blank
0a3b5b0741 Add timeout/watchdog to autodiscover network calls
* Split out network operations w/ timeout and watchdog from send HttpClientPost
* Use this in autodiscover calls
* Add logging to help debug this issue, in case there are additional problems

Bug: 2568077
Change-Id: I2a2e1abca2c4dab02c8e04c304f67db2a7b4cb22
2010-04-04 12:18:25 -07:00
Andrew Stadler
605371e793 Show a less-generic error message for security errors
* In Controller, map EmailServiceStatus.SECURITY_FAILURE
    to MessagingException.SECURITY_POLICIES_REQUIRED
* In MessageList, map MessagingException.SECURITY_POLICIES_REQUIRED
    to string account_setup_failed_security

Bug report will be forwarded to next release to get a more specific
string with proper translation.

Bug: 2563988
Change-Id: Ia1e6e947e3c0c7e6bd37301de2ea8ef4d641ef14
2010-04-03 23:55:38 -07:00
Andrew Stadler
a843d40ba1 Improve handling of unsupported security policies
* If the server asks for more than we can support, don't throw
  and error from PolicySet creation.  Let isSupported() do that.
* Overlong password lengths cannot be supported and isSupported is false.
* Overlong timeouts & max wipes can be reduced to supported
  amount (this actually increases security) and isSupported is true.
* Clean up an obsolete comment
* Unit tests

Bug: 2567804
Change-Id: I2d664a7f2a315b9f9bdcb867fe2cd98f74de6f66
2010-04-02 22:05:12 -07:00
satok
abed4c04c9 Close Cursor onDestroy
Bug:2557401
- set Cursor of ListAdapter null

Change-Id: I7d762c4ccdf6165d748136f5cf0e15b4a36b24a7
2010-04-02 20:08:17 +09:00
Marc Blank
802459f4d8 Don't show "Where: " in invite text if there's no location
Bug: 2563275
Change-Id: I2e978bc46b2ef292d749138500b53d61aefc4672
2010-04-01 19:14:02 -07:00
Marc Blank
66a9b199a0 Merge "Fix NPE in resetVisibleLimits" into froyo 2010-04-01 17:08:30 -07:00
Marc Blank
79976209d7 Synchronize getSyncKey/setSyncKey in Calendar and Contacts sync
* When the sync state of Calendar/Contacts is changed, a number of observer calls
  are triggered.  In addition, we might have a running sync.
* The syncKey operations need to be synchronized, because we may otherwise
  inadvertently use stale data when syncing, which would cause symptoms
  as seen in the referenced bug

Bug: 2561864
Change-Id: I03db58fe01c45778d271fad34d8d4940edefe8fe
2010-04-01 17:07:02 -07:00
Marc Blank
f5c3db12de Fix NPE in resetVisibleLimits
* resetVisibleLimits can be called via BootReceiver, which isn't in the
  Email app process, so it can (and apparently did) get a RemoteException
* This causes the query to return null; we have to check for it or we
  get this NPE

Bug: 2564904
Change-Id: I4b75e3c74ac7d1276f609f2fc957afdaa8da2f64
2010-04-01 17:02:17 -07:00
Marc Blank
78021cbbf8 Don't add "Invitation: " to meeting invitations
* Turns out that most other clients omit this.
* This has the pleasing effect of fixing the referenced bug
* Update unit tests

Bug: 2561821
Change-Id: I39f7db7e05be590373cd5f3d9b23c7ee21bde4f7
2010-04-01 14:42:10 -07:00
Marc Blank
82701d7725 Only send meeting emails after upsync is confirmed finished
* We were queueing up emails during our upsync, but before the upsync
  was complete.  If there were connection issues, we could pile up
  multiple copies of the same message, each of which would eventually
  get sent out
* Fix is to simply queue up the outgoing mail and send it all after
  the sync operation is complete.

Bug: 2515975
Change-Id: Ide3eb2deb6e959d0637d28efabd613efb3c6e209
2010-04-01 12:24:24 -07:00
Marc Blank
cf274512ed Fix conversion of UNTIL date in RRULEs to EAS calendar dates
* Because we were sending these in the wrong format, upsynced changes
  were failing, with the result that both the original event and
  the "new" event (from the UNTIL date forward) remained in the calendar
* Fix is to send the proper format; unit test updated to reflect the
  change
* Also, we only send the date of an UNTIL, rather than the to-the-minute
  time; it turns out that EAS expects to see only a day for UNTIL.

Bug: 2561818
Change-Id: Ic4eacbe96c713d58c637386ceab2cf22ebe3c2d4
2010-04-01 10:13:00 -07:00
Marc Blank
1c48450c02 Fix the VCALENDAR we send with all day events
* We need to send date only (without time) in the VCALENDAR file for
  all-day events
* Add unit test for this case

Bug: 2561789
Change-Id: I33a43c7a248059c97482ca147a23af083744118a
2010-04-01 10:10:41 -07:00
Marc Blank
1b3166e84a Merge "Allow upsync of photo/note deletion for Exchange contacts" into froyo 2010-04-01 10:06:27 -07:00
Marc Blank
53031a59a6 Allow upsync of photo/note deletion for Exchange contacts
* Always send up something when upsyncing photo and note
  fields
* This allows the client to delete the data, as these fields
  are NOT deleted if skipped in an upsync (unlike other
  fields)

Bug: 2558998
Change-Id: I9c874432108eedd84a351918f818c32e6e579dd7
2010-04-01 10:05:01 -07:00
Marc Blank
700b373007 Send CANCEL method with meeting cancellations
* We should be sending CANCEL as the method with cancellations
* Fix this and update unit test

Bug: 2527606
Change-Id: I2b982e4bfd1dbc57660cf578702edf49584d2957
2010-03-31 17:44:23 -07:00
Marc Blank
3fc61de54f Make serializer logging respect user's debug setting
* We now check that the user has verbose debug logging on
  before spamming with serializer logging

Bug: 2561834
Change-Id: I5eda2ca5f16cde728b0febaa990d66fc99bb93a0
2010-03-31 14:41:13 -07:00
Marc Blank
a3235209b0 Move comment to correct spot
Change-Id: Iaa76f2b014dca3651e0d62122e5d0df533c6bc73
2010-03-31 11:47:24 -07:00
Marc Blank
3ae84b247d Fix race condition in Exchange account creation
* Now that observer code has been moved to worker threads, the order
  in which various pieces of account creation are executed has become
  indeterminate
* Because of this, our EasAccountsUpdatedListener could use a stale
  list of EmailProvider accounts when performing reconciliation with
  the AccountManager's list of accounts
* The fix is to ensure that EasAccountsUpdatedListener's worker thread
  causes the cached EmailProvider account list to be updated before
  calling the reconciliation method

Bug: 2558317
Change-Id: Ia94a8301845cf6c06f8efecd408eb237474f781a
2010-03-31 11:16:41 -07:00
Mihai Preda
e2c2d81c31 MessageView: on answering invitation move in only one direction.
Bug 2541925

Change-Id: I62b454069f8c20403f15e0b58e597963809f830d
2010-03-31 16:03:46 +02:00
Fred Quintana
1a66cf0056 some changes due to an API review
- make EntityIterator extend Iterator and thus not throw a
   RemoteException, instead converting it into a RuntimeException.
 - rename ActiveSyncInfo to SyncInfo
 - change getActiveSync to getCurrentSync
 - remove the accessors in SyncInfo and instead make the final
   fields publicly accessible

Change-Id: Id1a47bba27042de4c21451a91cc43fa70eb68ec6
http://b/issue?id=2553539
http://b/issue?id=2553541
2010-03-30 17:29:33 -07:00
Mike LeBeau
38e52ccc72 Fix build breakage caused by mblank in 47050.
Change-Id: Ic67fbc611c707a6ff4de558ca15e848f25b92728
2010-03-30 15:29:51 -07:00
Marc Blank
13e497dd40 Fix NPE in ImapStore.create
Bug: 2557382
Change-Id: Ia2135e332162b0ae9d0ab85fbcc532ead089e815
2010-03-30 12:43:28 -07:00
Marc Blank
a05114524a Merge "Changes to connectivity locking and sync holds" into froyo 2010-03-29 21:04:08 -07:00
Doug Zongker
6cec1104fe relocate android.util.base64.* -> android.util.*
b/2553469 - API REVIEW: android.util.base64

Change-Id: I5394427a8e2c94b87ca45a533e417f7088a69f8f
2010-03-29 13:23:39 -07:00
Marc Blank
d40af6c074 Changes to connectivity locking and sync holds
* Clean up some code related to connectivity locks and sync holds
* Add logging related to sync holds after we re-establish connectivity

Bug: 2551482

Change-Id: I1b1f03cc1428e25be90c5e60555adf9ab1bf3ab9
2010-03-29 12:53:44 -07:00
Marc Blank
31edb63c24 Merge "Add message text for invitation replies" into froyo 2010-03-29 12:08:14 -07:00
Marc Blank
a6e1f8d456 Add message text for invitation replies
* Updated unit test to make sure there's message text

Bug: 2548714
Change-Id: I70e05b72539ff9ba7d582a51421e5345aa6151e4
2010-03-29 12:07:09 -07:00
Marc Blank
e675d99cc2 Merge "Handle case of typed data with a null type" into froyo 2010-03-29 11:54:54 -07:00
Marc Blank
02a63da3c6 Merge "Fix sending of cancellations to uninvited guests" into froyo 2010-03-28 13:56:04 -07:00
Marc Blank
54585c9511 Fix sending of cancellations to uninvited guests
* Had to add an optional argument to the email creator for this case,
  since there may not be any remaining addressees to send to (if the
  only guest was uninvited)
* The optional argument forces the creation of a message, even if there
  are no addressees

Bug: 2548465
Change-Id: I88784f49ce7afedce331fc756c5ecef4e73a07bc
2010-03-28 13:54:33 -07:00
Marc Blank
a3ce319ed0 Merge "Check for dirty events in specified account before syncing" into froyo 2010-03-28 13:35:37 -07:00
Marc Blank
7fcb505913 Harden SyncManager against NPE's
* Fix a few cases in which we don't check that a mailbox still exists
  before acting

Bug: 2551196
Change-Id: Ie339d821630d84b30aa3a19898d42b784ec1a686
2010-03-28 12:18:03 -07:00
Marc Blank
229666e106 Check for dirty events in specified account before syncing
* We were starting a sync if there was a dirty event in ANY of
  our Exchange accounts
* Change to check for the specific account before syncing; this
  saves provider queries and service (i.e. thread) startups

Bug: 2550620
Change-Id: I83e953f1bade9fa269b777e96121a63664e8edc8
2010-03-27 10:59:55 -07:00
Marc Blank
729b5ca9ba Handle case of typed data with a null type
* There's an NPE if we downsync a contact containing a piece of
  typed data for which there is no type specified in the database
* Check for this and accept "no type" as a match

Bug: 2539843
Change-Id: I155b635a1f9850af9813681f502f3565c3cfcd4b
2010-03-26 17:50:50 -07:00
Marc Blank
d682138090 Merge "Synchronize access to our cached account list" into froyo 2010-03-26 16:09:10 -07:00
Marc Blank
bd841a779e Synchronize access to our cached account list
* The recent change that moves our account change handling out of the
  UI thread caused ConcurrentModificationException's during account
  creation
* We now synchronize all access to our cached account list to prevent
  this

Bug: 2546724
Change-Id: I92b2becedd36a335a81f7e3bd9617f2923e00e6c
2010-03-26 16:07:32 -07:00
Makoto Onuki
34cd4cadf3 Merge "Properly handle old style (<= 1.6) account shortcuts." into froyo 2010-03-26 14:59:44 -07:00
Marc Blank
4b4e00e4ce Fix #2548436 (Use EVENT_TIMEZONE rather than TIMEZONE)
* Prior fix used the wrong column when adding time zone information
  to downloaded exceptions

Bug: 2548436
Change-Id: Idc1001fd58d2fba51823624a15862fe439c9ff6a
2010-03-26 12:49:07 -07:00
Marc Blank
41d17202f5 Make sure we only upload exceptions for the correct event
* We weren't checking calendar id along with original event id when
  uploading (original event id isn't unique)
* Fix the query selection to ensure finding the correct exception(s)

Bug: 2545659
Change-Id: I276dd10e2be171bd9d4f3300cdc8843bb28f2781
2010-03-26 12:06:07 -07:00
Makoto Onuki
a942858f0d Properly handle old style (<= 1.6) account shortcuts.
A desktop shortcut to an account created on donut or before points at
com.android.email/.activity.FolderMessageList, which we've already removed.

- Added a dummy FolderMessageList to receive it and redirect to MessageList.
- Removed FolderMessageListUnitTests, which was left unremoved.

Bug 2535335

Change-Id: Ie5ffa158882633a4929c4c47a3d9625fd1626863
2010-03-26 11:02:18 -07:00
Marc Blank
e3bb5a8be4 Merge "When syncing, put time zone into exception events" 2010-03-25 20:43:16 -07:00
Marc Blank
82b2453b97 Clean up EAS -> TimeZone determination code
* Use one minute before/after for transition checking, instead of the
  sloppier early version
* Add tests for additional known time zones
* Change most methods in CalendarUtilities to package private (for use
  with unit tests)
* Clean up a little bad formatting

Change-Id: I9e5be5e1c859f2294adf06874459f7db15fb8c22
2010-03-25 17:26:30 -07:00
Marc Blank
249c6f77c1 When syncing, put time zone into exception events
Bug: 2545885
Change-Id: I41d504f16e9fc4776d2d8d7bbd2682b5940cf1d1
2010-03-25 17:23:01 -07:00
Marc Blank
812983a341 Merge "Don't send bare line feeds to EAS 2.5" 2010-03-25 17:22:25 -07:00
Marc Blank
eba33f8b5a Don't send bare line feeds to EAS 2.5
* EAS 2.5 doesn't like seeing bare LF's in Calendar location
  and description, and Events including them won't sync back to
  the server
* Create a utility to replace bare LF's with CRLF and write
  unit test for the utility
* Fix the bug by using this utility

Bug: 2542220
Change-Id: I2c72d23f15e3a922ebe3585e063abe9fa9e2366f
2010-03-25 17:16:46 -07:00
Marc Blank
a2bb14bd27 Run AccountObserver's onChange in a background thread
* AccountObservers do a fair amount of database access, and all of
  this should be done in a background thread, so we'll move it there

Bug: 2545753
Change-Id: I5a38677213a923d44eadade75ae32e151e9100da
2010-03-25 15:22:52 -07:00
Makoto Onuki
fe61f358ab Moved fromUtf8 from TestUtils to Utility.
And cleaned up SimpleIcsWriter.toString().

Change-Id: I383d91256c48be5263c695c8e8dd151d0e95d0a6
2010-03-24 12:07:32 -07:00
Marc Blank
e5be03d497 Move calendar observer code into background thread
* Calendar observer code does database access (sometimes quite a
  lot), so it shouldn't be run in the UI thread

Change-Id: Ib6ec5ac3105df6d3fc45004dc2b09be4e33a11ac
2010-03-23 11:57:08 -07:00
Makoto Onuki
95492af7a1 Merge "Show a calendar invitation icon on message list." 2010-03-23 10:50:37 -07:00
Makoto Onuki
20c067c67c Show a calendar invitation icon on message list.
Bug 2522928

Change-Id: Ib29c7ee187cb0d864849b83693906b0a3b490734
2010-03-22 13:46:35 -07:00
Marc Blank
d5822018fb Clean up VCALENDAR/TIME_ZONE_INFORMATION code
* Fix the transition times so that they occur at the hour
* Remove an unused variable
* Fix a reference to Calendar.HOUR that should have been
  Calendar.HOUR_OF_DAY
* Confirm that unit tests work properly

Change-Id: I3eaf31d160e97b5f3ba59c83878359085aea960d
2010-03-22 11:28:40 -07:00
Marc Blank
a0b4907ca5 Fix race condition that results in incomplete accounts
* Remove some very old code that updated the Account in the database
  when finishing an EAS FolderSync.  The old code saved away the entire
  Account structure using getContentValues(), which has long been recognized
  as dangerous, since the data being saved might be stale.
* In this case, we were clearing the INCOMPLETE flag in another thread, but
  FolderSync was saving away the old value (with INCOMPLETE set) along with
  all of the other columns.
* Ironically, the old code is entirely obsolete, so the solution is to
  simply remove the update call.

Bug: 2501574
Change-Id: I9eccbde40e05c83ec5f0ab1d3387289286acc5f3
2010-03-20 22:07:55 -07:00
Marc Blank
d673da2868 Don't send null/empty values in SimpleIcsWriter
* Previously, we would send "0", which is just wrong.  Better to
  send nothing
* Make sure that all tests pass

Bug: 2531679
Change-Id: I01412c6c6f7a2570fafadede75671012b917d25b
2010-03-20 19:02:06 -07:00
Marc Blank
a3b7559404 Handle other validation errors more appropriately
* Previously, we handled the error case for security related errors
* Add code to fail on ANY error, and in particular to recognize the
  error in which an OWA server address is used instead of an EAS
  server address

Bug: 2494110
Change-Id: Iab7df56e82f5ff73b1f58d386ec6f844db26a312
2010-03-20 18:55:11 -07:00
Makoto Onuki
22d29c67da Fix potential NPE with restoreMailboxWithId().
There are a few places where we don't do the check in restoreMailboxWithId,
but they don't look trivial enough for me to fix.

Bug 2530534

Change-Id: I77b37a87ef108048077f14c1e8a3457ee494100a
2010-03-19 14:58:53 -07:00
Marc Blank
e3fbaf56e8 Merge "Handle EAS versions better" 2010-03-19 14:56:45 -07:00
Makoto Onuki
caba6df302 Removing litter.
Change-Id: I96bc07a6af1de57334e936879febadb51e3c125d
2010-03-19 14:14:47 -07:00
Marc Blank
e4cd885ec4 Handle EAS versions better
* Properly parse the server's supported versions
* Choose the highest server version that we support
* Fail with MessagingException if we don't support any server
  versions

Bug: 2527408
Change-Id: I0a2822c8fab31a65c8fea9b78b4a8c23df1804a3
2010-03-19 12:01:44 -07:00
Marc Blank
a4049ccbdb Merge "Do alert work in background thread" 2010-03-19 10:19:46 -07:00
Marc Blank
0aa0cd12eb Merge "Send appropriate ics message for cancellations" 2010-03-19 10:18:05 -07:00
Marc Blank
39ea302126 Send appropriate ics message for cancellations
* We were sending cancellations with a request for reply, which is
  incorrect
* Send the correct dats in the ics attachment
* Update unit test to reflect this

Bug: 2527606
Change-Id: I4cea0bb8f1c29a3cad8d09fd6a4750f7ab067229
2010-03-19 10:17:25 -07:00
Marc Blank
bb2f25a23a Do alert work in background thread
* An ANR was reported in MailboxAlarmReceiver
* The reciever calls into SyncManager, which does some database
  operations, and may abort an I/O operation in a sync service
  thread
* Move this potentially long-running code into a background
  thread

Bug: 2215045
Change-Id: Id65c51f706b212d6b50af3921f3ba3dc2d014ce0
2010-03-19 09:59:33 -07:00
satok
7cda118d35 Extract delete acount function from UI thread to async task
BUG: 2474078
BUG: 2438333
Change-Id: Id9aac4c73064f05aa666cda26005b61c04fc262e
2010-03-19 17:59:32 +09:00
Marc Blank
ad33c5acf4 Merge "Send cancellation mail to removed attendees" 2010-03-18 19:35:01 -07:00
Jim Shuma
f7da371234 Merge "Add "vibrate when silent" mode to notifications" 2010-03-18 16:30:33 -07:00
Marc Blank
020af43452 Fix bugs related to disabling Exchange calendar from UI
* There was a TODO for this... :-)
* First, I added some logging to help debug this kind of situation
  in the future
* I also now forcibly stop any ongoing sync of the calendar being
  disabled; this appears related to the problem of Events not
  reappearing
* Added a kick() after the calendar is re-enabled to make sure it
  starts resyncing immediately.

Bug: 2526924
Change-Id: Ib18f4c3c4e016f5cb5205fea5f3f12c0782b5e54
2010-03-18 14:09:06 -07:00
Jim Shuma
9e2ddca59d Add "vibrate when silent" mode to notifications
* Add "vibrate when silent" choice in UI
* Add storage for it in Email's provider.  Existing accounts default to
  their current settings (always vibrate / never vibrate).
* Respect new mode when notifications are posted
* Updated existing unit tests

Bug: 2457183
Change-Id: I5c933ac39dbef8b2028255f330e0b084a445421a
2010-03-18 13:57:25 -07:00
Marc Blank
92ef20a5c3 Send cancellation mail to removed attendees
* We now keep track of attendees in the Event's extended properties
* When a message is updated, we compare current attendees with the
  original list, and send cancellations to those who have been removed

Bug: 25623726
Change-Id: I7b3df99e62fb3d4a1482bd6d4612647f5bdb756a
2010-03-18 13:35:25 -07:00
Andrew Stadler
aadee36a34 Merge "Eliminate duplication in Yahoo! sent mailbox" 2010-03-18 10:18:30 -07:00
Andrew Stadler
c4fcd852ba Eliminate duplication in Yahoo! sent mailbox
* Yahoo! is not supporting search by UID so I can't identify the new
  the UID after I upload.  This inability to correlate the local and
  remote messages means that we wind up syncing the same message back
  down, in a loop, which spawns more messages.
* Yahoo! has partial support for UIDPLUS, and reports the new UID when
  I append (upload) messages.
* Modify IMAP parser to parse response lists
* When APPENDUID is reported, use it (and skip the search)
* Modify the few other existing users of response lists to use the
  parsed versions instead.  Provided a couple of lightweight utilities
  to make it easier to work with ImapList.
* Unit tests for most of it.
* Optimization: share a static date/time parser for all IMAP connections

Bug: 2448220
Change-Id: Ic10fc1a195ccf4671a498188cc8b17848c8d9df7
2010-03-18 10:11:08 -07:00
Marc Blank
ca8cdab2d1 Merge "Don't show attendee status for Exchange events" 2010-03-17 20:32:42 -07:00
Marc Blank
4655cee65a Don't show attendee status for Exchange events
* There are serious issues with showing consistent and accurate attendee
  status for Exchange 2007 events
* Unless and until these can be resolved, it is better to simply not show
  the user the supposed attendee status (since it might well be wrong)
* In this CL, I never set the attendee status; therefore, it will appear
  "unknown" and be shown simply as "Guest" when viewing the Event in the
  Calendar app.
* Will create tracking bug for this, so that we can revisit for a later
  release.

Bug: 2524410
Change-Id: I97fdd26750c68ff25bbb102547071c728e4124a9
2010-03-17 20:13:42 -07:00
Andrew Stadler
f223af1392 Merge "Clear notifications when deleting accounts" 2010-03-17 19:49:44 -07:00
Andrew Stadler
6d55bb08fd Merge "Fix cases of attachments with no name" 2010-03-17 18:16:33 -07:00
Andrew Stadler
7d738cb7e8 Fix cases of attachments with no name
* Most clients send name= in the content-type, but a few clients
  send only filename= in content-disposition.
* There was code to handle both cases, but due to two typos, it didn't
  work.
* Most easily reproduced by sending from hotmail/live web client.

Bug: 2366961
Change-Id: I1d9a00b9b5fd1094cfb8566c3248d94286a8ae91
2010-03-17 17:59:09 -07:00
Andrew Stadler
cb98193f85 Clear notifications when deleting accounts
* Quick fix for the bug that notifications may be stale after
  and account is deleted.

Bug: 2202317
Change-Id: I950d173d20dee443b03b40ee04618afb98a95f38
2010-03-17 16:14:17 -07:00
Makoto Onuki
a29495c03c Merge "Add a flag to dump email messages." 2010-03-17 15:46:00 -07:00
Makoto Onuki
dfeb1184eb Add a flag to dump email messages.
It's useful to debug MIME related problems.

- New MimeStreamParser.LOG_MESSAGE flag
- Cleaned up LoggingInputStream, which now supports all InputStream methods
  (e.g. close, available, etc.) properly.
- LoggingInputStream now dumps non-printable ascii chars as '\xXX'.

Change-Id: I4391e125abd418defc1dc21e4f35cf6ef8448acb
2010-03-17 15:44:56 -07:00
Makoto Onuki
0d91d886a9 Merge "Send log from mime4j to logcat." 2010-03-17 11:33:28 -07:00
Makoto Onuki
6d7554d288 Send log from mime4j to logcat.
This will make it easier to track MIME related problems.  (e.g. encoding
not supported)

Change-Id: I47a719e067ebb4b68d19b5cc612a9d9b61933d57
2010-03-17 10:31:15 -07:00
Marc Blank
5957e89e95 Merge "Send meeting invite mail as multipart/alternative" 2010-03-17 10:15:14 -07:00
Marc Blank
0ed690bfb4 Send meeting invite mail as multipart/alternative
* Turns out that Exchange 2003 requires the ics attachment to be in a
  multipart/alternative, rather than a multipart/mixed MIME message
* Exchange 2007 accepts both types
* Therefore, we change our output for this particular situation, i.e.
  a single attachment that is an ics file, to multipart/alternative
* Rename FLAG_SUPPRESS_CONTENT_DISPOSITION to FLAG_ICS_ALTERNATIVE_PART
  and make this flag do double duty - 1) suppress the Content-Disposition
  header (also required by Exchange) and 2) send the message as
  multipart/alternative
* Add unit tests for Rfc822Output to check that mime parts are composed
  properly

Bug: 2516394
Change-Id: I60e26f57b8ecaf01d0340e7828533334e0e7d45a
2010-03-17 09:59:24 -07:00
Andrew Stadler
d806749834 Merge "Use proper formatting strings for GAL lookup status" 2010-03-17 09:20:27 -07:00
Mihai Preda
e281ebc4e2 MessageView: reject early invalid messageId.
Bug 2507898

Change-Id: I13148c49d9ad5ddfcf7a757e11651762fc8d1922
2010-03-17 11:25:26 +01:00
Andrew Stadler
7b94940c66 Use proper formatting strings for GAL lookup status
* Searching bigcompany.com...
* 12 results from bigcompany.com
* First 20 results from bigcompany.com

Bug: 2249514
Change-Id: Ib3fba9d1ba755d3550235a437f60449bf3c312c3
2010-03-16 23:07:40 -07:00
Marc Blank
ddfe27d9a0 Only delete events locally when calendar is disabled
* Disabling a Calendar is supposed to delete all events from the
  database via CalendarProvider
* We didn't call the delete method with the CALLER_IS_SYNCADAPTER
  parameter, so the deletions were propagating to the server, which
  is VERY bad
* This CL adds the parameter to the URI used for deletion

Bug: 2521196
Change-Id: Ib366979fe32ebff0f8cfa3e3f0843ad7e2af4d47
2010-03-16 22:21:38 -07:00
Makoto Onuki
88a94bca19 Exchange calendar: fixes for the ICS writer.
- Now SimpleIcsWriter does the UTF-8 conversion, and folds lines according
  to the number of bytes in UTF-8.
- It now escapes special chars in TEXT values.  You can safely put , ; \ or
  line breaks. in summary, location, and description.
- Quotes all CN.  (leftover from Ibb8f155a)
- Replace "s in CN with 's (rather than removing them)

Bug 2508283
Bug 2515768

Change-Id: Ibdced53ee32bba950608d63f507b11b24eaad7b0
2010-03-16 13:05:34 -07:00
Marc Blank
40be6b976c Add temporary logging to Calendar upsync
Change-Id: Ica4771fb2f6fbe125c7251c0cb4e2f5ecbe88dc3
2010-03-16 12:54:20 -07:00
Andrew Stadler
9d836a9f7f Merge "GAL (continued)" 2010-03-16 12:00:23 -07:00
Andrew Stadler
caa843068c GAL (continued)
* Clean up logging
* Clean up TODO's
* Clean up some unused code & warnings
* Bugfix: trim query string before calling provider
* Bugfix: use correct # for "First n results..."
* Bugfix: tie separator position tracking into cursor, to avoid
    some concurrency problems when multiple cursors are in flight.

Bug: 2249514
Change-Id: Icf26599ecb9b27cbf88cd80e9abf4a3428598193
2010-03-16 11:59:03 -07:00
Marc Blank
036170b7e2 Merge "Fix dtend synced up to server" 2010-03-16 11:25:35 -07:00
Marc Blank
1b97c28de2 Merge "Send appropriate response email when reply from MessageView" 2010-03-16 11:05:06 -07:00
Marc Blank
198d518a3a Merge "Improve message text for invites w/ recurrences" 2010-03-16 10:49:58 -07:00
Marc Blank
ad809fd744 Send appropriate response email when reply from MessageView
* The code was hard-wired to accept (ancient placehold code)
* Send code that depends on the user's actual response
* Rename inappropriately named method in Controller

Bug: 2515961
Change-Id: I8985a3206fc8c4498521b08806a1093abaf4a42c
2010-03-16 10:48:12 -07:00
Marc Blank
0a6b977939 Fix dtend synced up to server
Bug: 2511120
Change-Id: I9194da082f568d804f89d087475efcc11651b081
2010-03-16 09:10:34 -07:00
Marc Blank
bf916efe95 Improve message text for invites w/ recurrences
* Add the (recurring) text when the invite is for a recurring
  meeting
* Add a test for message text creation

Bug: 2515474
Change-Id: Ifefbc2ba1ac444175180cb7a58f4ec554d9674a3
2010-03-16 08:45:59 -07:00
Andrew Stadler
fa997254d4 Merge "GAL UI cleanup work (in progress)" 2010-03-15 23:33:49 -07:00
Andrew Stadler
26b4b47fb3 GAL UI cleanup work (in progress)
Provider:
  * Move UI (e.g. separator) out of provider, create it entirely in adapter
  * Remove timestamp based disambiguation (TODO throttling some other way)
  * Add cursor "extras" to report total # of results on server
UI:
  * Rewrite background-foreground threading to be more efficient and
    signal changes back to UI by calling notifyDataSetChanged())
  * Separator strings per Rich's UI (not using real strings yet)
  * Remove link back to AutoCompleteTextView

NOTE:  There's a bug in ACTV that is causing the window size not to
change properly on notifyDataSetChanged().  Framework team to investigate.

Bug: 2249514
Change-Id: I183b200dcdaa268f0612d2de6442db28e1491d40
2010-03-15 19:17:03 -07:00
Marc Blank
fa9fed9b84 Fix NPE in stopPing (when account has been deleted)
* Check for null when retrieving Mailbox
* Fix other two spots where we needed checks; thanks, Makoto!

Bug: 2516857
Change-Id: I56ccca16b5f85521e67ef6f92d1cd8f10e5f4a44
2010-03-15 17:05:12 -07:00
Marc Blank
ee1ec2384f Fix NPE in exception parsing
Bug: 2516099
Change-Id: I4d64c306f2c0421f0145dab11f10bfb174e46c0a
2010-03-15 15:35:59 -07:00
Marc Blank
befa974de8 Fix utility that retrieves tokens from RRULEs
* The utility wasn't handling commas properly, causing the referenced
  bug
* Fixed the utility and updated the relevant test case

Bug: 2515488
Change-Id: Id229e50fcaaed1a0142db301eedaaba9209bed13
2010-03-15 14:04:19 -07:00
Makoto Onuki
90299163a3 Merge "ICS Writer: Quote common name." 2010-03-15 12:59:40 -07:00
Makoto Onuki
fc3fc5d26c ICS Writer: Quote common name.
Quote common name (CN) in ATTENDEE per RFC 5545.

Bug 2510783

Change-Id: Ibb8f155a43cbe43886b903472489563242cb6771
2010-03-15 12:23:47 -07:00
Andrew Stadler
e2c56fc88c GAL support
* Provides GAL autocomplete in email address fields in message composition.

General TODO list:
UI: Implement divider in adapter, not in GAL provider
UI: Use listview_separator for divider
UI: Clean up strings, move all to resources
UI: Only have one GAL lookup in flight at any time
UI: Unit tests

GAL: Use side channel for status, not a row
GAL: Shorten timeout for interactive GAL lookup
GAL: Make watchdogs work
GAL: Figure out why some calls never return (conn pool exhaustion?)
GAL: Unit tests

Bug: 2249514
Change-Id: I513e25628bc2f5ed0920e0ee509cd598b1817b3a
2010-03-15 11:12:34 -07:00
Makoto Onuki
20225d5760 Explicitly send ICS files in UTF-8.
- In memory attachments are now stored as byte[], not String.
  We can store any type of contents now.
- Added blob content_bytes to the Attachment table.
  The content field is now deprecated and not used.
- Explicitly convert ICS files to UTF-8.

- Added Utility.to/fromUtf8().

Bug 2509287
Change-Id: I3785a365a9a34039ec12ba82bd857dcdbc4de92d
2010-03-15 10:51:58 -07:00
Marc Blank
8c1613b4f7 Only send one reminder time to Exchange server
* Upsync fails if we try to send more than one reminder time
* CalendarProvider allows an unlimited number of reminders
* If there are reminders, send the largest number (i.e. the earliest
  reminder)

Bug: 2513106
Change-Id: I90a2fb145446e403edeabc654f725cc88ef1656e
2010-03-13 20:45:23 -08:00
Marc Blank
217cfba1f6 Delete Exceptions after deleting an Event
* CalendarProvider does NOT delete exceptions for deleted Events
  because the server handles this; this isn't right for Exchange
* Add a second delete operation to delete Exceptions
* Remember to cancel this second deletion for invalid events

Bug: 2512985
Change-Id: I848c8937945b3774251e517071c81a334a77f1a8
2010-03-13 14:44:55 -08:00
Marc Blank
9e098eaf75 Merge "Prevent multiple calls to onDone() in AccountSetupOptions" 2010-03-13 10:22:34 -08:00
Marc Blank
b7fe21676e Prevent multiple calls to onDone() in AccountSetupOptions
* When "Done" is pressed in AccountSetupOptions and the Account is
  EAS, the finish() isn't called until an async method's callback
  is invoked (system account creation)
* This allowed the user to execute onDone() multiple times, each
  one of which would attempt to create an account
* The net effect was the referenced bug, which can manifest in a
  number of ugly ways
* The fix is to prevent multiple calls to onDone()

Bug: 2501574
Change-Id: I61057bbb8c1f85da07e83ed6c56474bfe4e23f6c
2010-03-12 23:17:28 -08:00
Marc Blank
4b3c683014 Improve handling of exception downsync
* We needed to copy some more columns, and also copy reminders
  and attendees to the Exception
* Also found a bug in which Description was referenced as a boolean
  rather than a String

Bug: 2511405
Change-Id: I485b8d44a6090f8190e681838d2141551227d8f3
2010-03-12 21:56:46 -08:00
Marc Blank
82e51e0631 Send email related to event exceptions
* We weren't sending out appropriate emails for exceptions and other
  event updates
* Write exception specific ics file code in CalendarUtilities (in
  the existing ics file creator)
* Send appropriate Update: subject for updated events/exceptions
* Compose simple message text consisting of:
  When: <time>
  Where: <location>
* Prepend message text for exceptions to indicate that the message
  relates to a particular instance of the event:
  This event has been canceled for: <date>
  The details of this event have been changed for: <date>
* New strings were added in CL#44141
* Updated CalendarUtilities tests

Bug: 2501270
Change-Id: I920de8120bc56d5bd565cbde26ff4807be41579f
2010-03-12 11:12:23 -08:00
Marc Blank
ea34123582 Make ORGANIZER_CAN_RESPOND column 0 for Exchange Calendars
* This will prevent the UI from showing attendee status for the
  event organizer

Bug: 2507842
Change-Id: If217b10ba9c19812d8f49e72fdae236fb0f4b9f1
2010-03-11 20:33:07 -08:00
Marc Blank
ff556f7b5f Fix #2508283 (Improper wrapping of long text in ics attachments)
* Ignore CR and change LF into backslash + n
* Write unit test for handling of CRLF's
* Rename mLineCount to mColumnCount, which is more appropriate

Bug: 2508283
Change-Id: I8b2081aa474cb07b6cb09383ff6ac58a1dab1bba
2010-03-11 16:28:52 -08:00
Marc Blank
c64ee8f0cb Merge "Fix #2507421 related to disabling Exchange calendars" 2010-03-11 12:50:31 -08:00