jacobg commented on PR #1609:
URL: https://github.com/apache/cordova-android/pull/1609#issuecomment-1906213927
Hi @KenCorbettJr Thanks for your pull request. Do you see a "review" that
was opened and displayed above your last message.
I'll paste it again here:
--
The intent == null clause should be removed, and getData() condition moved
to the top with non-null intent clause. The camera result may have an intent
but without data.
So like this:
```java
if (intent != null && intent.getData() != null) { // single file
LOG.v(LOG_TAG, "Adding file (single): " + intent.getData());
uris.add(intent.getData());
} else if (captureUri != null) { // camera
LOG.v(LOG_TAG, "Adding camera capture: " + captureUri);
uris.add(captureUri);
} else if (intent != null && intent.getClipData() != null) { // multiple
files
ClipData clipData = intent.getClipData();
int count = clipData.getItemCount();
for (int i = 0; i < count; i++) {
Uri uri = clipData.getItemAt(i).getUri();
LOG.v(LOG_TAG, "Adding file (multiple): " + uri);
if (uri != null) {
uris.add(uri);
}
}
}
```
And camera would not open for me without first requesting CAMERA permission.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]