{"action":"created","comment":{"url":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/comments/37701085","id":37701085,"diff_hunk":"@@ -119,6 +126,10 @@ protected void onCancelled() {\n     @Override\n     protected void onPreExecute() {\n         super.onPreExecute();\n+        // Acquire the wake lock before syncing to ensure CPU remains on until the sync completes.\n+        PowerManager pm = (PowerManager) AnkiDroidApp.getInstance().getApplicationContext().getSystemService(Context.POWER_SERVICE);","path":"AnkiDroid/src/main/java/com/ichi2/async/Connection.java","position":26,"original_position":26,"commit_id":"fbf043ff25f5b8189982ac32b9c4967e29db8912","original_commit_id":"fbf043ff25f5b8189982ac32b9c4967e29db8912","user":{"login":"timrae","id":2818274,"avatar_url":"https://avatars.githubusercontent.com/u/2818274?v=3","gravatar_id":"","url":"https://api.github.com/users/timrae","html_url":"https://github.com/timrae","followers_url":"https://api.github.com/users/timrae/followers","following_url":"https://api.github.com/users/timrae/following{/other_user}","gists_url":"https://api.github.com/users/timrae/gists{/gist_id}","starred_url":"https://api.github.com/users/timrae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timrae/subscriptions","organizations_url":"https://api.github.com/users/timrae/orgs","repos_url":"https://api.github.com/users/timrae/repos","events_url":"https://api.github.com/users/timrae/events{/privacy}","received_events_url":"https://api.github.com/users/timrae/received_events","type":"User","site_admin":false},"body":"If it's not too much trouble it would be good to break this up into two lines to stay within 120 characters/line","created_at":"2015-08-23T00:08:26Z","updated_at":"2015-08-23T00:08:26Z","html_url":"https://github.com/ankidroid/Anki-Android/pull/3618#discussion_r37701085","pull_request_url":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/3618","_links":{"self":{"href":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/comments/37701085"},"html":{"href":"https://github.com/ankidroid/Anki-Android/pull/3618#discussion_r37701085"},"pull_request":{"href":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/3618"}}},"pull_request":{"url":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/3618","id":43102188,"html_url":"https://github.com/ankidroid/Anki-Android/pull/3618","diff_url":"https://github.com/ankidroid/Anki-Android/pull/3618.diff","patch_url":"https://github.com/ankidroid/Anki-Android/pull/3618.patch","issue_url":"https://api.github.com/repos/ankidroid/Anki-Android/issues/3618","number":3618,"state":"open","locked":false,"title":"Use a wake lock during syncing","user":{"login":"hssm","id":789082,"avatar_url":"https://avatars.githubusercontent.com/u/789082?v=3","gravatar_id":"","url":"https://api.github.com/users/hssm","html_url":"https://github.com/hssm","followers_url":"https://api.github.com/users/hssm/followers","following_url":"https://api.github.com/users/hssm/following{/other_user}","gists_url":"https://api.github.com/users/hssm/gists{/gist_id}","starred_url":"https://api.github.com/users/hssm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hssm/subscriptions","organizations_url":"https://api.github.com/users/hssm/orgs","repos_url":"https://api.github.com/users/hssm/repos","events_url":"https://api.github.com/users/hssm/events{/privacy}","received_events_url":"https://api.github.com/users/hssm/received_events","type":"User","site_admin":false},"body":"A likely fix for #3574.\r\n\r\nWith this commit, we acquire and release a wake lock before and after syncing to ensure the device remains awake during sync so that the sync isn't interrupted.\r\n\r\nI'm surprised we weren't doing this already. I suppose syncing doesn't really take that long, and for most users it completes before the device is put into sleep mode (which, as I understand, can vary between devices and user settings), so it isn't a common occurrence.","created_at":"2015-08-22T11:32:19Z","updated_at":"2015-08-23T00:08:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"668f13f9a4b7327d2cc38a24c0597c208d15c948","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/3618/commits","review_comments_url":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/3618/comments","review_comment_url":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ankidroid/Anki-Android/issues/3618/comments","statuses_url":"https://api.github.com/repos/ankidroid/Anki-Android/statuses/fbf043ff25f5b8189982ac32b9c4967e29db8912","head":{"label":"hssm:wakelock","ref":"wakelock","sha":"fbf043ff25f5b8189982ac32b9c4967e29db8912","user":{"login":"hssm","id":789082,"avatar_url":"https://avatars.githubusercontent.com/u/789082?v=3","gravatar_id":"","url":"https://api.github.com/users/hssm","html_url":"https://github.com/hssm","followers_url":"https://api.github.com/users/hssm/followers","following_url":"https://api.github.com/users/hssm/following{/other_user}","gists_url":"https://api.github.com/users/hssm/gists{/gist_id}","starred_url":"https://api.github.com/users/hssm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hssm/subscriptions","organizations_url":"https://api.github.com/users/hssm/orgs","repos_url":"https://api.github.com/users/hssm/repos","events_url":"https://api.github.com/users/hssm/events{/privacy}","received_events_url":"https://api.github.com/users/hssm/received_events","type":"User","site_admin":false},"repo":{"id":7466821,"name":"Anki-Android","full_name":"hssm/Anki-Android","owner":{"login":"hssm","id":789082,"avatar_url":"https://avatars.githubusercontent.com/u/789082?v=3","gravatar_id":"","url":"https://api.github.com/users/hssm","html_url":"https://github.com/hssm","followers_url":"https://api.github.com/users/hssm/followers","following_url":"https://api.github.com/users/hssm/following{/other_user}","gists_url":"https://api.github.com/users/hssm/gists{/gist_id}","starred_url":"https://api.github.com/users/hssm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hssm/subscriptions","organizations_url":"https://api.github.com/users/hssm/orgs","repos_url":"https://api.github.com/users/hssm/repos","events_url":"https://api.github.com/users/hssm/events{/privacy}","received_events_url":"https://api.github.com/users/hssm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hssm/Anki-Android","description":"Anki on Android","fork":true,"url":"https://api.github.com/repos/hssm/Anki-Android","forks_url":"https://api.github.com/repos/hssm/Anki-Android/forks","keys_url":"https://api.github.com/repos/hssm/Anki-Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hssm/Anki-Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hssm/Anki-Android/teams","hooks_url":"https://api.github.com/repos/hssm/Anki-Android/hooks","issue_events_url":"https://api.github.com/repos/hssm/Anki-Android/issues/events{/number}","events_url":"https://api.github.com/repos/hssm/Anki-Android/events","assignees_url":"https://api.github.com/repos/hssm/Anki-Android/assignees{/user}","branches_url":"https://api.github.com/repos/hssm/Anki-Android/branches{/branch}","tags_url":"https://api.github.com/repos/hssm/Anki-Android/tags","blobs_url":"https://api.github.com/repos/hssm/Anki-Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hssm/Anki-Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hssm/Anki-Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/hssm/Anki-Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hssm/Anki-Android/statuses/{sha}","languages_url":"https://api.github.com/repos/hssm/Anki-Android/languages","stargazers_url":"https://api.github.com/repos/hssm/Anki-Android/stargazers","contributors_url":"https://api.github.com/repos/hssm/Anki-Android/contributors","subscribers_url":"https://api.github.com/repos/hssm/Anki-Android/subscribers","subscription_url":"https://api.github.com/repos/hssm/Anki-Android/subscription","commits_url":"https://api.github.com/repos/hssm/Anki-Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/hssm/Anki-Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/hssm/Anki-Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/hssm/Anki-Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/hssm/Anki-Android/contents/{+path}","compare_url":"https://api.github.com/repos/hssm/Anki-Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hssm/Anki-Android/merges","archive_url":"https://api.github.com/repos/hssm/Anki-Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hssm/Anki-Android/downloads","issues_url":"https://api.github.com/repos/hssm/Anki-Android/issues{/number}","pulls_url":"https://api.github.com/repos/hssm/Anki-Android/pulls{/number}","milestones_url":"https://api.github.com/repos/hssm/Anki-Android/milestones{/number}","notifications_url":"https://api.github.com/repos/hssm/Anki-Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hssm/Anki-Android/labels{/name}","releases_url":"https://api.github.com/repos/hssm/Anki-Android/releases{/id}","created_at":"2013-01-06T11:03:38Z","updated_at":"2014-06-24T03:35:21Z","pushed_at":"2015-08-22T11:25:09Z","git_url":"git://github.com/hssm/Anki-Android.git","ssh_url":"git@github.com:hssm/Anki-Android.git","clone_url":"https://github.com/hssm/Anki-Android.git","svn_url":"https://github.com/hssm/Anki-Android","homepage":"http://ichi2.net/anki/wiki/AndroidAnki","size":73844,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"ankidroid:develop","ref":"develop","sha":"394af883a3775590063a57567f7256d87d771220","user":{"login":"ankidroid","id":3320903,"avatar_url":"https://avatars.githubusercontent.com/u/3320903?v=3","gravatar_id":"","url":"https://api.github.com/users/ankidroid","html_url":"https://github.com/ankidroid","followers_url":"https://api.github.com/users/ankidroid/followers","following_url":"https://api.github.com/users/ankidroid/following{/other_user}","gists_url":"https://api.github.com/users/ankidroid/gists{/gist_id}","starred_url":"https://api.github.com/users/ankidroid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ankidroid/subscriptions","organizations_url":"https://api.github.com/users/ankidroid/orgs","repos_url":"https://api.github.com/users/ankidroid/repos","events_url":"https://api.github.com/users/ankidroid/events{/privacy}","received_events_url":"https://api.github.com/users/ankidroid/received_events","type":"Organization","site_admin":false},"repo":{"id":7716883,"name":"Anki-Android","full_name":"ankidroid/Anki-Android","owner":{"login":"ankidroid","id":3320903,"avatar_url":"https://avatars.githubusercontent.com/u/3320903?v=3","gravatar_id":"","url":"https://api.github.com/users/ankidroid","html_url":"https://github.com/ankidroid","followers_url":"https://api.github.com/users/ankidroid/followers","following_url":"https://api.github.com/users/ankidroid/following{/other_user}","gists_url":"https://api.github.com/users/ankidroid/gists{/gist_id}","starred_url":"https://api.github.com/users/ankidroid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ankidroid/subscriptions","organizations_url":"https://api.github.com/users/ankidroid/orgs","repos_url":"https://api.github.com/users/ankidroid/repos","events_url":"https://api.github.com/users/ankidroid/events{/privacy}","received_events_url":"https://api.github.com/users/ankidroid/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ankidroid/Anki-Android","description":"Anki on Android","fork":true,"url":"https://api.github.com/repos/ankidroid/Anki-Android","forks_url":"https://api.github.com/repos/ankidroid/Anki-Android/forks","keys_url":"https://api.github.com/repos/ankidroid/Anki-Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ankidroid/Anki-Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ankidroid/Anki-Android/teams","hooks_url":"https://api.github.com/repos/ankidroid/Anki-Android/hooks","issue_events_url":"https://api.github.com/repos/ankidroid/Anki-Android/issues/events{/number}","events_url":"https://api.github.com/repos/ankidroid/Anki-Android/events","assignees_url":"https://api.github.com/repos/ankidroid/Anki-Android/assignees{/user}","branches_url":"https://api.github.com/repos/ankidroid/Anki-Android/branches{/branch}","tags_url":"https://api.github.com/repos/ankidroid/Anki-Android/tags","blobs_url":"https://api.github.com/repos/ankidroid/Anki-Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ankidroid/Anki-Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ankidroid/Anki-Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/ankidroid/Anki-Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ankidroid/Anki-Android/statuses/{sha}","languages_url":"https://api.github.com/repos/ankidroid/Anki-Android/languages","stargazers_url":"https://api.github.com/repos/ankidroid/Anki-Android/stargazers","contributors_url":"https://api.github.com/repos/ankidroid/Anki-Android/contributors","subscribers_url":"https://api.github.com/repos/ankidroid/Anki-Android/subscribers","subscription_url":"https://api.github.com/repos/ankidroid/Anki-Android/subscription","commits_url":"https://api.github.com/repos/ankidroid/Anki-Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/ankidroid/Anki-Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/ankidroid/Anki-Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/ankidroid/Anki-Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/ankidroid/Anki-Android/contents/{+path}","compare_url":"https://api.github.com/repos/ankidroid/Anki-Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ankidroid/Anki-Android/merges","archive_url":"https://api.github.com/repos/ankidroid/Anki-Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ankidroid/Anki-Android/downloads","issues_url":"https://api.github.com/repos/ankidroid/Anki-Android/issues{/number}","pulls_url":"https://api.github.com/repos/ankidroid/Anki-Android/pulls{/number}","milestones_url":"https://api.github.com/repos/ankidroid/Anki-Android/milestones{/number}","notifications_url":"https://api.github.com/repos/ankidroid/Anki-Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ankidroid/Anki-Android/labels{/name}","releases_url":"https://api.github.com/repos/ankidroid/Anki-Android/releases{/id}","created_at":"2013-01-20T13:55:53Z","updated_at":"2015-08-19T09:48:57Z","pushed_at":"2015-08-22T23:59:55Z","git_url":"git://github.com/ankidroid/Anki-Android.git","ssh_url":"git@github.com:ankidroid/Anki-Android.git","clone_url":"https://github.com/ankidroid/Anki-Android.git","svn_url":"https://github.com/ankidroid/Anki-Android","homepage":"https://code.google.com/p/ankidroid/","size":136804,"stargazers_count":324,"watchers_count":324,"language":"Java","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":341,"mirror_url":null,"open_issues_count":378,"forks":341,"open_issues":378,"watchers":324,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/3618"},"html":{"href":"https://github.com/ankidroid/Anki-Android/pull/3618"},"issue":{"href":"https://api.github.com/repos/ankidroid/Anki-Android/issues/3618"},"comments":{"href":"https://api.github.com/repos/ankidroid/Anki-Android/issues/3618/comments"},"review_comments":{"href":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/3618/comments"},"review_comment":{"href":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ankidroid/Anki-Android/pulls/3618/commits"},"statuses":{"href":"https://api.github.com/repos/ankidroid/Anki-Android/statuses/fbf043ff25f5b8189982ac32b9c4967e29db8912"}}}}