{"action":"created","comment":{"url":"https://api.github.com/repos/mapsme/omim/pulls/comments/213277108","pull_request_review_id":150066558,"id":213277108,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMzI3NzEwOA==","diff_hunk":"@@ -0,0 +1,199 @@\n+package com.mapswithme.maps.scheduling;\n+\n+import android.annotation.TargetApi;\n+import android.app.job.JobInfo;\n+import android.app.job.JobScheduler;\n+import android.content.ComponentName;\n+import android.content.Context;\n+import android.content.IntentFilter;\n+import android.net.ConnectivityManager;\n+import android.net.NetworkInfo;\n+import android.os.Build;\n+import android.support.annotation.NonNull;\n+\n+import com.mapswithme.maps.MwmApplication;\n+import com.mapswithme.maps.background.ConnectivityChangedReceiver;\n+\n+import java.util.Objects;\n+import java.util.concurrent.atomic.AtomicInteger;\n+\n+public class JobDispatcherComposite implements JobDispatcher\n+{\n+  @NonNull\n+  private final JobDispatcher mMasterJobDispatcher;\n+\n+  @NonNull\n+  private final MwmApplication mContext;\n+\n+  @NonNull\n+  private final AtomicInteger mCurrentNetworkType;\n+\n+  public JobDispatcherComposite(@NonNull MwmApplication context)\n+  {\n+    mContext = context;\n+    mMasterJobDispatcher = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP\n+                           ? new NativeJobDispatcher(mContext)\n+                           : new LegacyJobDispatcher(mContext);","path":"android/src/com/mapswithme/maps/scheduling/JobDispatcherComposite.java","position":36,"original_position":36,"commit_id":"e42ae11b205bc6d23b340b1b4a9dd302ddd4d34e","original_commit_id":"e42ae11b205bc6d23b340b1b4a9dd302ddd4d34e","user":{"login":"alexzatsepin","id":8442156,"node_id":"MDQ6VXNlcjg0NDIxNTY=","avatar_url":"https://avatars2.githubusercontent.com/u/8442156?v=4","gravatar_id":"","url":"https://api.github.com/users/alexzatsepin","html_url":"https://github.com/alexzatsepin","followers_url":"https://api.github.com/users/alexzatsepin/followers","following_url":"https://api.github.com/users/alexzatsepin/following{/other_user}","gists_url":"https://api.github.com/users/alexzatsepin/gists{/gist_id}","starred_url":"https://api.github.com/users/alexzatsepin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexzatsepin/subscriptions","organizations_url":"https://api.github.com/users/alexzatsepin/orgs","repos_url":"https://api.github.com/users/alexzatsepin/repos","events_url":"https://api.github.com/users/alexzatsepin/events{/privacy}","received_events_url":"https://api.github.com/users/alexzatsepin/received_events","type":"User","site_admin":false},"body":"На мой взгляд, немножко перестарался с логикой мастера и композитом. Я бы еще понял, если бы была необходимость в рантайме переключать мастера. Но в в нашем случае, я бы делегировал создание нужного диспетчера фабрики. И снаружи бы просто вызывал метод фабрики \"дай мне диспетчера) (Factory.createConnectivityDispatcher) и все. А Composite класс пока кажется лишним, т.к. по факту его отвественность только в получении и запоминании networktype. И скорее всего currentNetworkType можно просто унести в конкретные диспатчеры.","created_at":"2018-08-28T11:33:37Z","updated_at":"2018-08-28T11:53:37Z","html_url":"https://github.com/mapsme/omim/pull/9362#discussion_r213277108","pull_request_url":"https://api.github.com/repos/mapsme/omim/pulls/9362","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments/213277108"},"html":{"href":"https://github.com/mapsme/omim/pull/9362#discussion_r213277108"},"pull_request":{"href":"https://api.github.com/repos/mapsme/omim/pulls/9362"}}},"pull_request":{"url":"https://api.github.com/repos/mapsme/omim/pulls/9362","id":211143269,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExMTQzMjY5","html_url":"https://github.com/mapsme/omim/pull/9362","diff_url":"https://github.com/mapsme/omim/pull/9362.diff","patch_url":"https://github.com/mapsme/omim/pull/9362.patch","issue_url":"https://api.github.com/repos/mapsme/omim/issues/9362","number":9362,"state":"open","locked":false,"title":"[android] [DNM] Modified implicit receivers for lollipop or later","user":{"login":"yoksnod","id":7882140,"node_id":"MDQ6VXNlcjc4ODIxNDA=","avatar_url":"https://avatars3.githubusercontent.com/u/7882140?v=4","gravatar_id":"","url":"https://api.github.com/users/yoksnod","html_url":"https://github.com/yoksnod","followers_url":"https://api.github.com/users/yoksnod/followers","following_url":"https://api.github.com/users/yoksnod/following{/other_user}","gists_url":"https://api.github.com/users/yoksnod/gists{/gist_id}","starred_url":"https://api.github.com/users/yoksnod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yoksnod/subscriptions","organizations_url":"https://api.github.com/users/yoksnod/orgs","repos_url":"https://api.github.com/users/yoksnod/repos","events_url":"https://api.github.com/users/yoksnod/events{/privacy}","received_events_url":"https://api.github.com/users/yoksnod/received_events","type":"User","site_admin":false},"body":"https://jira.mail.ru/browse/MAPSME-8419","created_at":"2018-08-27T15:21:32Z","updated_at":"2018-08-28T11:53:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"882792261df96f1591abfaab79e1ffd2dd6d392f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mapsme/omim/pulls/9362/commits","review_comments_url":"https://api.github.com/repos/mapsme/omim/pulls/9362/comments","review_comment_url":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapsme/omim/issues/9362/comments","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/e42ae11b205bc6d23b340b1b4a9dd302ddd4d34e","head":{"label":"yoksnod:MAPSME-8419-receivers","ref":"MAPSME-8419-receivers","sha":"e42ae11b205bc6d23b340b1b4a9dd302ddd4d34e","user":{"login":"yoksnod","id":7882140,"node_id":"MDQ6VXNlcjc4ODIxNDA=","avatar_url":"https://avatars3.githubusercontent.com/u/7882140?v=4","gravatar_id":"","url":"https://api.github.com/users/yoksnod","html_url":"https://github.com/yoksnod","followers_url":"https://api.github.com/users/yoksnod/followers","following_url":"https://api.github.com/users/yoksnod/following{/other_user}","gists_url":"https://api.github.com/users/yoksnod/gists{/gist_id}","starred_url":"https://api.github.com/users/yoksnod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yoksnod/subscriptions","organizations_url":"https://api.github.com/users/yoksnod/orgs","repos_url":"https://api.github.com/users/yoksnod/repos","events_url":"https://api.github.com/users/yoksnod/events{/privacy}","received_events_url":"https://api.github.com/users/yoksnod/received_events","type":"User","site_admin":false},"repo":{"id":133353419,"node_id":"MDEwOlJlcG9zaXRvcnkxMzMzNTM0MTk=","name":"omim","full_name":"yoksnod/omim","owner":{"login":"yoksnod","id":7882140,"node_id":"MDQ6VXNlcjc4ODIxNDA=","avatar_url":"https://avatars3.githubusercontent.com/u/7882140?v=4","gravatar_id":"","url":"https://api.github.com/users/yoksnod","html_url":"https://github.com/yoksnod","followers_url":"https://api.github.com/users/yoksnod/followers","following_url":"https://api.github.com/users/yoksnod/following{/other_user}","gists_url":"https://api.github.com/users/yoksnod/gists{/gist_id}","starred_url":"https://api.github.com/users/yoksnod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yoksnod/subscriptions","organizations_url":"https://api.github.com/users/yoksnod/orgs","repos_url":"https://api.github.com/users/yoksnod/repos","events_url":"https://api.github.com/users/yoksnod/events{/privacy}","received_events_url":"https://api.github.com/users/yoksnod/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yoksnod/omim","description":"🗺️ MAPS.ME — Offline OpenStreetMap maps for iOS and Android","fork":true,"url":"https://api.github.com/repos/yoksnod/omim","forks_url":"https://api.github.com/repos/yoksnod/omim/forks","keys_url":"https://api.github.com/repos/yoksnod/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yoksnod/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yoksnod/omim/teams","hooks_url":"https://api.github.com/repos/yoksnod/omim/hooks","issue_events_url":"https://api.github.com/repos/yoksnod/omim/issues/events{/number}","events_url":"https://api.github.com/repos/yoksnod/omim/events","assignees_url":"https://api.github.com/repos/yoksnod/omim/assignees{/user}","branches_url":"https://api.github.com/repos/yoksnod/omim/branches{/branch}","tags_url":"https://api.github.com/repos/yoksnod/omim/tags","blobs_url":"https://api.github.com/repos/yoksnod/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yoksnod/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yoksnod/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/yoksnod/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yoksnod/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/yoksnod/omim/languages","stargazers_url":"https://api.github.com/repos/yoksnod/omim/stargazers","contributors_url":"https://api.github.com/repos/yoksnod/omim/contributors","subscribers_url":"https://api.github.com/repos/yoksnod/omim/subscribers","subscription_url":"https://api.github.com/repos/yoksnod/omim/subscription","commits_url":"https://api.github.com/repos/yoksnod/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/yoksnod/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/yoksnod/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/yoksnod/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/yoksnod/omim/contents/{+path}","compare_url":"https://api.github.com/repos/yoksnod/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yoksnod/omim/merges","archive_url":"https://api.github.com/repos/yoksnod/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yoksnod/omim/downloads","issues_url":"https://api.github.com/repos/yoksnod/omim/issues{/number}","pulls_url":"https://api.github.com/repos/yoksnod/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/yoksnod/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/yoksnod/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yoksnod/omim/labels{/name}","releases_url":"https://api.github.com/repos/yoksnod/omim/releases{/id}","deployments_url":"https://api.github.com/repos/yoksnod/omim/deployments","created_at":"2018-05-14T11:54:44Z","updated_at":"2018-06-27T16:27:28Z","pushed_at":"2018-08-28T09:21:24Z","git_url":"git://github.com/yoksnod/omim.git","ssh_url":"git@github.com:yoksnod/omim.git","clone_url":"https://github.com/yoksnod/omim.git","svn_url":"https://github.com/yoksnod/omim","homepage":"","size":4051251,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"mapsme:master","ref":"master","sha":"f48d58f856e78b76ab17272b728ae61db83fc4f3","user":{"login":"mapsme","id":14185141,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTg1MTQx","avatar_url":"https://avatars1.githubusercontent.com/u/14185141?v=4","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"repo":{"id":42798033,"node_id":"MDEwOlJlcG9zaXRvcnk0Mjc5ODAzMw==","name":"omim","full_name":"mapsme/omim","owner":{"login":"mapsme","id":14185141,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTg1MTQx","avatar_url":"https://avatars1.githubusercontent.com/u/14185141?v=4","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapsme/omim","description":"🗺️ MAPS.ME — Offline OpenStreetMap maps for iOS and Android","fork":false,"url":"https://api.github.com/repos/mapsme/omim","forks_url":"https://api.github.com/repos/mapsme/omim/forks","keys_url":"https://api.github.com/repos/mapsme/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapsme/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapsme/omim/teams","hooks_url":"https://api.github.com/repos/mapsme/omim/hooks","issue_events_url":"https://api.github.com/repos/mapsme/omim/issues/events{/number}","events_url":"https://api.github.com/repos/mapsme/omim/events","assignees_url":"https://api.github.com/repos/mapsme/omim/assignees{/user}","branches_url":"https://api.github.com/repos/mapsme/omim/branches{/branch}","tags_url":"https://api.github.com/repos/mapsme/omim/tags","blobs_url":"https://api.github.com/repos/mapsme/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapsme/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapsme/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapsme/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/mapsme/omim/languages","stargazers_url":"https://api.github.com/repos/mapsme/omim/stargazers","contributors_url":"https://api.github.com/repos/mapsme/omim/contributors","subscribers_url":"https://api.github.com/repos/mapsme/omim/subscribers","subscription_url":"https://api.github.com/repos/mapsme/omim/subscription","commits_url":"https://api.github.com/repos/mapsme/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapsme/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapsme/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapsme/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapsme/omim/contents/{+path}","compare_url":"https://api.github.com/repos/mapsme/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapsme/omim/merges","archive_url":"https://api.github.com/repos/mapsme/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapsme/omim/downloads","issues_url":"https://api.github.com/repos/mapsme/omim/issues{/number}","pulls_url":"https://api.github.com/repos/mapsme/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/mapsme/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/mapsme/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapsme/omim/labels{/name}","releases_url":"https://api.github.com/repos/mapsme/omim/releases{/id}","deployments_url":"https://api.github.com/repos/mapsme/omim/deployments","created_at":"2015-09-20T02:57:13Z","updated_at":"2018-08-28T10:07:20Z","pushed_at":"2018-08-28T11:24:57Z","git_url":"git://github.com/mapsme/omim.git","ssh_url":"git@github.com:mapsme/omim.git","clone_url":"https://github.com/mapsme/omim.git","svn_url":"https://github.com/mapsme/omim","homepage":"","size":4054567,"stargazers_count":2759,"watchers_count":2759,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":597,"mirror_url":null,"archived":false,"open_issues_count":730,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":597,"open_issues":730,"watchers":2759,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/9362"},"html":{"href":"https://github.com/mapsme/omim/pull/9362"},"issue":{"href":"https://api.github.com/repos/mapsme/omim/issues/9362"},"comments":{"href":"https://api.github.com/repos/mapsme/omim/issues/9362/comments"},"review_comments":{"href":"https://api.github.com/repos/mapsme/omim/pulls/9362/comments"},"review_comment":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapsme/omim/pulls/9362/commits"},"statuses":{"href":"https://api.github.com/repos/mapsme/omim/statuses/e42ae11b205bc6d23b340b1b4a9dd302ddd4d34e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"alexzatsepin"}}