Commit Graph

3040 Commits

Author SHA1 Message Date
cketti c3f1420ef6 Don't open the file after the media scanner added it to the media content provider 2014-11-10 06:43:00 +01:00
cketti dfd40659d1 Append file name to content:// URI
This allows intent filters with patterns for file extensions to match.
2014-11-10 05:46:38 +01:00
cketti 6a1905b7b7 If we can't find an app to view an attachment try again with a file:// URI
Sadly, some apps only support the 'file' scheme in their intent filters. Among
them is Android's own package installer.
2014-11-10 05:37:22 +01:00
cketti 44ecf5d588 Use MIME type used for intent resolution in content provider 2014-11-10 03:12:28 +01:00
cketti f87ab53b9b Try original and inferred MIME type to find best viewer for attachment
In order for Android to find apps that are capable of opening an attachment for
viewing the ACTION_VIEW Intent needs to contain an appropriate MIME type.
Ideally, we'd use the MIME type specified for the attachment in the message.
But often the supplied MIME type is wrong/useless. So we look at the file
extension to try to come up with a sensible MIME type on our own. We then go
on to ask Android which of the two MIME types leads to more apps claiming to
be able to open our attachment for viewing and use that one.
2014-11-10 03:10:09 +01:00
cketti 11a9eff109 Extract intent creation code to method 2014-11-09 20:46:46 +01:00
cketti 6cb3c991db No longer pretend there are attachment types we don't care about 2014-10-20 21:26:18 -04:00
cketti 3c4ad91614 Fix method names/visibility 2014-10-20 21:24:18 -04:00
cketti d3073be89a Rearrange fields/methods 2014-10-20 21:21:09 -04:00
cketti 83d876f246 Inline method 2014-10-20 21:16:31 -04:00
cketti f6822c973d Clean up comments 2014-10-20 21:13:58 -04:00
cketti 1e89314f3e Remove "m" prefix for field names 2014-10-20 21:09:23 -04:00
cketti b3bc85ba10 Split 'populateFromPart' into multiple methods 2014-10-20 21:06:31 -04:00
cketti ca88f59c05 Create named class for loading and displaying attachment thumbnails 2014-10-20 20:46:46 -04:00
cketti 4299eb9771 Rename method and improve documentation 2014-10-20 20:28:38 -04:00
cketti 4a6c52947d Make all fields of AttachmentView private 2014-10-20 20:14:04 -04:00
cketti 0ced8746af Remove old/unused code from click handler 2014-10-20 20:05:21 -04:00
cketti 187d760e5f Extract code to display error/status messages to a separate method 2014-10-20 19:50:41 -04:00
cketti dfe1771fcb Fix formatting 2014-10-20 19:39:16 -04:00
cketti b7a8c9b707 Remove unused code 2014-10-20 19:34:16 -04:00
Joe Steele a141457886 Revert "Implement SSL file-based session caching"
This reverts commit 43c38a047f.
2014-10-07 21:23:04 -04:00
cketti 082dd953b2 Remove now unused AccessibleEmailContentActivity 2014-09-18 15:06:00 +02:00
cketti a6fc06f7f9 Fix code style 2014-09-12 06:35:07 +02:00
cketti 3e4beae631 Remove unused 'check mark' color chip 2014-09-12 06:26:03 +02:00
Joe Steele 0f6719387c Re-enable TLSv1.1/1.2 support
Was disabled in 3fd7470d.

Issue 6238.

Related Android change for API 20:
1f63d2c223%5E!/
2014-09-10 11:42:14 -04:00
cketti a10b9ae452 Merge pull request #493 from zjw/ssl_changes
SSL changes
2014-09-10 01:44:44 +02:00
Joe Steele 094feced0c Remove unused imports 2014-09-09 18:56:36 -04:00
cketti 9e203b75cc Remove gallery bug work-around
This bug was present in the Gallery app shipped with Android 2.0.
The time has come to say good-bye. We will never forget you! But only because you're part of our Git history.
2014-09-07 23:35:18 +02:00
Joe Steele 43c38a047f Implement SSL file-based session caching
Caching is beneficial because it can eliminate redundant cryptographic
computations and network traffic when re-establishing a connection to
the same server, thus saving time and conserving power.
2014-09-06 19:32:06 -04:00
Joe Steele 7dfbd906c9 Eliminate DomainNameChecker
There's no need to maintain our own implementation when comparable
classes already exist in the Android API.

