Cosmetics
This commit is contained in:
parent
7fa59d65db
commit
2794f5376e
1 changed files with 7 additions and 13 deletions
|
@ -192,9 +192,7 @@ public class DownloadService extends Service implements ProgressListener {
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
|
|
||||||
TrafficStats.setThreadStatsTag(1);
|
TrafficStats.setThreadStatsTag(1);
|
||||||
}
|
|
||||||
|
|
||||||
int slidx = surl.lastIndexOf( "segments4/" );
|
int slidx = surl.lastIndexOf( "segments4/" );
|
||||||
String name = surl.substring( slidx+10 );
|
String name = surl.substring( slidx+10 );
|
||||||
|
@ -397,17 +395,13 @@ public class DownloadService extends Service implements ProgressListener {
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
|
|
||||||
TrafficStats.setThreadStatsTag(1);
|
TrafficStats.setThreadStatsTag(1);
|
||||||
}
|
|
||||||
|
|
||||||
if ( connection == null )
|
|
||||||
{
|
|
||||||
URL url = new URL(surl);
|
URL url = new URL(surl);
|
||||||
connection = (HttpURLConnection) url.openConnection();
|
connection = (HttpURLConnection) url.openConnection();
|
||||||
connection.setConnectTimeout(5000);
|
connection.setConnectTimeout(5000);
|
||||||
connection.connect();
|
connection.connect();
|
||||||
}
|
|
||||||
// expect HTTP 200 OK, so we don't mistakenly save error report
|
// expect HTTP 200 OK, so we don't mistakenly save error report
|
||||||
// instead of the file
|
// instead of the file
|
||||||
if (connection.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
|
if (connection.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
|
||||||
|
|
Loading…
Reference in a new issue