{"action":"created","comment":{"url":"https://api.github.com/repos/syncthing/syncthing-android/pulls/comments/60229946","id":60229946,"diff_hunk":"@@ -0,0 +1,87 @@\n+package com.nutomic.syncthingandroid.syncthing;\n+\n+import android.app.Notification;\n+import android.app.NotificationManager;\n+import android.app.PendingIntent;\n+import android.content.BroadcastReceiver;\n+import android.content.Context;\n+import android.content.Intent;\n+import android.os.Build;\n+import android.support.v4.app.NotificationCompat;\n+\n+import com.nutomic.syncthingandroid.R;\n+import com.nutomic.syncthingandroid.activities.MainActivity;\n+\n+/**\n+ * Broadcast-receiver to control and configure SyncThing remotely\n+ *\n+ * Created by sqrt-1764 on 25.03.16.\n+ */\n+public class AppConfigReceiver extends BroadcastReceiver {\n+    private static final int ID_NOTIFICATION_BACKGROUND_ACTIVE = 2;\n+\n+    public static final String ACTION_START = \"com.nutomic.syncthingandroid.action.START\";\n+\n+    public static final String ACTION_STOP  = \"com.nutomic.syncthingandroid.action.STOP\";\n+\n+    @Override\n+    public void onReceive(Context context, Intent intent) {\n+        switch (intent.getAction()) {\n+            case ACTION_START:\n+                SyncthingHelper.startSynchthingService(context);\n+                break;\n+\n+            case ACTION_STOP:\n+                SyncthingHelper.stopSynchtingService(context);\n+                break;\n+        }\n+    }\n+\n+\n+    private static class SyncthingHelper {","path":"src/main/java/com/nutomic/syncthingandroid/syncthing/AppConfigReceiver.java","position":41,"original_position":41,"commit_id":"787753054ba793c20764034da989cec93147d1c1","original_commit_id":"787753054ba793c20764034da989cec93147d1c1","user":{"login":"sqrt-1764","id":16422347,"avatar_url":"https://avatars.githubusercontent.com/u/16422347?v=3","gravatar_id":"","url":"https://api.github.com/users/sqrt-1764","html_url":"https://github.com/sqrt-1764","followers_url":"https://api.github.com/users/sqrt-1764/followers","following_url":"https://api.github.com/users/sqrt-1764/following{/other_user}","gists_url":"https://api.github.com/users/sqrt-1764/gists{/gist_id}","starred_url":"https://api.github.com/users/sqrt-1764/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sqrt-1764/subscriptions","organizations_url":"https://api.github.com/users/sqrt-1764/orgs","repos_url":"https://api.github.com/users/sqrt-1764/repos","events_url":"https://api.github.com/users/sqrt-1764/events{/privacy}","received_events_url":"https://api.github.com/users/sqrt-1764/received_events","type":"User","site_admin":false},"body":"Currently, after removing the other stop-method this class isn't very necessary, I agree.\r\nSo I will now  move the code out of the class and directly to the switch statements.","created_at":"2016-04-19T13:27:48Z","updated_at":"2016-04-19T13:27:48Z","html_url":"https://github.com/syncthing/syncthing-android/pull/599#discussion_r60229946","pull_request_url":"https://api.github.com/repos/syncthing/syncthing-android/pulls/599","_links":{"self":{"href":"https://api.github.com/repos/syncthing/syncthing-android/pulls/comments/60229946"},"html":{"href":"https://github.com/syncthing/syncthing-android/pull/599#discussion_r60229946"},"pull_request":{"href":"https://api.github.com/repos/syncthing/syncthing-android/pulls/599"}}},"pull_request":{"url":"https://api.github.com/repos/syncthing/syncthing-android/pulls/599","id":64266746,"html_url":"https://github.com/syncthing/syncthing-android/pull/599","diff_url":"https://github.com/syncthing/syncthing-android/pull/599.diff","patch_url":"https://github.com/syncthing/syncthing-android/pull/599.patch","issue_url":"https://api.github.com/repos/syncthing/syncthing-android/issues/599","number":599,"state":"open","locked":false,"title":"Appconfig receiver","user":{"login":"sqrt-1764","id":16422347,"avatar_url":"https://avatars.githubusercontent.com/u/16422347?v=3","gravatar_id":"","url":"https://api.github.com/users/sqrt-1764","html_url":"https://github.com/sqrt-1764","followers_url":"https://api.github.com/users/sqrt-1764/followers","following_url":"https://api.github.com/users/sqrt-1764/following{/other_user}","gists_url":"https://api.github.com/users/sqrt-1764/gists{/gist_id}","starred_url":"https://api.github.com/users/sqrt-1764/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sqrt-1764/subscriptions","organizations_url":"https://api.github.com/users/sqrt-1764/orgs","repos_url":"https://api.github.com/users/sqrt-1764/repos","events_url":"https://api.github.com/users/sqrt-1764/events{/privacy}","received_events_url":"https://api.github.com/users/sqrt-1764/received_events","type":"User","site_admin":false},"body":"Reopened Pull-Request after renaming my branch.","created_at":"2016-03-27T14:26:07Z","updated_at":"2016-04-19T13:27:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ceb40ac7bcab984ed53a6cce77b7a8de7d185c65","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/syncthing/syncthing-android/pulls/599/commits","review_comments_url":"https://api.github.com/repos/syncthing/syncthing-android/pulls/599/comments","review_comment_url":"https://api.github.com/repos/syncthing/syncthing-android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/syncthing/syncthing-android/issues/599/comments","statuses_url":"https://api.github.com/repos/syncthing/syncthing-android/statuses/787753054ba793c20764034da989cec93147d1c1","head":{"label":"sqrt-1764:appconfig-receiver","ref":"appconfig-receiver","sha":"787753054ba793c20764034da989cec93147d1c1","user":{"login":"sqrt-1764","id":16422347,"avatar_url":"https://avatars.githubusercontent.com/u/16422347?v=3","gravatar_id":"","url":"https://api.github.com/users/sqrt-1764","html_url":"https://github.com/sqrt-1764","followers_url":"https://api.github.com/users/sqrt-1764/followers","following_url":"https://api.github.com/users/sqrt-1764/following{/other_user}","gists_url":"https://api.github.com/users/sqrt-1764/gists{/gist_id}","starred_url":"https://api.github.com/users/sqrt-1764/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sqrt-1764/subscriptions","organizations_url":"https://api.github.com/users/sqrt-1764/orgs","repos_url":"https://api.github.com/users/sqrt-1764/repos","events_url":"https://api.github.com/users/sqrt-1764/events{/privacy}","received_events_url":"https://api.github.com/users/sqrt-1764/received_events","type":"User","site_admin":false},"repo":{"id":54736868,"name":"syncthing-android","full_name":"sqrt-1764/syncthing-android","owner":{"login":"sqrt-1764","id":16422347,"avatar_url":"https://avatars.githubusercontent.com/u/16422347?v=3","gravatar_id":"","url":"https://api.github.com/users/sqrt-1764","html_url":"https://github.com/sqrt-1764","followers_url":"https://api.github.com/users/sqrt-1764/followers","following_url":"https://api.github.com/users/sqrt-1764/following{/other_user}","gists_url":"https://api.github.com/users/sqrt-1764/gists{/gist_id}","starred_url":"https://api.github.com/users/sqrt-1764/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sqrt-1764/subscriptions","organizations_url":"https://api.github.com/users/sqrt-1764/orgs","repos_url":"https://api.github.com/users/sqrt-1764/repos","events_url":"https://api.github.com/users/sqrt-1764/events{/privacy}","received_events_url":"https://api.github.com/users/sqrt-1764/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sqrt-1764/syncthing-android","description":"Wrapper of syncthing for Android.","fork":true,"url":"https://api.github.com/repos/sqrt-1764/syncthing-android","forks_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/forks","keys_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/teams","hooks_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/hooks","issue_events_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/issues/events{/number}","events_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/events","assignees_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/assignees{/user}","branches_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/branches{/branch}","tags_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/tags","blobs_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/statuses/{sha}","languages_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/languages","stargazers_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/stargazers","contributors_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/contributors","subscribers_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/subscribers","subscription_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/subscription","commits_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/contents/{+path}","compare_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/merges","archive_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/downloads","issues_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/issues{/number}","pulls_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/pulls{/number}","milestones_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/milestones{/number}","notifications_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/labels{/name}","releases_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/releases{/id}","deployments_url":"https://api.github.com/repos/sqrt-1764/syncthing-android/deployments","created_at":"2016-03-25T17:56:14Z","updated_at":"2016-03-25T17:56:17Z","pushed_at":"2016-04-14T10:31:43Z","git_url":"git://github.com/sqrt-1764/syncthing-android.git","ssh_url":"git@github.com:sqrt-1764/syncthing-android.git","clone_url":"https://github.com/sqrt-1764/syncthing-android.git","svn_url":"https://github.com/sqrt-1764/syncthing-android","homepage":"https://syncthing.net/","size":6923,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"syncthing:master","ref":"master","sha":"f4c15a98e6f58b36046d1c9c67ca8662f8e98924","user":{"login":"syncthing","id":7628018,"avatar_url":"https://avatars.githubusercontent.com/u/7628018?v=3","gravatar_id":"","url":"https://api.github.com/users/syncthing","html_url":"https://github.com/syncthing","followers_url":"https://api.github.com/users/syncthing/followers","following_url":"https://api.github.com/users/syncthing/following{/other_user}","gists_url":"https://api.github.com/users/syncthing/gists{/gist_id}","starred_url":"https://api.github.com/users/syncthing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syncthing/subscriptions","organizations_url":"https://api.github.com/users/syncthing/orgs","repos_url":"https://api.github.com/users/syncthing/repos","events_url":"https://api.github.com/users/syncthing/events{/privacy}","received_events_url":"https://api.github.com/users/syncthing/received_events","type":"Organization","site_admin":false},"repo":{"id":17089728,"name":"syncthing-android","full_name":"syncthing/syncthing-android","owner":{"login":"syncthing","id":7628018,"avatar_url":"https://avatars.githubusercontent.com/u/7628018?v=3","gravatar_id":"","url":"https://api.github.com/users/syncthing","html_url":"https://github.com/syncthing","followers_url":"https://api.github.com/users/syncthing/followers","following_url":"https://api.github.com/users/syncthing/following{/other_user}","gists_url":"https://api.github.com/users/syncthing/gists{/gist_id}","starred_url":"https://api.github.com/users/syncthing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syncthing/subscriptions","organizations_url":"https://api.github.com/users/syncthing/orgs","repos_url":"https://api.github.com/users/syncthing/repos","events_url":"https://api.github.com/users/syncthing/events{/privacy}","received_events_url":"https://api.github.com/users/syncthing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/syncthing/syncthing-android","description":"Wrapper of syncthing for Android.","fork":false,"url":"https://api.github.com/repos/syncthing/syncthing-android","forks_url":"https://api.github.com/repos/syncthing/syncthing-android/forks","keys_url":"https://api.github.com/repos/syncthing/syncthing-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/syncthing/syncthing-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/syncthing/syncthing-android/teams","hooks_url":"https://api.github.com/repos/syncthing/syncthing-android/hooks","issue_events_url":"https://api.github.com/repos/syncthing/syncthing-android/issues/events{/number}","events_url":"https://api.github.com/repos/syncthing/syncthing-android/events","assignees_url":"https://api.github.com/repos/syncthing/syncthing-android/assignees{/user}","branches_url":"https://api.github.com/repos/syncthing/syncthing-android/branches{/branch}","tags_url":"https://api.github.com/repos/syncthing/syncthing-android/tags","blobs_url":"https://api.github.com/repos/syncthing/syncthing-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/syncthing/syncthing-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/syncthing/syncthing-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/syncthing/syncthing-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/syncthing/syncthing-android/statuses/{sha}","languages_url":"https://api.github.com/repos/syncthing/syncthing-android/languages","stargazers_url":"https://api.github.com/repos/syncthing/syncthing-android/stargazers","contributors_url":"https://api.github.com/repos/syncthing/syncthing-android/contributors","subscribers_url":"https://api.github.com/repos/syncthing/syncthing-android/subscribers","subscription_url":"https://api.github.com/repos/syncthing/syncthing-android/subscription","commits_url":"https://api.github.com/repos/syncthing/syncthing-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/syncthing/syncthing-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/syncthing/syncthing-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/syncthing/syncthing-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/syncthing/syncthing-android/contents/{+path}","compare_url":"https://api.github.com/repos/syncthing/syncthing-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/syncthing/syncthing-android/merges","archive_url":"https://api.github.com/repos/syncthing/syncthing-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/syncthing/syncthing-android/downloads","issues_url":"https://api.github.com/repos/syncthing/syncthing-android/issues{/number}","pulls_url":"https://api.github.com/repos/syncthing/syncthing-android/pulls{/number}","milestones_url":"https://api.github.com/repos/syncthing/syncthing-android/milestones{/number}","notifications_url":"https://api.github.com/repos/syncthing/syncthing-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/syncthing/syncthing-android/labels{/name}","releases_url":"https://api.github.com/repos/syncthing/syncthing-android/releases{/id}","deployments_url":"https://api.github.com/repos/syncthing/syncthing-android/deployments","created_at":"2014-02-22T17:15:19Z","updated_at":"2016-04-19T09:44:37Z","pushed_at":"2016-04-19T13:06:42Z","git_url":"git://github.com/syncthing/syncthing-android.git","ssh_url":"git@github.com:syncthing/syncthing-android.git","clone_url":"https://github.com/syncthing/syncthing-android.git","svn_url":"https://github.com/syncthing/syncthing-android","homepage":"https://syncthing.net/","size":7217,"stargazers_count":511,"watchers_count":511,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":85,"mirror_url":null,"open_issues_count":54,"forks":85,"open_issues":54,"watchers":511,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/syncthing/syncthing-android/pulls/599"},"html":{"href":"https://github.com/syncthing/syncthing-android/pull/599"},"issue":{"href":"https://api.github.com/repos/syncthing/syncthing-android/issues/599"},"comments":{"href":"https://api.github.com/repos/syncthing/syncthing-android/issues/599/comments"},"review_comments":{"href":"https://api.github.com/repos/syncthing/syncthing-android/pulls/599/comments"},"review_comment":{"href":"https://api.github.com/repos/syncthing/syncthing-android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/syncthing/syncthing-android/pulls/599/commits"},"statuses":{"href":"https://api.github.com/repos/syncthing/syncthing-android/statuses/787753054ba793c20764034da989cec93147d1c1"}}}}