{"action":"created","comment":{"url":"https://api.github.com/repos/material-foundation/material-remixer-android/pulls/comments/95624153","pull_request_review_id":16185756,"id":95624153,"diff_hunk":"@@ -0,0 +1,86 @@\n+/*\n+ * Copyright 2017 Google Inc.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package com.google.android.libraries.remixer.storage;\n+\n+import android.content.Context;\n+import com.google.android.libraries.remixer.Remixer;\n+import com.google.android.libraries.remixer.Variable;\n+import com.google.android.libraries.remixer.sync.LocalValueSyncing;\n+import com.google.android.libraries.remixer.sync.SynchronizationMechanism;\n+import java.lang.ref.WeakReference;\n+\n+/**\n+ * A {@link SynchronizationMechanism} that syncs up to a firebase Remote Controller.\n+ *\n+ * <p>This synchronization mechanism assumes that the local host is the source of truth, so it does\n+ * very little in terms of conflict resolution.\n+ */\n+public class FirebaseRemoteControllerSyncer extends LocalValueSyncing {\n+\n+  WeakReference<Object> context;\n+\n+  public FirebaseRemoteControllerSyncer(Context context) {\n+    super();\n+  }\n+\n+  /**\n+   * Syncs a variable up to the remote controller.\n+   */\n+  private void syncVariableToRemoteController (Variable variable) {\n+    // TODO(miguely): write controller sync logic\n+  }\n+\n+  /**\n+   * Clears all the data in a remote\n+   */\n+  private void clearVariablesInRemoteController() {\n+    // TODO(miguely): write controller sync logic\n+  }\n+\n+  @Override\n+  public void onAddingVariable(Variable variable) {\n+    super.onAddingVariable(variable);\n+    syncVariableToRemoteController(variable);\n+  }\n+\n+  @Override\n+  public void onValueChanged(Variable variable) {\n+    super.onValueChanged(variable);\n+    syncVariableToRemoteController(variable);\n+  }\n+\n+  @Override\n+  public void onContextChanged(Object currentContext) {","path":"remixer_storage/src/main/java/com/google/android/libraries/remixer/storage/FirebaseRemoteControllerSyncer.java","position":67,"original_position":67,"commit_id":"985bcb21d45fa7d56cd47fc107d201e83ed184e1","original_commit_id":"985bcb21d45fa7d56cd47fc107d201e83ed184e1","user":{"login":"miguelandres","id":160168,"avatar_url":"https://avatars.githubusercontent.com/u/160168?v=3","gravatar_id":"","url":"https://api.github.com/users/miguelandres","html_url":"https://github.com/miguelandres","followers_url":"https://api.github.com/users/miguelandres/followers","following_url":"https://api.github.com/users/miguelandres/following{/other_user}","gists_url":"https://api.github.com/users/miguelandres/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelandres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelandres/subscriptions","organizations_url":"https://api.github.com/users/miguelandres/orgs","repos_url":"https://api.github.com/users/miguelandres/repos","events_url":"https://api.github.com/users/miguelandres/events{/privacy}","received_events_url":"https://api.github.com/users/miguelandres/received_events","type":"User","site_admin":false},"body":"And in the class javadoc","created_at":"2017-01-11T17:05:55Z","updated_at":"2017-01-11T17:05:55Z","html_url":"https://github.com/material-foundation/material-remixer-android/pull/110#discussion_r95624153","pull_request_url":"https://api.github.com/repos/material-foundation/material-remixer-android/pulls/110","_links":{"self":{"href":"https://api.github.com/repos/material-foundation/material-remixer-android/pulls/comments/95624153"},"html":{"href":"https://github.com/material-foundation/material-remixer-android/pull/110#discussion_r95624153"},"pull_request":{"href":"https://api.github.com/repos/material-foundation/material-remixer-android/pulls/110"}}},"pull_request":{"url":"https://api.github.com/repos/material-foundation/material-remixer-android/pulls/110","id":100907383,"html_url":"https://github.com/material-foundation/material-remixer-android/pull/110","diff_url":"https://github.com/material-foundation/material-remixer-android/pull/110.diff","patch_url":"https://github.com/material-foundation/material-remixer-android/pull/110.patch","issue_url":"https://api.github.com/repos/material-foundation/material-remixer-android/issues/110","number":110,"state":"open","locked":false,"title":"Track current context","user":{"login":"miguelandres","id":160168,"avatar_url":"https://avatars.githubusercontent.com/u/160168?v=3","gravatar_id":"","url":"https://api.github.com/users/miguelandres","html_url":"https://github.com/miguelandres","followers_url":"https://api.github.com/users/miguelandres/followers","following_url":"https://api.github.com/users/miguelandres/following{/other_user}","gists_url":"https://api.github.com/users/miguelandres/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelandres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelandres/subscriptions","organizations_url":"https://api.github.com/users/miguelandres/orgs","repos_url":"https://api.github.com/users/miguelandres/repos","events_url":"https://api.github.com/users/miguelandres/events{/privacy}","received_events_url":"https://api.github.com/users/miguelandres/received_events","type":"User","site_admin":false},"body":"Add framework to keep track of the current context in Sync mechanism. This still does not sync to firebase but that's coming.","created_at":"2017-01-10T16:31:13Z","updated_at":"2017-01-11T17:05:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d26e898f7a644c4cdc8133f7b7feb72a2fee67ec","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/material-foundation/material-remixer-android/pulls/110/commits","review_comments_url":"https://api.github.com/repos/material-foundation/material-remixer-android/pulls/110/comments","review_comment_url":"https://api.github.com/repos/material-foundation/material-remixer-android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/material-foundation/material-remixer-android/issues/110/comments","statuses_url":"https://api.github.com/repos/material-foundation/material-remixer-android/statuses/985bcb21d45fa7d56cd47fc107d201e83ed184e1","head":{"label":"material-foundation:track_current_context","ref":"track_current_context","sha":"985bcb21d45fa7d56cd47fc107d201e83ed184e1","user":{"login":"material-foundation","id":19556314,"avatar_url":"https://avatars.githubusercontent.com/u/19556314?v=3","gravatar_id":"","url":"https://api.github.com/users/material-foundation","html_url":"https://github.com/material-foundation","followers_url":"https://api.github.com/users/material-foundation/followers","following_url":"https://api.github.com/users/material-foundation/following{/other_user}","gists_url":"https://api.github.com/users/material-foundation/gists{/gist_id}","starred_url":"https://api.github.com/users/material-foundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/material-foundation/subscriptions","organizations_url":"https://api.github.com/users/material-foundation/orgs","repos_url":"https://api.github.com/users/material-foundation/repos","events_url":"https://api.github.com/users/material-foundation/events{/privacy}","received_events_url":"https://api.github.com/users/material-foundation/received_events","type":"Organization","site_admin":false},"repo":{"id":65853610,"name":"material-remixer-android","full_name":"material-foundation/material-remixer-android","owner":{"login":"material-foundation","id":19556314,"avatar_url":"https://avatars.githubusercontent.com/u/19556314?v=3","gravatar_id":"","url":"https://api.github.com/users/material-foundation","html_url":"https://github.com/material-foundation","followers_url":"https://api.github.com/users/material-foundation/followers","following_url":"https://api.github.com/users/material-foundation/following{/other_user}","gists_url":"https://api.github.com/users/material-foundation/gists{/gist_id}","starred_url":"https://api.github.com/users/material-foundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/material-foundation/subscriptions","organizations_url":"https://api.github.com/users/material-foundation/orgs","repos_url":"https://api.github.com/users/material-foundation/repos","events_url":"https://api.github.com/users/material-foundation/events{/privacy}","received_events_url":"https://api.github.com/users/material-foundation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/material-foundation/material-remixer-android","description":"Remixer is a set of Android libraries and protocols to allow live adjustment of apps and prototypes during the development process.","fork":false,"url":"https://api.github.com/repos/material-foundation/material-remixer-android","forks_url":"https://api.github.com/repos/material-foundation/material-remixer-android/forks","keys_url":"https://api.github.com/repos/material-foundation/material-remixer-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/material-foundation/material-remixer-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/material-foundation/material-remixer-android/teams","hooks_url":"https://api.github.com/repos/material-foundation/material-remixer-android/hooks","issue_events_url":"https://api.github.com/repos/material-foundation/material-remixer-android/issues/events{/number}","events_url":"https://api.github.com/repos/material-foundation/material-remixer-android/events","assignees_url":"https://api.github.com/repos/material-foundation/material-remixer-android/assignees{/user}","branches_url":"https://api.github.com/repos/material-foundation/material-remixer-android/branches{/branch}","tags_url":"https://api.github.com/repos/material-foundation/material-remixer-android/tags","blobs_url":"https://api.github.com/repos/material-foundation/material-remixer-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/material-foundation/material-remixer-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/material-foundation/material-remixer-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/material-foundation/material-remixer-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/material-foundation/material-remixer-android/statuses/{sha}","languages_url":"https://api.github.com/repos/material-foundation/material-remixer-android/languages","stargazers_url":"https://api.github.com/repos/material-foundation/material-remixer-android/stargazers","contributors_url":"https://api.github.com/repos/material-foundation/material-remixer-android/contributors","subscribers_url":"https://api.github.com/repos/material-foundation/material-remixer-android/subscribers","subscription_url":"https://api.github.com/repos/material-foundation/material-remixer-android/subscription","commits_url":"https://api.github.com/repos/material-foundation/material-remixer-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/material-foundation/material-remixer-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/material-foundation/material-remixer-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/material-foundation/material-remixer-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/material-foundation/material-remixer-android/contents/{+path}","compare_url":"https://api.github.com/repos/material-foundation/material-remixer-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/material-foundation/material-remixer-android/merges","archive_url":"https://api.github.com/repos/material-foundation/material-remixer-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/material-foundation/material-remixer-android/downloads","issues_url":"https://api.github.com/repos/material-foundation/material-remixer-android/issues{/number}","pulls_url":"https://api.github.com/repos/material-foundation/material-remixer-android/pulls{/number}","milestones_url":"https://api.github.com/repos/material-foundation/material-remixer-android/milestones{/number}","notifications_url":"https://api.github.com/repos/material-foundation/material-remixer-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/material-foundation/material-remixer-android/labels{/name}","releases_url":"https://api.github.com/repos/material-foundation/material-remixer-android/releases{/id}","deployments_url":"https://api.github.com/repos/material-foundation/material-remixer-android/deployments","created_at":"2016-08-16T21:04:44Z","updated_at":"2017-01-11T08:56:02Z","pushed_at":"2017-01-10T17:27:42Z","git_url":"git://github.com/material-foundation/material-remixer-android.git","ssh_url":"git@github.com:material-foundation/material-remixer-android.git","clone_url":"https://github.com/material-foundation/material-remixer-android.git","svn_url":"https://github.com/material-foundation/material-remixer-android","homepage":"","size":710,"stargazers_count":253,"watchers_count":253,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":16,"forks":15,"open_issues":16,"watchers":253,"default_branch":"develop"}},"base":{"label":"material-foundation:develop","ref":"develop","sha":"897b47ee166943d23e0af54ae3701ff770457ebb","user":{"login":"material-foundation","id":19556314,"avatar_url":"https://avatars.githubusercontent.com/u/19556314?v=3","gravatar_id":"","url":"https://api.github.com/users/material-foundation","html_url":"https://github.com/material-foundation","followers_url":"https://api.github.com/users/material-foundation/followers","following_url":"https://api.github.com/users/material-foundation/following{/other_user}","gists_url":"https://api.github.com/users/material-foundation/gists{/gist_id}","starred_url":"https://api.github.com/users/material-foundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/material-foundation/subscriptions","organizations_url":"https://api.github.com/users/material-foundation/orgs","repos_url":"https://api.github.com/users/material-foundation/repos","events_url":"https://api.github.com/users/material-foundation/events{/privacy}","received_events_url":"https://api.github.com/users/material-foundation/received_events","type":"Organization","site_admin":false},"repo":{"id":65853610,"name":"material-remixer-android","full_name":"material-foundation/material-remixer-android","owner":{"login":"material-foundation","id":19556314,"avatar_url":"https://avatars.githubusercontent.com/u/19556314?v=3","gravatar_id":"","url":"https://api.github.com/users/material-foundation","html_url":"https://github.com/material-foundation","followers_url":"https://api.github.com/users/material-foundation/followers","following_url":"https://api.github.com/users/material-foundation/following{/other_user}","gists_url":"https://api.github.com/users/material-foundation/gists{/gist_id}","starred_url":"https://api.github.com/users/material-foundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/material-foundation/subscriptions","organizations_url":"https://api.github.com/users/material-foundation/orgs","repos_url":"https://api.github.com/users/material-foundation/repos","events_url":"https://api.github.com/users/material-foundation/events{/privacy}","received_events_url":"https://api.github.com/users/material-foundation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/material-foundation/material-remixer-android","description":"Remixer is a set of Android libraries and protocols to allow live adjustment of apps and prototypes during the development process.","fork":false,"url":"https://api.github.com/repos/material-foundation/material-remixer-android","forks_url":"https://api.github.com/repos/material-foundation/material-remixer-android/forks","keys_url":"https://api.github.com/repos/material-foundation/material-remixer-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/material-foundation/material-remixer-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/material-foundation/material-remixer-android/teams","hooks_url":"https://api.github.com/repos/material-foundation/material-remixer-android/hooks","issue_events_url":"https://api.github.com/repos/material-foundation/material-remixer-android/issues/events{/number}","events_url":"https://api.github.com/repos/material-foundation/material-remixer-android/events","assignees_url":"https://api.github.com/repos/material-foundation/material-remixer-android/assignees{/user}","branches_url":"https://api.github.com/repos/material-foundation/material-remixer-android/branches{/branch}","tags_url":"https://api.github.com/repos/material-foundation/material-remixer-android/tags","blobs_url":"https://api.github.com/repos/material-foundation/material-remixer-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/material-foundation/material-remixer-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/material-foundation/material-remixer-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/material-foundation/material-remixer-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/material-foundation/material-remixer-android/statuses/{sha}","languages_url":"https://api.github.com/repos/material-foundation/material-remixer-android/languages","stargazers_url":"https://api.github.com/repos/material-foundation/material-remixer-android/stargazers","contributors_url":"https://api.github.com/repos/material-foundation/material-remixer-android/contributors","subscribers_url":"https://api.github.com/repos/material-foundation/material-remixer-android/subscribers","subscription_url":"https://api.github.com/repos/material-foundation/material-remixer-android/subscription","commits_url":"https://api.github.com/repos/material-foundation/material-remixer-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/material-foundation/material-remixer-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/material-foundation/material-remixer-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/material-foundation/material-remixer-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/material-foundation/material-remixer-android/contents/{+path}","compare_url":"https://api.github.com/repos/material-foundation/material-remixer-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/material-foundation/material-remixer-android/merges","archive_url":"https://api.github.com/repos/material-foundation/material-remixer-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/material-foundation/material-remixer-android/downloads","issues_url":"https://api.github.com/repos/material-foundation/material-remixer-android/issues{/number}","pulls_url":"https://api.github.com/repos/material-foundation/material-remixer-android/pulls{/number}","milestones_url":"https://api.github.com/repos/material-foundation/material-remixer-android/milestones{/number}","notifications_url":"https://api.github.com/repos/material-foundation/material-remixer-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/material-foundation/material-remixer-android/labels{/name}","releases_url":"https://api.github.com/repos/material-foundation/material-remixer-android/releases{/id}","deployments_url":"https://api.github.com/repos/material-foundation/material-remixer-android/deployments","created_at":"2016-08-16T21:04:44Z","updated_at":"2017-01-11T08:56:02Z","pushed_at":"2017-01-10T17:27:42Z","git_url":"git://github.com/material-foundation/material-remixer-android.git","ssh_url":"git@github.com:material-foundation/material-remixer-android.git","clone_url":"https://github.com/material-foundation/material-remixer-android.git","svn_url":"https://github.com/material-foundation/material-remixer-android","homepage":"","size":710,"stargazers_count":253,"watchers_count":253,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":16,"forks":15,"open_issues":16,"watchers":253,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/material-foundation/material-remixer-android/pulls/110"},"html":{"href":"https://github.com/material-foundation/material-remixer-android/pull/110"},"issue":{"href":"https://api.github.com/repos/material-foundation/material-remixer-android/issues/110"},"comments":{"href":"https://api.github.com/repos/material-foundation/material-remixer-android/issues/110/comments"},"review_comments":{"href":"https://api.github.com/repos/material-foundation/material-remixer-android/pulls/110/comments"},"review_comment":{"href":"https://api.github.com/repos/material-foundation/material-remixer-android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/material-foundation/material-remixer-android/pulls/110/commits"},"statuses":{"href":"https://api.github.com/repos/material-foundation/material-remixer-android/statuses/985bcb21d45fa7d56cd47fc107d201e83ed184e1"}}}}
{"actor":{"display_login":"miguelandres"}}