-
Notifications
You must be signed in to change notification settings - Fork 872
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
Let user take screenshots when reporting Android webcompat issues #25584
Let user take screenshots when reporting Android webcompat issues #25584
Conversation
8b220be
to
ea9fce7
Compare
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.
strings
++
android/java/org/chromium/chrome/browser/shields/BraveShieldsScreenshotUtil.java
Outdated
Show resolved
Hide resolved
protected void onPostExecute(byte[] pngBytes) { | ||
assert ThreadUtils.runningOnUiThread(); | ||
|
||
if (isCancelled()) return; |
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.
shouldn't be here something like
if (isCancelled()) {
mCallback.OnScrrenshotReady(pngBytes);
return;
}
?
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.
👍
lgtm with few minor notices
40b6dd8
to
e466787
Compare
private static final String TAG = "ShieldsScreenshot"; | ||
private final BraveScreenshotRunnable mBraveScreenshotRunnable; | ||
|
||
private static class PngConvertorTask extends AsyncTask<byte[]> { |
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.
Asynctask is deprecated with api 30 : https://developer.android.com/reference/android/os/AsyncTask.html. we should use executors here.
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.
Good explanation on why we shouldn't use asynctask. : https://proandroiddev.com/a-quick-story-about-async-callbacks-memory-leaks-weakreferences-and-misconceptions-78003b3d6b26
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
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.
LGTM
return; | ||
} | ||
|
||
ExecutorService es = Executors.newSingleThreadExecutor(); |
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.
Thank you @vadimstruts for the changes here.
7b10495
to
297a0a1
Compare
Signed-off-by: Vadym Struts <vstruts@brave.com>
Signed-off-by: Vadym Struts <vstruts@brave.com>
Signed-off-by: Vadym Struts <vstruts@brave.com>
Signed-off-by: Vadym Struts <vstruts@brave.com>
Signed-off-by: Vadym Struts <vstruts@brave.com>
Signed-off-by: Vadym Struts <vstruts@brave.com>
Signed-off-by: Vadym Struts <vstruts@brave.com>
297a0a1
to
648d214
Compare
Resolves brave/brave-browser#36486
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
Case 1
Case 2