{"action":"created","comment":{"url":"https://api.github.com/repos/appium/appium-android-bootstrap/pulls/comments/66225460","id":66225460,"diff_hunk":"@@ -0,0 +1,64 @@\n+package io.appium.android.bootstrap.handler;\n+\n+import com.android.uiautomator.core.Configurator;\n+import io.appium.android.bootstrap.AndroidCommand;\n+import io.appium.android.bootstrap.AndroidCommandResult;\n+import io.appium.android.bootstrap.CommandHandler;\n+import org.json.JSONException;\n+\n+import java.util.Hashtable;\n+\n+import static io.appium.android.bootstrap.utils.API.API_18;\n+\n+/**\n+ * This handler set {@link com.android.uiautomator.core.Configurator} related settings including\n+ * ActionAcknowledgmentTimeout, KeyInjectionDelay, ScrollAcknowledgmentTimeout, WaitForIdleTimeout and WaitForSelectorTimeout\n+ * <br/>command example {\"cmd\" :\"action\", \"params\":{\"config\":\"setActionAcknowledgmentTimeout\",\"value\":5000}}\n+ * <br/>example is the same as invoking {@link com.android.uiautomator.core.Configurator#setActionAcknowledgmentTimeout} to 5 seconds\n+ */\n+public class ConfiguratorHandler extends CommandHandler {\n+    @Override\n+    public AndroidCommandResult execute(AndroidCommand command) throws JSONException {\n+        if (API_18) {\n+            final Hashtable<String, Object> params = command.params();\n+            int value = 0;\n+            if (params.containsKey(\"value\")) {\n+                value = (Integer) params.get(\"value\");\n+            }\n+            String methodName = ((String) params.get(\"method\"));\n+            //TODO: use reflection to invoke method would be more expandable; but Configurator is singleton\n+            Configurator configurator = Configurator.getInstance();\n+            switch (methodName) {\n+                case \"setActionAcknowledgmentTimeout\":\n+                    if (value == 0) // set to default when no value or zero\n+                        value = 3000;","path":"bootstrap/src/io/appium/android/bootstrap/handler/ConfiguratorHandler.java","position":34,"original_position":34,"commit_id":"37830b5ebad55fbf0a6c4dd8190f167e51dabae8","original_commit_id":"37830b5ebad55fbf0a6c4dd8190f167e51dabae8","user":{"login":"jlipps","id":605053,"avatar_url":"https://avatars.githubusercontent.com/u/605053?v=3","gravatar_id":"","url":"https://api.github.com/users/jlipps","html_url":"https://github.com/jlipps","followers_url":"https://api.github.com/users/jlipps/followers","following_url":"https://api.github.com/users/jlipps/following{/other_user}","gists_url":"https://api.github.com/users/jlipps/gists{/gist_id}","starred_url":"https://api.github.com/users/jlipps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlipps/subscriptions","organizations_url":"https://api.github.com/users/jlipps/orgs","repos_url":"https://api.github.com/users/jlipps/repos","events_url":"https://api.github.com/users/jlipps/events{/privacy}","received_events_url":"https://api.github.com/users/jlipps/received_events","type":"User","site_admin":false},"body":"should we make these defaults constants up top so they're easier to see and change?","created_at":"2016-06-08T09:47:54Z","updated_at":"2016-06-08T09:47:54Z","html_url":"https://github.com/appium/appium-android-bootstrap/pull/25#discussion_r66225460","pull_request_url":"https://api.github.com/repos/appium/appium-android-bootstrap/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/appium/appium-android-bootstrap/pulls/comments/66225460"},"html":{"href":"https://github.com/appium/appium-android-bootstrap/pull/25#discussion_r66225460"},"pull_request":{"href":"https://api.github.com/repos/appium/appium-android-bootstrap/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/appium/appium-android-bootstrap/pulls/25","id":72997567,"html_url":"https://github.com/appium/appium-android-bootstrap/pull/25","diff_url":"https://github.com/appium/appium-android-bootstrap/pull/25.diff","patch_url":"https://github.com/appium/appium-android-bootstrap/pull/25.patch","issue_url":"https://api.github.com/repos/appium/appium-android-bootstrap/issues/25","number":25,"state":"open","locked":false,"title":"add support to set UiAutomator Congfigurator values ","user":{"login":"truebit","id":754906,"avatar_url":"https://avatars.githubusercontent.com/u/754906?v=3","gravatar_id":"","url":"https://api.github.com/users/truebit","html_url":"https://github.com/truebit","followers_url":"https://api.github.com/users/truebit/followers","following_url":"https://api.github.com/users/truebit/following{/other_user}","gists_url":"https://api.github.com/users/truebit/gists{/gist_id}","starred_url":"https://api.github.com/users/truebit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/truebit/subscriptions","organizations_url":"https://api.github.com/users/truebit/orgs","repos_url":"https://api.github.com/users/truebit/repos","events_url":"https://api.github.com/users/truebit/events{/privacy}","received_events_url":"https://api.github.com/users/truebit/received_events","type":"User","site_admin":false},"body":"This is a sub PR for appium/appium#6561","created_at":"2016-06-08T07:21:17Z","updated_at":"2016-06-08T09:47:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7310e1c2fa0ec95b0cb4abe6afcb5852985cb817","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/appium/appium-android-bootstrap/pulls/25/commits","review_comments_url":"https://api.github.com/repos/appium/appium-android-bootstrap/pulls/25/comments","review_comment_url":"https://api.github.com/repos/appium/appium-android-bootstrap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/appium/appium-android-bootstrap/issues/25/comments","statuses_url":"https://api.github.com/repos/appium/appium-android-bootstrap/statuses/37830b5ebad55fbf0a6c4dd8190f167e51dabae8","head":{"label":"truebit:master","ref":"master","sha":"37830b5ebad55fbf0a6c4dd8190f167e51dabae8","user":{"login":"truebit","id":754906,"avatar_url":"https://avatars.githubusercontent.com/u/754906?v=3","gravatar_id":"","url":"https://api.github.com/users/truebit","html_url":"https://github.com/truebit","followers_url":"https://api.github.com/users/truebit/followers","following_url":"https://api.github.com/users/truebit/following{/other_user}","gists_url":"https://api.github.com/users/truebit/gists{/gist_id}","starred_url":"https://api.github.com/users/truebit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/truebit/subscriptions","organizations_url":"https://api.github.com/users/truebit/orgs","repos_url":"https://api.github.com/users/truebit/repos","events_url":"https://api.github.com/users/truebit/events{/privacy}","received_events_url":"https://api.github.com/users/truebit/received_events","type":"User","site_admin":false},"repo":{"id":59543651,"name":"appium-android-bootstrap","full_name":"truebit/appium-android-bootstrap","owner":{"login":"truebit","id":754906,"avatar_url":"https://avatars.githubusercontent.com/u/754906?v=3","gravatar_id":"","url":"https://api.github.com/users/truebit","html_url":"https://github.com/truebit","followers_url":"https://api.github.com/users/truebit/followers","following_url":"https://api.github.com/users/truebit/following{/other_user}","gists_url":"https://api.github.com/users/truebit/gists{/gist_id}","starred_url":"https://api.github.com/users/truebit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/truebit/subscriptions","organizations_url":"https://api.github.com/users/truebit/orgs","repos_url":"https://api.github.com/users/truebit/repos","events_url":"https://api.github.com/users/truebit/events{/privacy}","received_events_url":"https://api.github.com/users/truebit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/truebit/appium-android-bootstrap","description":"Npm module for androidBootstrap, the java project which appium uses to interact with UiAutomator","fork":true,"url":"https://api.github.com/repos/truebit/appium-android-bootstrap","forks_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/forks","keys_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/teams","hooks_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/hooks","issue_events_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/issues/events{/number}","events_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/events","assignees_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/assignees{/user}","branches_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/branches{/branch}","tags_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/tags","blobs_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/git/refs{/sha}","trees_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/statuses/{sha}","languages_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/languages","stargazers_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/stargazers","contributors_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/contributors","subscribers_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/subscribers","subscription_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/subscription","commits_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/commits{/sha}","git_commits_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/git/commits{/sha}","comments_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/comments{/number}","issue_comment_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/issues/comments{/number}","contents_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/contents/{+path}","compare_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/merges","archive_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/downloads","issues_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/issues{/number}","pulls_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/pulls{/number}","milestones_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/milestones{/number}","notifications_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/labels{/name}","releases_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/releases{/id}","deployments_url":"https://api.github.com/repos/truebit/appium-android-bootstrap/deployments","created_at":"2016-05-24T05:37:59Z","updated_at":"2016-05-24T05:38:00Z","pushed_at":"2016-06-08T06:24:38Z","git_url":"git://github.com/truebit/appium-android-bootstrap.git","ssh_url":"git@github.com:truebit/appium-android-bootstrap.git","clone_url":"https://github.com/truebit/appium-android-bootstrap.git","svn_url":"https://github.com/truebit/appium-android-bootstrap","homepage":null,"size":2690,"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":"appium:master","ref":"master","sha":"05964a4b94dfd73d692499a2ace509855bd46aa6","user":{"login":"appium","id":3221291,"avatar_url":"https://avatars.githubusercontent.com/u/3221291?v=3","gravatar_id":"","url":"https://api.github.com/users/appium","html_url":"https://github.com/appium","followers_url":"https://api.github.com/users/appium/followers","following_url":"https://api.github.com/users/appium/following{/other_user}","gists_url":"https://api.github.com/users/appium/gists{/gist_id}","starred_url":"https://api.github.com/users/appium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appium/subscriptions","organizations_url":"https://api.github.com/users/appium/orgs","repos_url":"https://api.github.com/users/appium/repos","events_url":"https://api.github.com/users/appium/events{/privacy}","received_events_url":"https://api.github.com/users/appium/received_events","type":"Organization","site_admin":false},"repo":{"id":24956924,"name":"appium-android-bootstrap","full_name":"appium/appium-android-bootstrap","owner":{"login":"appium","id":3221291,"avatar_url":"https://avatars.githubusercontent.com/u/3221291?v=3","gravatar_id":"","url":"https://api.github.com/users/appium","html_url":"https://github.com/appium","followers_url":"https://api.github.com/users/appium/followers","following_url":"https://api.github.com/users/appium/following{/other_user}","gists_url":"https://api.github.com/users/appium/gists{/gist_id}","starred_url":"https://api.github.com/users/appium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appium/subscriptions","organizations_url":"https://api.github.com/users/appium/orgs","repos_url":"https://api.github.com/users/appium/repos","events_url":"https://api.github.com/users/appium/events{/privacy}","received_events_url":"https://api.github.com/users/appium/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/appium/appium-android-bootstrap","description":"Npm module for androidBootstrap, the java project which appium uses to interact with UiAutomator","fork":false,"url":"https://api.github.com/repos/appium/appium-android-bootstrap","forks_url":"https://api.github.com/repos/appium/appium-android-bootstrap/forks","keys_url":"https://api.github.com/repos/appium/appium-android-bootstrap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/appium/appium-android-bootstrap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/appium/appium-android-bootstrap/teams","hooks_url":"https://api.github.com/repos/appium/appium-android-bootstrap/hooks","issue_events_url":"https://api.github.com/repos/appium/appium-android-bootstrap/issues/events{/number}","events_url":"https://api.github.com/repos/appium/appium-android-bootstrap/events","assignees_url":"https://api.github.com/repos/appium/appium-android-bootstrap/assignees{/user}","branches_url":"https://api.github.com/repos/appium/appium-android-bootstrap/branches{/branch}","tags_url":"https://api.github.com/repos/appium/appium-android-bootstrap/tags","blobs_url":"https://api.github.com/repos/appium/appium-android-bootstrap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/appium/appium-android-bootstrap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/appium/appium-android-bootstrap/git/refs{/sha}","trees_url":"https://api.github.com/repos/appium/appium-android-bootstrap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/appium/appium-android-bootstrap/statuses/{sha}","languages_url":"https://api.github.com/repos/appium/appium-android-bootstrap/languages","stargazers_url":"https://api.github.com/repos/appium/appium-android-bootstrap/stargazers","contributors_url":"https://api.github.com/repos/appium/appium-android-bootstrap/contributors","subscribers_url":"https://api.github.com/repos/appium/appium-android-bootstrap/subscribers","subscription_url":"https://api.github.com/repos/appium/appium-android-bootstrap/subscription","commits_url":"https://api.github.com/repos/appium/appium-android-bootstrap/commits{/sha}","git_commits_url":"https://api.github.com/repos/appium/appium-android-bootstrap/git/commits{/sha}","comments_url":"https://api.github.com/repos/appium/appium-android-bootstrap/comments{/number}","issue_comment_url":"https://api.github.com/repos/appium/appium-android-bootstrap/issues/comments{/number}","contents_url":"https://api.github.com/repos/appium/appium-android-bootstrap/contents/{+path}","compare_url":"https://api.github.com/repos/appium/appium-android-bootstrap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/appium/appium-android-bootstrap/merges","archive_url":"https://api.github.com/repos/appium/appium-android-bootstrap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/appium/appium-android-bootstrap/downloads","issues_url":"https://api.github.com/repos/appium/appium-android-bootstrap/issues{/number}","pulls_url":"https://api.github.com/repos/appium/appium-android-bootstrap/pulls{/number}","milestones_url":"https://api.github.com/repos/appium/appium-android-bootstrap/milestones{/number}","notifications_url":"https://api.github.com/repos/appium/appium-android-bootstrap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/appium/appium-android-bootstrap/labels{/name}","releases_url":"https://api.github.com/repos/appium/appium-android-bootstrap/releases{/id}","deployments_url":"https://api.github.com/repos/appium/appium-android-bootstrap/deployments","created_at":"2014-10-08T19:28:29Z","updated_at":"2016-05-18T00:06:07Z","pushed_at":"2016-06-08T07:21:18Z","git_url":"git://github.com/appium/appium-android-bootstrap.git","ssh_url":"git@github.com:appium/appium-android-bootstrap.git","clone_url":"https://github.com/appium/appium-android-bootstrap.git","svn_url":"https://github.com/appium/appium-android-bootstrap","homepage":null,"size":2718,"stargazers_count":8,"watchers_count":8,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":3,"forks":19,"open_issues":3,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/appium/appium-android-bootstrap/pulls/25"},"html":{"href":"https://github.com/appium/appium-android-bootstrap/pull/25"},"issue":{"href":"https://api.github.com/repos/appium/appium-android-bootstrap/issues/25"},"comments":{"href":"https://api.github.com/repos/appium/appium-android-bootstrap/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/appium/appium-android-bootstrap/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/appium/appium-android-bootstrap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/appium/appium-android-bootstrap/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/appium/appium-android-bootstrap/statuses/37830b5ebad55fbf0a6c4dd8190f167e51dabae8"}}}}
{"actor":{"display_login":"jlipps"}}