{"action":"created","issue":{"url":"https://api.github.com/repos/zhaozepeng/Android_framework/issues/2","labels_url":"https://api.github.com/repos/zhaozepeng/Android_framework/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/zhaozepeng/Android_framework/issues/2/comments","events_url":"https://api.github.com/repos/zhaozepeng/Android_framework/issues/2/events","html_url":"https://github.com/zhaozepeng/Android_framework/issues/2","id":125865759,"number":2,"title":"斷點測試","user":{"login":"lowfiend","id":9345164,"avatar_url":"https://avatars.githubusercontent.com/u/9345164?v=3","gravatar_id":"","url":"https://api.github.com/users/lowfiend","html_url":"https://github.com/lowfiend","followers_url":"https://api.github.com/users/lowfiend/followers","following_url":"https://api.github.com/users/lowfiend/following{/other_user}","gists_url":"https://api.github.com/users/lowfiend/gists{/gist_id}","starred_url":"https://api.github.com/users/lowfiend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lowfiend/subscriptions","organizations_url":"https://api.github.com/users/lowfiend/orgs","repos_url":"https://api.github.com/users/lowfiend/repos","events_url":"https://api.github.com/users/lowfiend/events{/privacy}","received_events_url":"https://api.github.com/users/lowfiend/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":39,"created_at":"2016-01-11T03:12:33Z","updated_at":"2016-01-12T03:13:41Z","closed_at":null,"body":"測試出現的\r\nProgressChangeHandler.handleMessage 並沒關閉\r\n\r\n01-11 11:09:21.289 5168-5168/? I/[PID:5168]: [TID:1] ProgressChangeHandler.handleMessage(line:544): state3\r\n01-11 11:09:21.389 5168-5168/? I/[PID:5168]: [TID:1] ProgressChangeHandler.handleMessage(line:544): state3\r\n01-11 11:09:21.489 5168-5168/? I/[PID:5168]: [TID:1] ProgressChangeHandler.handleMessage(line:544): state3\r\n01-11 11:09:21.593 5168-5168/? I/[PID:5168]: [TID:1] ProgressChangeHandler.handleMessage(line:544): state3\r\n01-11 11:09:21.693 5168-5168/? I/[PID:5168]: [TID:1] ProgressChangeHandler.handleMessage(line:544): state3\r\n01-11 11:09:21.793 5168-5168/? I/[PID:5168]: [TID:1] ProgressChangeHandler.handleMessage(line:544): state3\r\n01-11 11:09:21.897 5168-5168/? I/[PID:5168]: [TID:1] ProgressChangeHandler.handleMessage(line:544): state3\r\n01-11 11:09:21.993 5168-5168/? I/[PID:5168]: [TID:1] ProgressChangeHandler.handleMessage(line:544): state3\r\n01-11 11:09:22.097 5168-5168/? I/[PID:5168]: [TID:1] ProgressChangeHandler.handleMessage(line:544): state3\r\n01-11 11:09:22.197 5168-5168/? I/[PID:5168]: [TID:1] ProgressChangeHandler.handleMessage(line:544): state3\r\n01-11 11:09:22.301 5168-5168/? I/[PID:5168]: [TID:1] ProgressChangeHandler.handleMessage(line:544): state3\r\n01-11 11:09:22.401 5168-5168/? I/[PID:5168]: [TID:1] ProgressChangeHandler.handleMessage(line:544): state3\r\n\r\n\r\n雖然在onDestroy有設定manager.stop()\r\n但是ProgressChangeHandler.handleMessage並沒有跟著關閉\r\n還是會持續一直跑  \r\n\r\n測試方式\r\n1.找100MB的下載，下載中途回上一頁\r\n2. manager停止，但是ProgressChangeHandler.handleMessage沒有結束"},"comment":{"url":"https://api.github.com/repos/zhaozepeng/Android_framework/issues/comments/170770934","html_url":"https://github.com/zhaozepeng/Android_framework/issues/2#issuecomment-170770934","issue_url":"https://api.github.com/repos/zhaozepeng/Android_framework/issues/2","id":170770934,"user":{"login":"lowfiend","id":9345164,"avatar_url":"https://avatars.githubusercontent.com/u/9345164?v=3","gravatar_id":"","url":"https://api.github.com/users/lowfiend","html_url":"https://github.com/lowfiend","followers_url":"https://api.github.com/users/lowfiend/followers","following_url":"https://api.github.com/users/lowfiend/following{/other_user}","gists_url":"https://api.github.com/users/lowfiend/gists{/gist_id}","starred_url":"https://api.github.com/users/lowfiend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lowfiend/subscriptions","organizations_url":"https://api.github.com/users/lowfiend/orgs","repos_url":"https://api.github.com/users/lowfiend/repos","events_url":"https://api.github.com/users/lowfiend/events{/privacy}","received_events_url":"https://api.github.com/users/lowfiend/received_events","type":"User","site_admin":false},"created_at":"2016-01-12T03:13:41Z","updated_at":"2016-01-12T03:13:41Z","body":"private void stopDownloadThread(int sendState){\r\n        boolean state;\r\n\r\n        //检测下载线程，确保下载线程要全部执行完成\r\n        state = threads.size()>0;\r\n        while(state){\r\n            state = countDownLatch.getCount()>0;\r\n\r\n            L.i(state+\"\");\r\n            try {\r\n                Thread.sleep(100);\r\n            } catch (InterruptedException e) {\r\n                e.printStackTrace();\r\n            }\r\n            //还有线程在执行，所以状态还需要相应变更\r\n            progressChangeHandler.sendEmptyMessage(sendState);\r\n        }\r\n    }\r\n\r\n從這試試看吧\r\n\r\n因為stopStartThread 只會執行一次\r\nstopDownloadThread 卡住一直執行\r\n01-12 11:12:36.943 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:36.943 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:37.043 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:37.044 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:37.144 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:37.144 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:37.245 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:37.245 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:37.345 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:37.345 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:37.446 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:37.446 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:37.547 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:37.547 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:37.647 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:37.647 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:37.748 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:37.748 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:37.768 1090-3048/? I/Icing: Indexing 34C0A5F1F28AFB9DDEDA48091F60F9E78B944EF2 from com.google.android.gms\r\n01-12 11:12:37.790 1090-3048/? I/Icing: Indexing done 34C0A5F1F28AFB9DDEDA48091F60F9E78B944EF2\r\n01-12 11:12:37.848 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:37.848 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:37.949 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:37.949 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:38.049 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:38.049 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:38.150 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:38.164 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:38.250 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:38.267 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:38.351 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:38.352 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:38.451 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:38.451 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:38.552 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:38.552 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:38.652 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:38.653 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:38.753 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:38.753 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:38.854 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:38.854 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:38.954 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:38.954 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:39.055 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:39.055 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:39.155 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:39.155 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:39.256 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:39.256 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:39.357 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:39.357 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:39.458 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:39.458 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:39.559 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:39.560 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:39.660 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:39.661 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:39.761 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:39.762 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:39.862 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:39.863 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:39.963 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:39.964 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:40.064 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:40.065 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:40.165 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:40.166 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:40.266 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:40.268 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:40.368 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:40.369 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:40.469 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:40.470 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:40.570 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:40.571 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:40.671 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:40.672 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:40.772 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:40.773 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:40.874 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:40.875 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:40.975 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:40.976 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:41.076 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:41.077 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:41.177 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:41.178 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:41.278 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:41.279 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:41.379 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:41.380 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:41.480 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:41.480 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:41.580 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:41.581 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:41.681 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n01-12 11:12:41.681 11861-11861/? I/[PID:11861]: [TID:1] ProgressChangeHandler.handleMessage(line:551): state3\r\n01-12 11:12:41.782 11861-11947/? I/[PID:11861]: [TID:565] FileDownloadManager.stopDownloadThread(line:375): true\r\n"}}