[INST:UI] Fix bug that installmanager cannot display download progress 19/15119/1
authoryongsung1.kim <yongsung1.kim@samsung.com>
Thu, 16 Jan 2014 08:59:24 +0000 (17:59 +0900)
committeryongsung1.kim <yongsung1.kim@samsung.com>
Thu, 16 Jan 2014 08:59:24 +0000 (17:59 +0900)
bar.

Change-Id: Id2b75f14d192c20bdacee9ff3b4e7ff6fef4b5f6
Signed-off-by: yongsung1.kim <yongsung1.kim@samsung.com>
InstallManager_java/src/org/tizen/installmanager/lib/Downloader.java

index 054416b..d9cb0d3 100644 (file)
@@ -241,21 +241,21 @@ public class Downloader {
                                }
 
                                long endMS = System.currentTimeMillis();
+                               long timeOutOffset = 0;
+                               
                                if (Options.doTest) {
-                                       beginMS = beginMS + READ_TIMEOUT_TEST;                                  
+                                       timeOutOffset = READ_TIMEOUT_TEST;
                                } else {
-                                       beginMS = beginMS + READ_TIMEOUT;
+                                       timeOutOffset = READ_TIMEOUT;
                                }
                                
-                               if (endMS > beginMS) {
-                                       if (Options.doTest) {
-                                               Log.err("Can not be read during 60 seconds.");
-                                       } else {
-                                               Log.err("Can not be read during 20 seconds.");                                          
-                                       }
+                               if (endMS > (beginMS + timeOutOffset)) {
+                                       Log.err("Can not be read during 20 seconds(test case : 60 seconds).");
                                        ErrorController.setError(ErrorCode.INTERNET_CONNECTION_ERROR);
                                        
                                        throw new IMNetworkDownloadException(ErrorCode.INTERNET_CONNECTION_ERROR);
+                               } else {
+                                       // normal operation. to do nothing.
                                }
                        }
                } catch (SocketTimeoutException e) {
@@ -936,6 +936,8 @@ public class Downloader {
                                                mConnection.setConnectTimeout(CONNECT_TIMEOUT);
                                                mConnection.setReadTimeout(READ_TIMEOUT);
                                        }
+//                                     mConnection.setConnectTimeout(CONNECT_TIMEOUT);
+//                                     mConnection.setReadTimeout(READ_TIMEOUT);
                                        
                                        if (rangeSize > 0) {
                                                setRangeRequest();