GitHub PullRequestReviewCommentEvent at 2014-11-27 01:27:01
Repository: crosswalk
Actor: wang16
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/comments/20974358","id":20974358,"diff_hunk":"@@ -1054,18 +1065,47 @@ public boolean showFileChooser(ValueCallback<Uri> uploadFile, String acceptType,\n             }\n         }\n \n-        Intent contentSelectionIntent = new Intent(Intent.ACTION_GET_CONTENT);\n-        contentSelectionIntent.addCategory(Intent.CATEGORY_OPENABLE);\n-        contentSelectionIntent.setType(\"*/*\");\n-\n         Intent camcorder = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);\n         Intent soundRecorder = new Intent(\n                 MediaStore.Audio.Media.RECORD_SOUND_ACTION);\n+        if (capture.equals(\"true\")) {\n+            if (mFileType.equals(ALL_IMAGE_TYPES)) {\n+                getActivity().startActivityForResult(takePictureIntent,\n+                        INPUT_FILE_REQUEST_CODE);\n+                return true;\n+            } else if (mFileType.equals(ALL_VIDEO_TYPES)) {\n+                getActivity().startActivityForResult(camcorder,\n+                        INPUT_FILE_REQUEST_CODE);\n+                return true;\n+            } else if (mFileType.equals(ALL_AUDIO_TYPES)) {\n+                getActivity().startActivityForResult(soundRecorder,\n+                        INPUT_FILE_REQUEST_CODE);\n+                return true;\n+            }\n+        }\n+\n+        Intent contentSelectionIntent = new Intent(Intent.ACTION_GET_CONTENT);\n+        contentSelectionIntent.addCategory(Intent.CATEGORY_OPENABLE);\n         ArrayList<Intent> extraIntents = new ArrayList<Intent>();\n-        extraIntents.add(takePictureIntent);\n-        extraIntents.add(camcorder);\n-        extraIntents.add(soundRecorder);\n+        if (!noSpecificType()) {\n+            if (shouldShowImageTypes()) {\n+                extraIntents.add(takePictureIntent);\n+                contentSelectionIntent.setType(ALL_IMAGE_TYPES);\n+            } else if (shouldShowVideoTypes()) {\n+                extraIntents.add(camcorder);\n+                contentSelectionIntent.setType(ALL_VIDEO_TYPES);\n+            } else if (shouldShowAudioTypes()) {\n+                extraIntents.add(soundRecorder);\n+                contentSelectionIntent.setType(ALL_AUDIO_TYPES);\n+            }\n+        }\n \n+        if (extraIntents.isEmpty()) {\n+            contentSelectionIntent.setType(ANY_TYPES);\n+            extraIntents.add(takePictureIntent);\n+            extraIntents.add(camcorder);\n+            extraIntents.add(soundRecorder);\n+        }","path":"runtime/android/core_internal/src/org/xwalk/core/internal/XWalkViewInternal.java","position":97,"original_position":97,"commit_id":"30d9718ecd91d164e26f50fe4146ad0e13900f19","original_commit_id":"30d9718ecd91d164e26f50fe4146ad0e13900f19","user":{"login":"wang16","id":1150478,"avatar_url":"https://avatars.githubusercontent.com/u/1150478?v=3","gravatar_id":"","url":"https://api.github.com/users/wang16","html_url":"https://github.com/wang16","followers_url":"https://api.github.com/users/wang16/followers","following_url":"https://api.github.com/users/wang16/following{/other_user}","gists_url":"https://api.github.com/users/wang16/gists{/gist_id}","starred_url":"https://api.github.com/users/wang16/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wang16/subscriptions","organizations_url":"https://api.github.com/users/wang16/orgs","repos_url":"https://api.github.com/users/wang16/repos","events_url":"https://api.github.com/users/wang16/events{/privacy}","received_events_url":"https://api.github.com/users/wang16/received_events","type":"User","site_admin":false},"body":"Then i think it's better to have another PR for it.","created_at":"2014-11-27T01:27:01Z","updated_at":"2014-11-27T01:27:01Z","html_url":"https://github.com/crosswalk-project/crosswalk/pull/2647#discussion_r20974358","pull_request_url":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/2647","_links":{"self":{"href":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/comments/20974358"},"html":{"href":"https://github.com/crosswalk-project/crosswalk/pull/2647#discussion_r20974358"},"pull_request":{"href":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/2647"}}},"pull_request":{"url":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/2647","id":24984496,"html_url":"https://github.com/crosswalk-project/crosswalk/pull/2647","diff_url":"https://github.com/crosswalk-project/crosswalk/pull/2647.diff","patch_url":"https://github.com/crosswalk-project/crosswalk/pull/2647.patch","issue_url":"https://api.github.com/repos/crosswalk-project/crosswalk/issues/2647","number":2647,"state":"open","locked":false,"title":"[Android] Fix the file picker crash issue and optimize the process.","user":{"login":"wuhengzhi","id":1527639,"avatar_url":"https://avatars.githubusercontent.com/u/1527639?v=3","gravatar_id":"","url":"https://api.github.com/users/wuhengzhi","html_url":"https://github.com/wuhengzhi","followers_url":"https://api.github.com/users/wuhengzhi/followers","following_url":"https://api.github.com/users/wuhengzhi/following{/other_user}","gists_url":"https://api.github.com/users/wuhengzhi/gists{/gist_id}","starred_url":"https://api.github.com/users/wuhengzhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wuhengzhi/subscriptions","organizations_url":"https://api.github.com/users/wuhengzhi/orgs","repos_url":"https://api.github.com/users/wuhengzhi/repos","events_url":"https://api.github.com/users/wuhengzhi/events{/privacy}","received_events_url":"https://api.github.com/users/wuhengzhi/received_events","type":"User","site_admin":false},"body":"This patch is to fix the special case with some ROMs and optimize the process.\r\nIf there is no SD card on device, getExternalStoragePublicDirectory()\r\nreturns null on these ROMs.\r\nThe ROMs changes the setting in \"/system/etc/vold.fstab\", external storage was\r\nmounted on \"/storage/sdcard1\", but the default external storage was mounted from\r\n\"/storage/sdcard0\".\r\nIf the default external storage was not existed, get the other storage.\r\nOptimize the process to run related apps when file picker's accept type\r\nwas specified.\r\n\r\nBUG=XWALK-2902, XWALK-2972","created_at":"2014-11-25T04:35:56Z","updated_at":"2014-11-27T01:27:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d70fca71162827c667f006632fb0471d03841769","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/2647/commits","review_comments_url":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/2647/comments","review_comment_url":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/comments/{number}","comments_url":"https://api.github.com/repos/crosswalk-project/crosswalk/issues/2647/comments","statuses_url":"https://api.github.com/repos/crosswalk-project/crosswalk/statuses/30d9718ecd91d164e26f50fe4146ad0e13900f19","head":{"label":"wuhengzhi:xwalk_2902_file_picker_exception","ref":"xwalk_2902_file_picker_exception","sha":"30d9718ecd91d164e26f50fe4146ad0e13900f19","user":{"login":"wuhengzhi","id":1527639,"avatar_url":"https://avatars.githubusercontent.com/u/1527639?v=3","gravatar_id":"","url":"https://api.github.com/users/wuhengzhi","html_url":"https://github.com/wuhengzhi","followers_url":"https://api.github.com/users/wuhengzhi/followers","following_url":"https://api.github.com/users/wuhengzhi/following{/other_user}","gists_url":"https://api.github.com/users/wuhengzhi/gists{/gist_id}","starred_url":"https://api.github.com/users/wuhengzhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wuhengzhi/subscriptions","organizations_url":"https://api.github.com/users/wuhengzhi/orgs","repos_url":"https://api.github.com/users/wuhengzhi/repos","events_url":"https://api.github.com/users/wuhengzhi/events{/privacy}","received_events_url":"https://api.github.com/users/wuhengzhi/received_events","type":"User","site_admin":false},"repo":{"id":12079870,"name":"crosswalk","full_name":"wuhengzhi/crosswalk","owner":{"login":"wuhengzhi","id":1527639,"avatar_url":"https://avatars.githubusercontent.com/u/1527639?v=3","gravatar_id":"","url":"https://api.github.com/users/wuhengzhi","html_url":"https://github.com/wuhengzhi","followers_url":"https://api.github.com/users/wuhengzhi/followers","following_url":"https://api.github.com/users/wuhengzhi/following{/other_user}","gists_url":"https://api.github.com/users/wuhengzhi/gists{/gist_id}","starred_url":"https://api.github.com/users/wuhengzhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wuhengzhi/subscriptions","organizations_url":"https://api.github.com/users/wuhengzhi/orgs","repos_url":"https://api.github.com/users/wuhengzhi/repos","events_url":"https://api.github.com/users/wuhengzhi/events{/privacy}","received_events_url":"https://api.github.com/users/wuhengzhi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wuhengzhi/crosswalk","description":"","fork":true,"url":"https://api.github.com/repos/wuhengzhi/crosswalk","forks_url":"https://api.github.com/repos/wuhengzhi/crosswalk/forks","keys_url":"https://api.github.com/repos/wuhengzhi/crosswalk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wuhengzhi/crosswalk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wuhengzhi/crosswalk/teams","hooks_url":"https://api.github.com/repos/wuhengzhi/crosswalk/hooks","issue_events_url":"https://api.github.com/repos/wuhengzhi/crosswalk/issues/events{/number}","events_url":"https://api.github.com/repos/wuhengzhi/crosswalk/events","assignees_url":"https://api.github.com/repos/wuhengzhi/crosswalk/assignees{/user}","branches_url":"https://api.github.com/repos/wuhengzhi/crosswalk/branches{/branch}","tags_url":"https://api.github.com/repos/wuhengzhi/crosswalk/tags","blobs_url":"https://api.github.com/repos/wuhengzhi/crosswalk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wuhengzhi/crosswalk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wuhengzhi/crosswalk/git/refs{/sha}","trees_url":"https://api.github.com/repos/wuhengzhi/crosswalk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wuhengzhi/crosswalk/statuses/{sha}","languages_url":"https://api.github.com/repos/wuhengzhi/crosswalk/languages","stargazers_url":"https://api.github.com/repos/wuhengzhi/crosswalk/stargazers","contributors_url":"https://api.github.com/repos/wuhengzhi/crosswalk/contributors","subscribers_url":"https://api.github.com/repos/wuhengzhi/crosswalk/subscribers","subscription_url":"https://api.github.com/repos/wuhengzhi/crosswalk/subscription","commits_url":"https://api.github.com/repos/wuhengzhi/crosswalk/commits{/sha}","git_commits_url":"https://api.github.com/repos/wuhengzhi/crosswalk/git/commits{/sha}","comments_url":"https://api.github.com/repos/wuhengzhi/crosswalk/comments{/number}","issue_comment_url":"https://api.github.com/repos/wuhengzhi/crosswalk/issues/comments/{number}","contents_url":"https://api.github.com/repos/wuhengzhi/crosswalk/contents/{+path}","compare_url":"https://api.github.com/repos/wuhengzhi/crosswalk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wuhengzhi/crosswalk/merges","archive_url":"https://api.github.com/repos/wuhengzhi/crosswalk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wuhengzhi/crosswalk/downloads","issues_url":"https://api.github.com/repos/wuhengzhi/crosswalk/issues{/number}","pulls_url":"https://api.github.com/repos/wuhengzhi/crosswalk/pulls{/number}","milestones_url":"https://api.github.com/repos/wuhengzhi/crosswalk/milestones{/number}","notifications_url":"https://api.github.com/repos/wuhengzhi/crosswalk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wuhengzhi/crosswalk/labels{/name}","releases_url":"https://api.github.com/repos/wuhengzhi/crosswalk/releases{/id}","created_at":"2013-08-13T11:04:38Z","updated_at":"2014-06-19T11:32:50Z","pushed_at":"2014-11-27T01:09:08Z","git_url":"git://github.com/wuhengzhi/crosswalk.git","ssh_url":"git@github.com:wuhengzhi/crosswalk.git","clone_url":"https://github.com/wuhengzhi/crosswalk.git","svn_url":"https://github.com/wuhengzhi/crosswalk","homepage":null,"size":27225,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"pauseResume"}},"base":{"label":"crosswalk-project:master","ref":"master","sha":"d9dd34716ec67e7df9583e8c335492b03d0a059a","user":{"login":"crosswalk-project","id":4867377,"avatar_url":"https://avatars.githubusercontent.com/u/4867377?v=3","gravatar_id":"","url":"https://api.github.com/users/crosswalk-project","html_url":"https://github.com/crosswalk-project","followers_url":"https://api.github.com/users/crosswalk-project/followers","following_url":"https://api.github.com/users/crosswalk-project/following{/other_user}","gists_url":"https://api.github.com/users/crosswalk-project/gists{/gist_id}","starred_url":"https://api.github.com/users/crosswalk-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crosswalk-project/subscriptions","organizations_url":"https://api.github.com/users/crosswalk-project/orgs","repos_url":"https://api.github.com/users/crosswalk-project/repos","events_url":"https://api.github.com/users/crosswalk-project/events{/privacy}","received_events_url":"https://api.github.com/users/crosswalk-project/received_events","type":"Organization","site_admin":false},"repo":{"id":9207280,"name":"crosswalk","full_name":"crosswalk-project/crosswalk","owner":{"login":"crosswalk-project","id":4867377,"avatar_url":"https://avatars.githubusercontent.com/u/4867377?v=3","gravatar_id":"","url":"https://api.github.com/users/crosswalk-project","html_url":"https://github.com/crosswalk-project","followers_url":"https://api.github.com/users/crosswalk-project/followers","following_url":"https://api.github.com/users/crosswalk-project/following{/other_user}","gists_url":"https://api.github.com/users/crosswalk-project/gists{/gist_id}","starred_url":"https://api.github.com/users/crosswalk-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crosswalk-project/subscriptions","organizations_url":"https://api.github.com/users/crosswalk-project/orgs","repos_url":"https://api.github.com/users/crosswalk-project/repos","events_url":"https://api.github.com/users/crosswalk-project/events{/privacy}","received_events_url":"https://api.github.com/users/crosswalk-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crosswalk-project/crosswalk","description":"","fork":false,"url":"https://api.github.com/repos/crosswalk-project/crosswalk","forks_url":"https://api.github.com/repos/crosswalk-project/crosswalk/forks","keys_url":"https://api.github.com/repos/crosswalk-project/crosswalk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crosswalk-project/crosswalk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crosswalk-project/crosswalk/teams","hooks_url":"https://api.github.com/repos/crosswalk-project/crosswalk/hooks","issue_events_url":"https://api.github.com/repos/crosswalk-project/crosswalk/issues/events{/number}","events_url":"https://api.github.com/repos/crosswalk-project/crosswalk/events","assignees_url":"https://api.github.com/repos/crosswalk-project/crosswalk/assignees{/user}","branches_url":"https://api.github.com/repos/crosswalk-project/crosswalk/branches{/branch}","tags_url":"https://api.github.com/repos/crosswalk-project/crosswalk/tags","blobs_url":"https://api.github.com/repos/crosswalk-project/crosswalk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crosswalk-project/crosswalk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crosswalk-project/crosswalk/git/refs{/sha}","trees_url":"https://api.github.com/repos/crosswalk-project/crosswalk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crosswalk-project/crosswalk/statuses/{sha}","languages_url":"https://api.github.com/repos/crosswalk-project/crosswalk/languages","stargazers_url":"https://api.github.com/repos/crosswalk-project/crosswalk/stargazers","contributors_url":"https://api.github.com/repos/crosswalk-project/crosswalk/contributors","subscribers_url":"https://api.github.com/repos/crosswalk-project/crosswalk/subscribers","subscription_url":"https://api.github.com/repos/crosswalk-project/crosswalk/subscription","commits_url":"https://api.github.com/repos/crosswalk-project/crosswalk/commits{/sha}","git_commits_url":"https://api.github.com/repos/crosswalk-project/crosswalk/git/commits{/sha}","comments_url":"https://api.github.com/repos/crosswalk-project/crosswalk/comments{/number}","issue_comment_url":"https://api.github.com/repos/crosswalk-project/crosswalk/issues/comments/{number}","contents_url":"https://api.github.com/repos/crosswalk-project/crosswalk/contents/{+path}","compare_url":"https://api.github.com/repos/crosswalk-project/crosswalk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crosswalk-project/crosswalk/merges","archive_url":"https://api.github.com/repos/crosswalk-project/crosswalk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crosswalk-project/crosswalk/downloads","issues_url":"https://api.github.com/repos/crosswalk-project/crosswalk/issues{/number}","pulls_url":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls{/number}","milestones_url":"https://api.github.com/repos/crosswalk-project/crosswalk/milestones{/number}","notifications_url":"https://api.github.com/repos/crosswalk-project/crosswalk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crosswalk-project/crosswalk/labels{/name}","releases_url":"https://api.github.com/repos/crosswalk-project/crosswalk/releases{/id}","created_at":"2013-04-03T23:30:12Z","updated_at":"2014-11-26T16:56:36Z","pushed_at":"2014-11-26T21:10:27Z","git_url":"git://github.com/crosswalk-project/crosswalk.git","ssh_url":"git@github.com:crosswalk-project/crosswalk.git","clone_url":"https://github.com/crosswalk-project/crosswalk.git","svn_url":"https://github.com/crosswalk-project/crosswalk","homepage":"https://crosswalk-project.org/","size":162123,"stargazers_count":462,"watchers_count":462,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":172,"mirror_url":null,"open_issues_count":111,"forks":172,"open_issues":111,"watchers":462,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/2647"},"html":{"href":"https://github.com/crosswalk-project/crosswalk/pull/2647"},"issue":{"href":"https://api.github.com/repos/crosswalk-project/crosswalk/issues/2647"},"comments":{"href":"https://api.github.com/repos/crosswalk-project/crosswalk/issues/2647/comments"},"review_comments":{"href":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/2647/comments"},"review_comment":{"href":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/2647/commits"},"statuses":{"href":"https://api.github.com/repos/crosswalk-project/crosswalk/statuses/30d9718ecd91d164e26f50fe4146ad0e13900f19"}}}}