Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Fix issue of failing to launch camera when tapping input tag.
Browse files Browse the repository at this point in the history
The tag is <input type="file" accept="image/*;capture=camera">.
Chromium has already implemented a better file chooser for android,
so bypass that implemented by Cordova.

BUG=https://crosswalk-project.org/jira/browse/XWALK-2148
  • Loading branch information
gaochun authored and fujunwei committed Oct 14, 2014
1 parent 0c0d0b4 commit ac6eb09
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions framework/src/org/apache/cordova/CordovaChromeClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -324,21 +324,7 @@ public void run() {
@Override
public void openFileChooser(XWalkView view, ValueCallback<Uri> uploadMsg, String acceptType,
String capture) {
this.openFileChooser(uploadMsg, "*/*");
}

public void openFileChooser( ValueCallback<Uri> uploadMsg, String acceptType ) {
this.openFileChooser(uploadMsg, acceptType, null);
}

public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture)
{
mUploadMessage = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("*/*");
this.cordova.getActivity().startActivityForResult(Intent.createChooser(i, "File Browser"),
FILECHOOSER_RESULTCODE);
uploadMsg.onReceiveValue(null);
}

public ValueCallback<Uri> getValueCallback() {
Expand Down

0 comments on commit ac6eb09

Please sign in to comment.