StrictHostnameVerifier is used instead.
2014-09-06 19:32:03 -04:00
Joe Steele 6f14294164 Remove SslHelper. Don't use SecureRandom.
SslHelper has been removed, and its functionality has been transferred
into TrustedSocketFactory.  The added layer of indirection wasn't really
simplifying anything.  It's now easier to see what happens when
createSocket() is invoked.

A new instance of SecureRandom is no longer passed to SSLContext.init().
Instead, null is passed.

The (default) provider of the TLS SSLContext used is OpenSSLProvider,
which provides an SSLSocket instance of type OpenSSLSocketImpl.  The only
use of SecureRandom is in OpenSSLSocketImpl.startHandshake(), where it is
used to seed the OpenSSL PRNG with additional random data.  But if
SecureRandom is null, then /dev/urandom is used for seeding instead.

Meanwhile, the default provider for the SecureRandom service is
OpenSSLRandom, which uses the OpenSSL PRNG as its data source.  So we were
effectively seeding the OpenSSL PRNG with itself.  That's probably okay
(we trust that the OpenSSL PRNG was properly initialized with random data
before first use), but using /dev/urandom would seem like a better source
(or at least as good a source) for the additional seed data added with
each new connection.

Note that our PRNGFixes class replaces the default SecureRandom service
with one whose data source is /dev/urandom for certain vulnerable API
levels anyway.  (It also makes sure that the OpenSSL PRNG is properly
seeded before first use for certain vulnerable API levels.)
2014-09-06 18:15:25 -04:00
cketti 5f0f4e9c21 Merge pull request #485 from haselwarter
Conflicts:
	src/com/fsck/k9/preferences/Settings.java
2014-09-04 23:55:30 +02:00
cketti f5cfaceef4 Increase settings version in preparation of merge into master 2014-09-04 23:54:06 +02:00
cketti 5802e6a36a Remove getNotifyClass() from Folder 2014-09-04 23:54:06 +02:00
cketti 7edd1cb53c Simplify database upgrade when adding 'notify_class' to 'folders' 2014-09-04 23:54:06 +02:00
cketti bd9efa8d01 Whitespace fixes 2014-09-04 22:58:38 +02:00
cketti cb67a21a93 Remove commented-out code 2014-09-04 21:58:18 +02:00
cketti 759fa77c9a Merge pull request #474 from k9mail/tls-client-cert-auth
Client Certificate Authentication
2014-08-30 01:06:28 +02:00
Joe Steele 9728609c4c Make the foldable container view INVISIBLE, not GONE
Now when toggling the foldable view, the screen no longer
jumps half a line up or down to recenter itself when
the view is displayed.
2014-08-29 10:47:45 -04:00
Joe Steele 8ade424270 Save/Restore the FoldableLinearLayout state 2014-08-29 10:47:43 -04:00
Joe Steele a756fa3683 Use Theme consistent styles in FoldableLinearLayout
For support of the dark and light themes.

Also:

Redefine mFolded and call it mIsFolded.  Previously,
the view started with mFolded = false (which implies to me
the initial state is unfolded) and yet the view
started in a folded state, which seemed contradictory.

Create updateFoldedState() with code from onClick() (In
preparation for subsequent commit.)
2014-08-29 10:47:41 -04:00
Joe Steele 348fb4dceb Validate client certificate dates 2014-08-29 10:47:39 -04:00
Joe Steele c80634d501 Format log messages with spaces 2014-08-29 09:06:25 -04:00
cketti ac1ed9eef3 Increment settings version 2014-08-29 01:45:48 +02:00
Dominik Schürmann 05d8fb5e42 Hide client cert option under advanced options dropdown 2014-08-27 11:48:49 +02:00
Dominik Schürmann 2a1733564e Add FoldableLinearLayout for advanced options 2014-08-27 11:30:53 +02:00
Joe Steele e4d26b8c75 Remove code for unsupported API levels
An assortment of miscellaneous changes, each usually limited in scope to a
single file.
2014-08-19 17:17:55 -04:00
Joe Steele bc60c860b8 Remove com.fsck.k9.helper.NotificationBuilder
Only useful on pre-Honeycomb devices.
2014-08-19 17:17:52 -04:00
Joe Steele 786511ed88 Simplify ClipboardManager
No longer API dependent.
2014-08-19 17:17:50 -04:00
Joe Steele 028f6f9055 Remove AccessibleWebView
Only used on pre-ICS devices
2014-08-19 17:17:48 -04:00