Describe the bug
While creating a sample database for #519 I encountered this crash in the autofill user flow.
To Reproduce
Sign in with KeePassDXExpected behavior
Autofill suggests successfully.
Keepass Database
password)KeePassDX (please complete the following information):
Device:
Additional context
Add any other context about the problem here.
Logcat:
FATAL EXCEPTION: main
Process: com.kunzisoft.keepass.libre, PID: 29114
java.lang.IllegalStateException: Immutable bitmap passed to Canvas constructor
at android.graphics.Canvas.<init>(Canvas.java:115)
at com.kunzisoft.keepass.icons.IconDrawableFactory.assignDrawableToRemoteViews(IconDrawableFactory.kt:83)
at com.kunzisoft.keepass.icons.IconDrawableFactoryKt.assignDatabaseIcon(IconDrawableFactory.kt:289)
at com.kunzisoft.keepass.autofill.AutofillHelper.newRemoteViews(AutofillHelper.kt:218)
at com.kunzisoft.keepass.autofill.AutofillHelper.buildDataset$app_libreRelease(AutofillHelper.kt:95)
at com.kunzisoft.keepass.autofill.AutofillHelper.buildResponse(AutofillHelper.kt:133)
at com.kunzisoft.keepass.activities.PasswordActivity$launchGroupActivity$3$1.invoke(PasswordActivity.kt:277)
at com.kunzisoft.keepass.activities.PasswordActivity$launchGroupActivity$3$1.invoke(PasswordActivity.kt:75)
at com.kunzisoft.keepass.autofill.AutofillHelper.checkAutoSearchInfo(AutofillHelper.kt:169)
at com.kunzisoft.keepass.activities.PasswordActivity$launchGroupActivity$3.invoke(PasswordActivity.kt:272)
at com.kunzisoft.keepass.activities.PasswordActivity$launchGroupActivity$3.invoke(PasswordActivity.kt:75)
at com.kunzisoft.keepass.activities.helpers.EntrySelectionHelper.doEntrySelectionAction(EntrySelectionHelper.kt:58)
at com.kunzisoft.keepass.activities.PasswordActivity.launchGroupActivity(PasswordActivity.kt:258)
at com.kunzisoft.keepass.activities.PasswordActivity.access$launchGroupActivity(PasswordActivity.kt:75)
at com.kunzisoft.keepass.activities.PasswordActivity$onCreate$$inlined$apply$lambda$1.invoke(PasswordActivity.kt:184)
at com.kunzisoft.keepass.activities.PasswordActivity$onCreate$$inlined$apply$lambda$1.invoke(PasswordActivity.kt:75)
at com.kunzisoft.keepass.database.action.ProgressDialogThread$actionTaskListener$1.onStopAction(ProgressDialogThread.kt:105)
at com.kunzisoft.keepass.notifications.DatabaseTaskNotificationService$onStartCommand$$inlined$let$lambda$2.invoke(DatabaseTaskNotificationService.kt:174)
at com.kunzisoft.keepass.notifications.DatabaseTaskNotificationService$onStartCommand$$inlined$let$lambda$2.invoke(DatabaseTaskNotificationService.kt:47)
at com.kunzisoft.keepass.notifications.DatabaseTaskNotificationService$ActionRunnableAsyncTask.onPostExecute(DatabaseTaskNotificationService.kt:594)
at com.kunzisoft.keepass.notifications.DatabaseTaskNotificationService$ActionRunnableAsyncTask.onPostExecute(DatabaseTaskNotificationService.kt:569)
at android.os.AsyncTask.finish(AsyncTask.java:695)
at android.os.AsyncTask.access$600(AsyncTask.java:180)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6718)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
~I could NOT reproduce this on my OnePlus 7 (OxygenOs 10.0.4) nor with my real database on this very OnePlus 5.
Only the test database crashes the app (though reproducibly), and only on this device.~
~I haven't tried reinstalling KeePassDX though. Nevertheless, I guess it doesn't hurt pasting the logcat here, feel free to close.~
EDIT: I could reproduce it better. The crash only occurs when the classic icon pack is selected, the Material icon pack works.
Thank you, it seems that the problem comes from the new display of icons in the autofill.
RemoteViews are finicky depending on the device, I don't know why. I will capture an exception to display the default icon if the remoteView does not want to display the image.
I was able to narrow it down, i.e. make it crash on both devices :)
The culprit seems to be the classic icon pack, the Material icon pack works fine. See updates issue description above.
Indeed, in this case, I will improve the solution for this problem. The drawable tries to be tinted while the image is immutable, that's the issue, I hadn't thought of this detail...
Most helpful comment
I was able to narrow it down, i.e. make it crash on both devices :)
The culprit seems to be the classic icon pack, the Material icon pack works fine. See updates issue description above.