There are many similar questions and
HttpURLConnection con = (HttpURLConnection) new URL("www.google.com").openConnection();
con.setReadTimeout(1000);
Is not a solution. I need to limit available time for download where if it takes more than 3 seconds to download the file it would throw an exception. setReadTimeout is respected only if data is not available for read for specified time which is totally different.
I'd like to prevent unpredictable thread block periods when reading from slow content providers.