mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:54:42 +00:00
android: patch getDrawable in QtActivityDelegate.java #312
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml!312
Loading…
Reference in a new issue
No description provided.
Delete branch "getDrawable"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The getDrawable method used in the QtActivityDelegate has been deprecated and causes a runtime exception. The patch updates the method to include the theme as a second parameter so it can fully resolve the resources.
This should resolve the runtime exception when calling createSurface
Update from 34d5b57 to 5116ee:
@hebasto have to apply a patch in a different part of the build with this one. Want to check if you have any thoughts on it.
Concept ACK
Will have this running to test if this crash ever occurs
Mind providing more context please?
When has it been deprecated? In which Qt version?
Why does our implementation rely on a deprecated method?
Is this patch available upstream?
The function is deprecated in Android. https://developer.android.com/reference/android/content/res/Resources#getDrawable(int). The deprecated function is used in QtActivityDelegate.java which is a class provided by the Qt 5.15 source code. We pull it directly from the tarball and our BitcoinQtActivity derives from this class. The specific method causes a crash on the versions of android we have tested(8 and 13).
It was fixed in Qt 6.4 with this patch
github.com/qt/qtbase@e80b0f3d87this patch doesn't directly apply to Qt 5.15 so I've created the patch myself.Update from 5116ee9 to 459ebac
github.com/qt/qtbase@e80b0f3d87Thanks!
Mind putting these useful details into the PR description?
From https://bugreports.qt.io/browse/QTBUG-103568, it follows that a patch for Qt 5.15 does exist. But only for 5.15.11 which is source-closed for now.
Going to review your patch shortly.
Concept ACK.
It looks like the upstream fix is
github.com/qt/qtbase@e07fea6fb4. The mentioned commit is a backport to the 6.4 branch.Please move patching into
qt.mk:Thank you for the suggestions and finding the upstream patch. The problem with just patching here is that it gets overwritten by
github.com/bitcoin-core/gui-qml@3abea89591/src/Makefile.qt.include (L522)I see. Might be good to add a comment then?
Approach ACK 459ebacd8595ff5e3e0529183588e61d9f521662
@jarolrod Can you confirm that this PR fixes the issue?
Update from 459ebac to
f1fedfeACK
f1fedfebcc, I have reviewed the code and it looks OK, the patch applies cleanly. Did not test on Android.ping :)
ACK
f1fedfebccTesting now with proper cpu and wifi locks, I know believe this was more of a warning than a bug. But this is now gone with the patch.