1
0
mirror of https://github.com/etesync/android synced 2024-11-16 04:49:06 +00:00
Commit Graph

923 Commits

Author SHA1 Message Date
Ricki Hirner
7391dfd656 Remove "vcard4android" from VCard PRODID to avoid folding for better compatibility 2017-05-16 11:19:45 +01:00
Tom Hacohen
7ddb11c670 Change PRODID to better match the davdroid format. 2017-05-16 11:19:45 +01:00
Ricki Hirner
b7eaa2753f Upgrade to okhttp/3.8.0 2017-05-16 11:08:42 +01:00
Tom Hacohen
04e50459d4 Syncmanager: fix an issue causing local cache corruption when failing to push.
Due to a logical issue in the code, new journal entries were added to the
local cache after they've been created locally, and not after they've
been added to the server. Under normal circumstances this doesn't pose a
problem, however when pushing to the server fails, the local cache
would have the new entries as if they were saved on the server, causing
the app to think there has been a corruption on the server (as entries
should never be removed from the server) and halt the sync.

This change makes it so the entries are saved to the local cache only
after they've been saved on the server.

Note: this was not spotted until now because it relies on an unfortunate
specific sequence of events. It only happens when creating journal
entries, and when trying to sync them successfully connecting to the
server to fetch the journal list and the content of the journal itself,
and only failing when coming to push the journals.

