{"action":"created","comment":{"url":"https://api.github.com/repos/eliperelman/node-mozdevice/pulls/comments/23481976","id":23481976,"diff_hunk":"@@ -0,0 +1,65 @@\n+var Command = require('./command');\n+var debug = require('debug')('mozdevice:util');\n+\n+/**\n+ * Miscella\n+ * @param device\n+ * @constructor\n+ */\n+var Util = function(device) {\n+  this.serial = device.serial;\n+};\n+\n+/**\n+ * Reboot the device and fetch the device time at the moment it occurred\n+ * @returns {Promise}\n+ */\n+Util.prototype.reboot = function() {\n+  debug('Rebooting');\n+\n+  return new Command()\n+    .env('DEVICETIME',\n+      \"$(ANDROID_SERIAL=\" + this.serial + \" adb shell echo '$EPOCHREALTIME')\")\n+    .and()\n+      .env('ANDROID_SERIAL', this.serial)\n+      .adb('reboot')\n+    .and()\n+      .env('ANDROID_SERIAL', this.serial)\n+      .adb('wait-for-device')\n+    .and()\n+      .echo('$DEVICETIME')\n+    .exec()\n+    .then(function(stdout) {\n+      // The time generated by EPOCHREALTIME is seconds, we need milliseconds\n+      return parseFloat(stdout.replace('\\n', '')) * 1000;","path":"util.js","position":34,"original_position":34,"commit_id":"720f6006842cae120fd0139b788ce647ae062d69","original_commit_id":"720f6006842cae120fd0139b788ce647ae062d69","user":{"login":"rwood-moz","id":2198968,"avatar_url":"https://avatars.githubusercontent.com/u/2198968?v=3","gravatar_id":"","url":"https://api.github.com/users/rwood-moz","html_url":"https://github.com/rwood-moz","followers_url":"https://api.github.com/users/rwood-moz/followers","following_url":"https://api.github.com/users/rwood-moz/following{/other_user}","gists_url":"https://api.github.com/users/rwood-moz/gists{/gist_id}","starred_url":"https://api.github.com/users/rwood-moz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwood-moz/subscriptions","organizations_url":"https://api.github.com/users/rwood-moz/orgs","repos_url":"https://api.github.com/users/rwood-moz/repos","events_url":"https://api.github.com/users/rwood-moz/events{/privacy}","received_events_url":"https://api.github.com/users/rwood-moz/received_events","type":"User","site_admin":false},"body":"Do you not want to mark the reboot? Previously (in raptor/lib/device) there was:\r\nDevice.mark('deviceReboot@System', time);","created_at":"2015-01-23T21:32:18Z","updated_at":"2015-01-23T21:32:18Z","html_url":"https://github.com/eliperelman/node-mozdevice/pull/1#discussion_r23481976","pull_request_url":"https://api.github.com/repos/eliperelman/node-mozdevice/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/eliperelman/node-mozdevice/pulls/comments/23481976"},"html":{"href":"https://github.com/eliperelman/node-mozdevice/pull/1#discussion_r23481976"},"pull_request":{"href":"https://api.github.com/repos/eliperelman/node-mozdevice/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/eliperelman/node-mozdevice/pulls/1","id":27874156,"html_url":"https://github.com/eliperelman/node-mozdevice/pull/1","diff_url":"https://github.com/eliperelman/node-mozdevice/pull/1.diff","patch_url":"https://github.com/eliperelman/node-mozdevice/pull/1.patch","issue_url":"https://api.github.com/repos/eliperelman/node-mozdevice/issues/1","number":1,"state":"open","locked":false,"title":"Bug 1115134 - Initial API for MozDevice interactions","user":{"login":"eliperelman","id":285899,"avatar_url":"https://avatars.githubusercontent.com/u/285899?v=3","gravatar_id":"","url":"https://api.github.com/users/eliperelman","html_url":"https://github.com/eliperelman","followers_url":"https://api.github.com/users/eliperelman/followers","following_url":"https://api.github.com/users/eliperelman/following{/other_user}","gists_url":"https://api.github.com/users/eliperelman/gists{/gist_id}","starred_url":"https://api.github.com/users/eliperelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliperelman/subscriptions","organizations_url":"https://api.github.com/users/eliperelman/orgs","repos_url":"https://api.github.com/users/eliperelman/repos","events_url":"https://api.github.com/users/eliperelman/events{/privacy}","received_events_url":"https://api.github.com/users/eliperelman/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-22T20:18:22Z","updated_at":"2015-01-23T21:32:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5b7a5cc4d3528dfc9aebf97ca68d297ad7db8784","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/eliperelman/node-mozdevice/pulls/1/commits","review_comments_url":"https://api.github.com/repos/eliperelman/node-mozdevice/pulls/1/comments","review_comment_url":"https://api.github.com/repos/eliperelman/node-mozdevice/pulls/comments/{number}","comments_url":"https://api.github.com/repos/eliperelman/node-mozdevice/issues/1/comments","statuses_url":"https://api.github.com/repos/eliperelman/node-mozdevice/statuses/720f6006842cae120fd0139b788ce647ae062d69","head":{"label":"eliperelman:bug-1115134","ref":"bug-1115134","sha":"720f6006842cae120fd0139b788ce647ae062d69","user":{"login":"eliperelman","id":285899,"avatar_url":"https://avatars.githubusercontent.com/u/285899?v=3","gravatar_id":"","url":"https://api.github.com/users/eliperelman","html_url":"https://github.com/eliperelman","followers_url":"https://api.github.com/users/eliperelman/followers","following_url":"https://api.github.com/users/eliperelman/following{/other_user}","gists_url":"https://api.github.com/users/eliperelman/gists{/gist_id}","starred_url":"https://api.github.com/users/eliperelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliperelman/subscriptions","organizations_url":"https://api.github.com/users/eliperelman/orgs","repos_url":"https://api.github.com/users/eliperelman/repos","events_url":"https://api.github.com/users/eliperelman/events{/privacy}","received_events_url":"https://api.github.com/users/eliperelman/received_events","type":"User","site_admin":false},"repo":{"id":29697827,"name":"node-mozdevice","full_name":"eliperelman/node-mozdevice","owner":{"login":"eliperelman","id":285899,"avatar_url":"https://avatars.githubusercontent.com/u/285899?v=3","gravatar_id":"","url":"https://api.github.com/users/eliperelman","html_url":"https://github.com/eliperelman","followers_url":"https://api.github.com/users/eliperelman/followers","following_url":"https://api.github.com/users/eliperelman/following{/other_user}","gists_url":"https://api.github.com/users/eliperelman/gists{/gist_id}","starred_url":"https://api.github.com/users/eliperelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliperelman/subscriptions","organizations_url":"https://api.github.com/users/eliperelman/orgs","repos_url":"https://api.github.com/users/eliperelman/repos","events_url":"https://api.github.com/users/eliperelman/events{/privacy}","received_events_url":"https://api.github.com/users/eliperelman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eliperelman/node-mozdevice","description":"","fork":false,"url":"https://api.github.com/repos/eliperelman/node-mozdevice","forks_url":"https://api.github.com/repos/eliperelman/node-mozdevice/forks","keys_url":"https://api.github.com/repos/eliperelman/node-mozdevice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eliperelman/node-mozdevice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eliperelman/node-mozdevice/teams","hooks_url":"https://api.github.com/repos/eliperelman/node-mozdevice/hooks","issue_events_url":"https://api.github.com/repos/eliperelman/node-mozdevice/issues/events{/number}","events_url":"https://api.github.com/repos/eliperelman/node-mozdevice/events","assignees_url":"https://api.github.com/repos/eliperelman/node-mozdevice/assignees{/user}","branches_url":"https://api.github.com/repos/eliperelman/node-mozdevice/branches{/branch}","tags_url":"https://api.github.com/repos/eliperelman/node-mozdevice/tags","blobs_url":"https://api.github.com/repos/eliperelman/node-mozdevice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eliperelman/node-mozdevice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eliperelman/node-mozdevice/git/refs{/sha}","trees_url":"https://api.github.com/repos/eliperelman/node-mozdevice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eliperelman/node-mozdevice/statuses/{sha}","languages_url":"https://api.github.com/repos/eliperelman/node-mozdevice/languages","stargazers_url":"https://api.github.com/repos/eliperelman/node-mozdevice/stargazers","contributors_url":"https://api.github.com/repos/eliperelman/node-mozdevice/contributors","subscribers_url":"https://api.github.com/repos/eliperelman/node-mozdevice/subscribers","subscription_url":"https://api.github.com/repos/eliperelman/node-mozdevice/subscription","commits_url":"https://api.github.com/repos/eliperelman/node-mozdevice/commits{/sha}","git_commits_url":"https://api.github.com/repos/eliperelman/node-mozdevice/git/commits{/sha}","comments_url":"https://api.github.com/repos/eliperelman/node-mozdevice/comments{/number}","issue_comment_url":"https://api.github.com/repos/eliperelman/node-mozdevice/issues/comments/{number}","contents_url":"https://api.github.com/repos/eliperelman/node-mozdevice/contents/{+path}","compare_url":"https://api.github.com/repos/eliperelman/node-mozdevice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eliperelman/node-mozdevice/merges","archive_url":"https://api.github.com/repos/eliperelman/node-mozdevice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eliperelman/node-mozdevice/downloads","issues_url":"https://api.github.com/repos/eliperelman/node-mozdevice/issues{/number}","pulls_url":"https://api.github.com/repos/eliperelman/node-mozdevice/pulls{/number}","milestones_url":"https://api.github.com/repos/eliperelman/node-mozdevice/milestones{/number}","notifications_url":"https://api.github.com/repos/eliperelman/node-mozdevice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eliperelman/node-mozdevice/labels{/name}","releases_url":"https://api.github.com/repos/eliperelman/node-mozdevice/releases{/id}","created_at":"2015-01-22T20:11:04Z","updated_at":"2015-01-22T20:11:04Z","pushed_at":"2015-01-22T20:16:41Z","git_url":"git://github.com/eliperelman/node-mozdevice.git","ssh_url":"git@github.com:eliperelman/node-mozdevice.git","clone_url":"https://github.com/eliperelman/node-mozdevice.git","svn_url":"https://github.com/eliperelman/node-mozdevice","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"eliperelman:master","ref":"master","sha":"1f0e888d43d84dc6e49e868ca74f4c5d14ba24af","user":{"login":"eliperelman","id":285899,"avatar_url":"https://avatars.githubusercontent.com/u/285899?v=3","gravatar_id":"","url":"https://api.github.com/users/eliperelman","html_url":"https://github.com/eliperelman","followers_url":"https://api.github.com/users/eliperelman/followers","following_url":"https://api.github.com/users/eliperelman/following{/other_user}","gists_url":"https://api.github.com/users/eliperelman/gists{/gist_id}","starred_url":"https://api.github.com/users/eliperelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliperelman/subscriptions","organizations_url":"https://api.github.com/users/eliperelman/orgs","repos_url":"https://api.github.com/users/eliperelman/repos","events_url":"https://api.github.com/users/eliperelman/events{/privacy}","received_events_url":"https://api.github.com/users/eliperelman/received_events","type":"User","site_admin":false},"repo":{"id":29697827,"name":"node-mozdevice","full_name":"eliperelman/node-mozdevice","owner":{"login":"eliperelman","id":285899,"avatar_url":"https://avatars.githubusercontent.com/u/285899?v=3","gravatar_id":"","url":"https://api.github.com/users/eliperelman","html_url":"https://github.com/eliperelman","followers_url":"https://api.github.com/users/eliperelman/followers","following_url":"https://api.github.com/users/eliperelman/following{/other_user}","gists_url":"https://api.github.com/users/eliperelman/gists{/gist_id}","starred_url":"https://api.github.com/users/eliperelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliperelman/subscriptions","organizations_url":"https://api.github.com/users/eliperelman/orgs","repos_url":"https://api.github.com/users/eliperelman/repos","events_url":"https://api.github.com/users/eliperelman/events{/privacy}","received_events_url":"https://api.github.com/users/eliperelman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eliperelman/node-mozdevice","description":"","fork":false,"url":"https://api.github.com/repos/eliperelman/node-mozdevice","forks_url":"https://api.github.com/repos/eliperelman/node-mozdevice/forks","keys_url":"https://api.github.com/repos/eliperelman/node-mozdevice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eliperelman/node-mozdevice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eliperelman/node-mozdevice/teams","hooks_url":"https://api.github.com/repos/eliperelman/node-mozdevice/hooks","issue_events_url":"https://api.github.com/repos/eliperelman/node-mozdevice/issues/events{/number}","events_url":"https://api.github.com/repos/eliperelman/node-mozdevice/events","assignees_url":"https://api.github.com/repos/eliperelman/node-mozdevice/assignees{/user}","branches_url":"https://api.github.com/repos/eliperelman/node-mozdevice/branches{/branch}","tags_url":"https://api.github.com/repos/eliperelman/node-mozdevice/tags","blobs_url":"https://api.github.com/repos/eliperelman/node-mozdevice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eliperelman/node-mozdevice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eliperelman/node-mozdevice/git/refs{/sha}","trees_url":"https://api.github.com/repos/eliperelman/node-mozdevice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eliperelman/node-mozdevice/statuses/{sha}","languages_url":"https://api.github.com/repos/eliperelman/node-mozdevice/languages","stargazers_url":"https://api.github.com/repos/eliperelman/node-mozdevice/stargazers","contributors_url":"https://api.github.com/repos/eliperelman/node-mozdevice/contributors","subscribers_url":"https://api.github.com/repos/eliperelman/node-mozdevice/subscribers","subscription_url":"https://api.github.com/repos/eliperelman/node-mozdevice/subscription","commits_url":"https://api.github.com/repos/eliperelman/node-mozdevice/commits{/sha}","git_commits_url":"https://api.github.com/repos/eliperelman/node-mozdevice/git/commits{/sha}","comments_url":"https://api.github.com/repos/eliperelman/node-mozdevice/comments{/number}","issue_comment_url":"https://api.github.com/repos/eliperelman/node-mozdevice/issues/comments/{number}","contents_url":"https://api.github.com/repos/eliperelman/node-mozdevice/contents/{+path}","compare_url":"https://api.github.com/repos/eliperelman/node-mozdevice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eliperelman/node-mozdevice/merges","archive_url":"https://api.github.com/repos/eliperelman/node-mozdevice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eliperelman/node-mozdevice/downloads","issues_url":"https://api.github.com/repos/eliperelman/node-mozdevice/issues{/number}","pulls_url":"https://api.github.com/repos/eliperelman/node-mozdevice/pulls{/number}","milestones_url":"https://api.github.com/repos/eliperelman/node-mozdevice/milestones{/number}","notifications_url":"https://api.github.com/repos/eliperelman/node-mozdevice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eliperelman/node-mozdevice/labels{/name}","releases_url":"https://api.github.com/repos/eliperelman/node-mozdevice/releases{/id}","created_at":"2015-01-22T20:11:04Z","updated_at":"2015-01-22T20:11:04Z","pushed_at":"2015-01-22T20:16:41Z","git_url":"git://github.com/eliperelman/node-mozdevice.git","ssh_url":"git@github.com:eliperelman/node-mozdevice.git","clone_url":"https://github.com/eliperelman/node-mozdevice.git","svn_url":"https://github.com/eliperelman/node-mozdevice","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eliperelman/node-mozdevice/pulls/1"},"html":{"href":"https://github.com/eliperelman/node-mozdevice/pull/1"},"issue":{"href":"https://api.github.com/repos/eliperelman/node-mozdevice/issues/1"},"comments":{"href":"https://api.github.com/repos/eliperelman/node-mozdevice/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/eliperelman/node-mozdevice/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/eliperelman/node-mozdevice/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/eliperelman/node-mozdevice/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/eliperelman/node-mozdevice/statuses/720f6006842cae120fd0139b788ce647ae062d69"}}}}