-
Notifications
You must be signed in to change notification settings - Fork 640
Support JPGs (in addition to PNGs) as feedback screenshots and set correct content-type/filename #4783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Generated by 🚫 Danger |
Coverage Report 1Affected Products
Test Logs |
Size Report 1Affected Products
Test Logs |
Startup Time Report 1Note: Layout is sometimes suboptimal due to limited formatting support on GitHub. Please check this report on GCS. Startup time comparison between the CI merge commit (b9aaa74) and the base commit (05f8d44) are not available. No macrobenchmark data found for the base commit (05f8d44). Analysis for the CI merge commit (b9aaa74) can be found at: |
String.format( | ||
"Unable to get filename from URI '%s', using default '%s'", | ||
contentUri, DEFAULT_FILENAME)); | ||
return DEFAULT_FILENAME; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be based on the content type (if we were able to figure that out), so have a default filename for each (supported) content type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I am also letting unknown content types through, with a filename with no extension. It will still fail to upload in our backend but this way we're less rigid in the SDK, and can always add support for more file types in the backend.
"Error getting filename from URI '%s', using default '%s'", | ||
contentUri, DEFAULT_FILENAME), | ||
e); | ||
return DEFAULT_FILENAME; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
} else if (screenshotUri.getScheme().equals("content")) { | ||
contentType = contentResolver.getType(screenshotUri); | ||
} | ||
if (contentType == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'd flip the condition:
if (contentType != null} {
return contentType;
}
LogWrapper...
return CONTENT_TYPE_PNG
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
24456dc
to
423e4f0
Compare
…rrect content-type/filename (#4783) * Support PNGs as feedback screenshots * Add tests and inject ContentResolver * Address feedback * Flip order of conditional
* Some App Distribution javadoc updates (#4740) * Support JPGs (in addition to PNGs) as feedback screenshots and set correct content-type/filename (#4783) * Support PNGs as feedback screenshots * Add tests and inject ContentResolver * Address feedback * Flip order of conditional * Update changelog and version for M129
No description provided.