Many thanks to "359" (this user's preferred alias) for reporting the
issue that resulted in this fix.
2017-05-15 16:17:48 +01:00
Tom Hacohen
9ffdc6a9a0 Update Changelog. 2017-05-15 11:31:08 +01:00
Tom Hacohen
2771012997 Bump version. 2017-05-15 11:26:57 +01:00
Tom Hacohen
30fa0128b6 AsyncTask: cancel background tasks when the fragments are destroyed.
I assumed the lifecycle of the fragment and the task were tied because they
are tied to the instance, but it looks like I was wrong. We need to
explicitly cancel tasks.
2017-05-12 20:28:47 +01:00
Tom Hacohen
28aa80fe07 Syncmanager: don't try to fetch again if we already fetched everything.
This patch changes the fetching so if the last fetch returned less entries
than the limit, we don't try and fetch again because we already know there
are no others left.
2017-05-12 19:27:05 +01:00
Tom Hacohen
2b0b35c9be Service test: inviting owner to a journal is no longer allowed.
This is a new validation on the server, so this hack we did is no longer
possible.
2017-05-12 14:48:19 +01:00
Tom Hacohen
f7104bbcef Syncmanager: fetch journal entries in chunks.
Before this commit we used to fetch the whole journal entry list in one
go, which caused issues in two cases:
1. On slow internet connections the download may fail.
2. With big journals: Android interrupts sync managers if they don't
    perform any significant network traffic for over a minute[1],
    and because we would first download and only then process, we would
    sometimes hit this threshold.

Current chunk size is set to 50.

1: https://developer.android.com/reference/android/content/AbstractThreadedSyncAdapter.html
2017-05-12 14:36:43 +01:00
Tom Hacohen
4e2667cdb2 Update Changelog. 2017-05-12 13:09:44 +01:00
Tom Hacohen
c19e7b0ecb Bump version. 2017-05-12 12:46:32 +01:00
Tom Hacohen
9cdd63f1d9 Journal manager crypto: change RSA key length to 3072.
I set it to 2048 following the NIST recommendations[1] which said it was
OK, but actually, as pointed out by Dominik Schürmann, it's probably a
better idea to set to 3072.

Users who already have a 2048 key pair won't be affected, while users
who don't will have a 3072 key created for them. Users with different
key lengths can interact with each other without any issues.

1: https://www.keylength.com/en/4/
2017-05-12 12:42:35 +01:00
Tom Hacohen
b33e5003d4 Setup Encryption: use the more reliable AsyncTask over AsyncTaskLoader.
I had issues with not being able to add accounts in some cases.
2017-05-12 12:38:08 +01:00
Tom Hacohen
660d5b94ba Journal item activity: improve look (add elevation to contact name). 2017-05-12 11:31:25 +01:00
Tom Hacohen
0503efa8ac Journal item activity: Use string resources instead of hardcoded strings. 2017-05-12 11:26:57 +01:00
Tom Hacohen
9f069692c9 Journal viewer: Improve the look and feel of the journal viewer
This includes using icons instead of text for the journal list, and
showing events and contacts in a prettier way.
2017-05-11 22:43:29 +01:00
Tom Hacohen
c3ee3aac22 Journal item: Implement showing contacts.
This shows address book journal items in a nicer way.
2017-05-11 22:42:59 +01:00
Tom Hacohen
b964b8dfe1 Journal item: implement showing calendar events (based on etar)
This shows the calendar events in a nicer way based on Etar[1] which is
in turn based on the AOSP calendar.

1: https://github.com/Etar-Group/Etar-Calendar/
2017-05-11 22:42:59 +01:00
Tom Hacohen
7dba220d06 Journal item activity: create the infrastructure for a nicer interface 2017-05-11 22:42:59 +01:00
Tom Hacohen
e6ba52074a Journal item: view journal item in a separate activity.
This change makes clicking on journal items in the list to show in a
separate activity. At the moment it just makes for a slightly nicer
presentation. In the future we would change it to show the data in a
nice formatted way instead of a raw dump of the vObject.
2017-05-11 22:42:59 +01:00
Tom Hacohen
889eede699 Journal list: Use icons for actions instead of text. 2017-05-11 22:42:59 +01:00
Tom Hacohen
a3e4fc48ab Collection header: set owner visibility to gone when there's no owner. 2017-05-11 22:42:37 +01:00
Tom Hacohen
1cf1d0f5b0 BaseActivity: Add an activity that all other activities inherit from.
Now that we have this activity, remove the duplication of onResume/onPause and
onOptionsItemSelected.
2017-05-11 22:42:36 +01:00
Tom Hacohen
d86edd7688 Journal model: add a unique constraint to journal UIDs.
Journals and services should be unique together, this wasn't there
because of an issue with requery that should now be resolved.
2017-05-05 16:50:54 +01:00
Tom Hacohen
df05dd2498 Deps: upgrade requery to 1.3.1.
This fixes an issue with index creation when altering tables.
2017-05-05 16:49:27 +01:00
Tom Hacohen
5d816b991e Update Changelog. 2017-05-04 11:26:08 +01:00
Tom Hacohen
10095bd4ee WebView: correctly handle checking if a url should open in app or browser.
There was an issue that for the first load it would only check the url
after a redirect (if there is one), which meant that for example,
the dashboard, would open in app because you'd be redirected to the
login page.
2017-05-03 19:25:39 +01:00
Tom Hacohen
a9eba1af4e Account upgrade: raise an error when account migration fails.
Account migration works in most cases, though while testing I managed to
get it to fail in some rare occasions. This commit adds a check to
verify the number of contacts we thought we migrated is equal to the
number of contacts we have after migration.

If the check fails, it presents the user with a notification that opens
the relevant FAQ entry on the EteSync website.
2017-05-03 19:04:42 +01:00
Tom Hacohen
20568c850a SyncManager: Request for a full sync if interrupted.
This doesn't work well, but I'm keeping it since it's still better than
what was there before.

We have a problem that on initial sync with long enough logs, Android
kills the sync manager before completion. The reason for that is that
due to the fact that EteSync first downloads the whole journal and only then
processes it, the sync manager spends a minute without making any
network traffic, which in turn makes Android kill the sync[1].

This should probably be fixed by paginating the initial download, that
is, downloading and processing the journal in chunks, which is possibly
a good idea regardless.

1: https://developer.android.com/reference/android/content/AbstractThreadedSyncAdapter.html
2017-05-03 19:04:42 +01:00
Tom Hacohen
a107cd3fa2 AccountSettings: remove wrong version set.
This was a leftover from the cherry-pick from DAVdroid. The version is
set outside of this function, so this was redundant, and wrong.
2017-05-03 19:04:07 +01:00
Ricki Hirner
643e2b23ea Use UUIDs for newly generated event/task UIDs (RFC 7986 5.3 UID Property) 2017-05-02 11:35:52 +01:00
Tom Hacohen
f819dbf33f Bump version. 2017-04-27 13:02:53 +01:00
Tom Hacohen
eb95eada91 Import: Add an alias for our addressbook and davdroid account types. 2017-04-27 11:56:19 +01:00
Tom Hacohen
861d5e4b4e Fix account type and authority to use function and not string. 2017-04-27 11:56:18 +01:00
Tom Hacohen
26c0a62dc4 Don't crash when immediately entering collection after creation. 2017-04-27 11:56:17 +01:00
Tom Hacohen
eae4e14b1d Merge: add support for multiple address books
Android allows only having one address book per account, so until now
users of EteSync were only able to have one address book. This was
always an annoying limitation, but even more so now that journal sharing
is implemented.

Luckily, DAVdroid recently implemented multiple account support by
creating sub-accounts for address books.

This merge is based on the changes done in DAVdroid but was heavily
adjusted for EteSync.
2017-04-27 11:54:46 +01:00
Tom Hacohen
674ea1eeca Workaround Android account creation issue (ignoring userData)
It seems like there's an issue with Android that sometimes the userData
passed to addAccountExplicitly is not correctly set in the Android cache
making it return null on subsequent fetches. It doesn't always happen
because some cases clear the cache, however I can consistently trigger
it by creating and deleting an account a few times in a row.
2017-04-27 11:49:06 +01:00
Tom Hacohen
db82757bc4 Show an error message when failing to create an account. 2017-04-27 11:49:05 +01:00
Tom Hacohen
aeae7de077 Workaround: ignore invalid account errors when syncing contacts
This is an ugly workaround. For some reason a sync is called when an
account is removed. Since the main account is removed, we get an invalid
account exception when trying to fetch it.

Need to find out why a sync is even triggered and just remove it there.
2017-04-27 11:49:05 +01:00
Tom Hacohen
c81ba0cddb Create an AndroidCompat class to wrap around Android oddities.
As part of it, move removeAccount to that class.
2017-04-27 11:49:05 +01:00
Tom Hacohen
de6a124bf2 Remove unnecessary InvalidAccountException
Based on commit d4e386441091ae3a84382f2088dfad03ea80c666 from DAVdroid.
2017-04-27 11:49:05 +01:00
Tom Hacohen
068e0c6b4d Expose appName from App and use it. 2017-04-27 11:49:05 +01:00
Ricki Hirner
51840c3a22 Fix some inconsistencies 2017-04-27 11:49:05 +01:00
Ricki Hirner
138d344a5b Open DAVdroid main activity when add a "DAVdroid Address book" account is added over Settings 2017-04-27 11:49:05 +01:00
Tom Hacohen
d6ace869fe Remove add, share and delete restrictions on address books
Now that we have multiple address books support, we can share and delete
address books like we did calendars.
2017-04-27 11:49:05 +01:00
Tom Hacohen
2f95ddbda2 Import: Fix address book import.
The import code assumed there can be only one address book, and that
it's the main one. This commit fixes that wrong assumption.
2017-04-27 11:48:01 +01:00
Tom Hacohen
e729bcff42 ViewCollection: fix addressbook stats. 2017-04-27 11:48:01 +01:00
Tom Hacohen
51aecba9a0 LocalAddressBook: Add a way to get address book by UID. 2017-04-27 11:48:01 +01:00
Tom Hacohen
19b955f981 Change LocalAddressBook to look like LocalCalendar (accept journalentity) 2017-04-27 11:48:01 +01:00